/** * Returns a sorted list of launch mode names corresponding to the given identifiers. * * @param modes set of launch mode identifiers * @return sorted list of launch mode names */ public List<String> getLaunchModeNames(Set<String> modes) { List<String> names = new ArrayList<>(); ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); for (String id : modes) { ILaunchMode mode = manager.getLaunchMode(id); if (mode == null) { names.add(id); } else { names.add(DebugUIPlugin.removeAccelerators(mode.getLabel())); } } Collections.sort(names); return names; }
/** * Returns the label of the mode id with all accelerators removed * @param modeid the id of the mode i.e. 'run' * @return the formatted label of the specified mode id with all accelerators removed, or <code>null</code> if no label is available * @since 3.3 */ public String getLaunchModeLabel(String modeid) { String mode = null; ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); ILaunchMode lmode = manager.getLaunchMode(modeid); if(lmode != null) { return lmode.getLabel(); } return mode; }
/** * Returns the appropriate text for the launch button - run or debug. * * @return the launch button text */ protected String getLaunchButtonText() { return DebugPlugin.getDefault().getLaunchManager().getLaunchMode(getMode()).getLabel(); }
@Override public ILaunchConfigurationDelegate getDelegate(String mode) throws CoreException { Set<String> modes = new HashSet<String>(); modes.add(mode); ILaunchDelegate[] delegates = getDelegates(modes); if (delegates.length > 0) { return delegates[0].getDelegate(); } IStatus status = null; ILaunchMode launchMode = DebugPlugin.getDefault().getLaunchManager().getLaunchMode(mode); if (launchMode == null) { status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_7, new Object[] { mode })); } else { status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_7, new Object[] { ((LaunchManager) DebugPlugin.getDefault().getLaunchManager()).getLaunchModeName(mode) })); } throw new CoreException(status); }
/** * Creates a cascading menu action to populate with shortcuts in the given * launch group. * * @param launchGroupIdentifier launch group identifier */ public LaunchAsAction(String launchGroupIdentifier) { super(); fLaunchGroupIdentifier = launchGroupIdentifier; ILaunchMode launchMode = DebugPlugin.getDefault().getLaunchManager().getLaunchMode(getMode()); setText(launchMode.getLaunchAsLabel()); setMenuCreator(this); }
ILaunchMode launchMode = DebugPlugin.getDefault().getLaunchManager().getLaunchMode(mode); if (launchMode == null) { DebugUIPlugin.logErrorMessage("Unsupported launch mode: " + mode); //$NON-NLS-1$
/** * Creates a cascading menu action to populate with shortcuts in the given * launch group. * * @param launchGroupIdentifier launch group identifier */ public LaunchShortcutsAction(String launchGroupIdentifier) { super(); fGroup = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(launchGroupIdentifier); ILaunchMode mode = DebugPlugin.getDefault().getLaunchManager().getLaunchMode(fGroup.getMode()); setText(mode.getLaunchAsLabel()); setMenuCreator(this); setEnabled(existsConfigTypesForMode()); }
/** * Constructor * @param input * @param resource * @param mode */ public LaunchShortcutSelectionDialog(List<LaunchShortcutExtension> shortcuts, IResource resource, String mode) { super(DebugUIPlugin.getShell()); setShellStyle(getShellStyle() | SWT.RESIZE); fShortcuts = shortcuts; fResource = resource; fMode = mode; ILaunchMode lmode = DebugPlugin.getDefault().getLaunchManager().getLaunchMode(mode); fModeName = mode; if (lmode != null) { fModeName = DebugUIPlugin.removeAccelerators(lmode.getLabel()); } setTitle(MessageFormat.format(LaunchConfigurationsMessages.LaunchShortcutSelectionDialog_0, new Object[] { fModeName })); }