public static String getLabel(String mode) { if (mode == null || mode.isEmpty()) { return ""; //$NON-NLS-1$ } if (modes == null) { initializeModes(); } ILaunchGroup launchGrp = modes.get(mode); return DebugUIPlugin.removeAccelerators(launchGrp.getLabel()); } }
/** * Returns a label to use for launch mode with accelerators removed. * * @return label to use for launch mode with accelerators removed */ private String getModeLabel() { return DebugUIPlugin.removeAccelerators(fHistory.getLaunchGroup().getLabel()); }
/** * Returns a label to use for launch mode with accelerators removed. * * @return label to use for launch mode with accelerators removed */ private String getModeLabel() { return DebugUIPlugin.removeAccelerators(fHistory.getLaunchGroup().getLabel()); }
private static synchronized void initializeModes() { if (modes != null) { return; } modes = new LinkedHashMap<>(); modes.put(GroupLaunchElement.MODE_INHERIT, new InheritModeGroup()); Set<ILaunchGroup> sortedGroups = new TreeSet<>((a, b) -> { return a.getLabel().compareTo(b.getLabel()); }); LaunchConfigurationManager mgr = DebugUIPlugin.getDefault().getLaunchConfigurationManager(); sortedGroups.addAll(Arrays.asList(mgr.getLaunchGroups())); for (ILaunchGroup launchGroup : sortedGroups) { LaunchHistory history = mgr.getLaunchHistory(launchGroup.getIdentifier()); if (history == null) { // mode currently not supported. continue; } String modeName = launchGroup.getMode(); if (!modes.containsKey(modeName)) { modes.put(modeName, launchGroup); } } }
String launchGrpLabel = DebugUIPlugin.removeAccelerators(launchGrp.getLabel()); labelToMode.put(launchGrpLabel, modeName); });
/** * Returns this action's tooltip. The tooltip is retrieved from the launch resource manager * which builds tool tips asynchronously for context launching support. * * @return the string for the tool tip */ private String getToolTip() { String launchName = DebugUIPlugin.getDefault().getLaunchingResourceManager().getLaunchLabel(fLaunchGroup); if(launchName == null) { return DebugUIPlugin.removeAccelerators(internalGetHistory().getLaunchGroup().getLabel()); } String label = null; String mode = getMode(); if (mode.equals(ILaunchManager.RUN_MODE)) { label = ActionMessages.AbstractLaunchHistoryAction_1; } else if (mode.equals(ILaunchManager.DEBUG_MODE)){ label = ActionMessages.AbstractLaunchHistoryAction_2; } else if (mode.equals(ILaunchManager.PROFILE_MODE)){ label = ActionMessages.AbstractLaunchHistoryAction_3; } else { label = ActionMessages.AbstractLaunchHistoryAction_4; } if(IInternalDebugCoreConstants.EMPTY_STRING.equals(launchName)) { return MessageFormat.format(ActionMessages.AbstractLaunchHistoryAction_5, new Object[] { label }); } else { return MessageFormat.format(ActionMessages.AbstractLaunchHistoryAction_0, new Object[] { label, launchName }); } }
/** * Constructs an action that opens the launch configuration dialog in * the context of the specified launch group. * * @param identifier unique identifier of a launch group extension */ public OpenLaunchDialogAction(String identifier) { fIdentifier = identifier; ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(fIdentifier); if(group != null) { String lbl = group.getLabel(); String actionLabel = MessageFormat.format(ActionMessages.OpenLaunchDialogAction_1, new Object[] { lbl }); setText(DebugUIPlugin.adjustDBCSAccelerator(actionLabel)); } PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.OPEN_LAUNCH_CONFIGURATION_ACTION); }
setLaunchConfiguration(configuration); setMode(launch.getLaunchMode()); setText(MessageFormat.format(ActionMessages.AddToFavoritesAction_1, new Object[] { DebugUIPlugin.removeAccelerators(getGroup().getLabel()) }));