@Override public String getLocalId() { return type.getIdentifier(); }
@Override public int hashCode() { if (fType != null) { int hash = fType.getIdentifier().hashCode(); if (fDelegate != null) { hash += fDelegate.hashCode(); } return hash; } return super.hashCode(); }
/** * @see ILaunchManager#getLaunchConfigurationType(String) */ @Override public ILaunchConfigurationType getLaunchConfigurationType(String id) { ILaunchConfigurationType[] types = getLaunchConfigurationTypes(); for(int i = 0; i < types.length; i++) { if (types[i].getIdentifier().equals(id)) { return types[i]; } } return null; }
/** * Returns the identifier of the help context that is associated with the * specified launch configuration type and mode, or <code>null</code> if none. * * @param type launch config type * @param mode launch mode * @return the identifier for the help context associated with the given * type of launch configuration, or <code>null</code> * @exception CoreException if an exception occurs creating the group * @since 2.1 */ public String getHelpContext(ILaunchConfigurationType type, String mode) throws CoreException { HashSet<String> modes = new HashSet<>(); modes.add(mode); LaunchConfigurationTabGroupExtension ext = getExtension(type.getIdentifier(), modes); if (ext == null) { IStatus status = new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, "No tab group defined for launch configuration type " + type.getIdentifier(), null); //$NON-NLS-1$ throw new CoreException(status); } return ext.getHelpContextId(); }
public static boolean isSupported(ILaunchConfiguration configuration) { try { return launchConfigTypeFor(configuration.getType().getIdentifier()) != null; } catch (CoreException e) { return false; } }
/** * Returns the tab group for the given launch configuration type and mode. * * @param type launch configuration type * @param mode launch mode * @return the tab group for the given type of launch configuration, or <code>null</code> if none * @exception CoreException if an exception occurs creating the group */ public ILaunchConfigurationTabGroup getTabGroup(ILaunchConfigurationType type, String mode) throws CoreException { HashSet<String> modes = new HashSet<>(); modes.add(mode); LaunchConfigurationTabGroupExtension ext = getExtension(type.getIdentifier(), modes); if (ext == null) { IStatus status = new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, "No tab group defined for launch configuration type " + type.getIdentifier(), null); //$NON-NLS-1$ throw new CoreException(status); } return new LaunchConfigurationTabGroupWrapper(ext.newTabGroup(), ext.getIdentifier(), null); }
/** * Two <code>LaunchConfigurationInfo</code> objects are equal if and only * if they have the same type and they have the same set of attributes with * the same values. * * @see Object#equals(Object) */ @Override public boolean equals(Object obj) { // Make sure it's a LaunchConfigurationInfo object if (!(obj instanceof LaunchConfigurationInfo)) { return false; } // Make sure the types are the same LaunchConfigurationInfo other = (LaunchConfigurationInfo) obj; if (!fType.getIdentifier().equals(other.getType().getIdentifier())) { return false; } // Make sure the attributes are the same return compareAttributes(fAttributes, other.getAttributeTable()); }
public static Set<IPackageFragmentRoot> collectSourceFolders(ILaunchConfiguration configuration) throws CoreException { SupportedLaunchConfigType type = launchConfigTypeFor(configuration.getType().getIdentifier()); if (type == null) { return ImmutableSet.of(); } return type.getSourceFolders(configuration); }
private void setMappedResources(ILaunchConfigurationWorkingCopy configuration) { // Don't map resources for external tool builders - they don't show up in the launch history try { if (!IAntLaunchConstants.ID_ANT_BUILDER_LAUNCH_CONFIGURATION_TYPE.equals(configuration.getType().getIdentifier())) { IFile file = getIFile(configuration); configuration.setMappedResources(new IResource[] { file }); } } catch (CoreException e) { // do nothing } }
@Override public boolean select(Viewer viewer, Object parentElement, Object element) { if(element instanceof ILaunchConfiguration) { return true; } //we only care about launch configuration types if(element instanceof ILaunchConfigurationType) { IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore(); String[] types = store.getString(IInternalDebugUIConstants.PREF_FILTER_TYPE_LIST).split("\\,"); //$NON-NLS-1$ for(int i = 0; i < types.length; i++) { if(types[i].equals(((ILaunchConfigurationType)element).getIdentifier())) { return false; } } return true; } return false; }
/** * Returns the tab group for the given launch configuration and the mode the dialog opened in * @param type the type of the configuration * @param config * @param mode * @return * @throws CoreException */ public ILaunchConfigurationTabGroup getTabGroup(ILaunchConfiguration config, String mode) throws CoreException { HashSet<String> modes = new HashSet<>(); modes.add(mode); LaunchConfigurationTabGroupExtension ext = getExtension(config.getType().getIdentifier(), modes); if (ext == null) { IStatus status = new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, "No tab group defined for launch configuration type " + config.getType().getIdentifier(), null); //$NON-NLS-1$ throw new CoreException(status); } return new LaunchConfigurationTabGroupWrapper(ext.newTabGroup(), ext.getIdentifier(), config); }
@Override public Object[] getChildren(Object parentElement) { if(parentElement instanceof ILaunchConfigurationType) { ILaunchConfigurationType type = (ILaunchConfigurationType) parentElement; return ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getLaunchDelegates(type.getIdentifier()); } return new Object[0]; } @Override
private IPluginBase[] getPlugins() { IPluginModelBase[] models = null; try { ILaunchConfigurationType type = fLaunchConfig.getType(); String id = type.getIdentifier(); // if it is an Eclipse launch if (id.equals(EclipseLaunchShortcut.CONFIGURATION_TYPE)) models = BundleLauncherHelper.getMergedBundles(fLaunchConfig, false); // else if it is an OSGi launch else if (id.equals(IPDELauncherConstants.OSGI_CONFIGURATION_TYPE)) models = BundleLauncherHelper.getMergedBundles(fLaunchConfig, true); } catch (CoreException e) { } IPluginBase[] result = new IPluginBase[models == null ? 0 : models.length]; for (int i = 0; i < result.length; i++) result[i] = models[i].getPluginBase(true); return result; }
/** * Returns the default perspective to switch to when a configuration of the given type is launched by the specified * launch delegate in the given mode set, or <code>null</code> if none * @param type the type * @param delegate the associated delegate, or <code>null</code> to specify that the default perspective id for that given type and mode set should be returned * @param modes the set of modes this applies to * @return the default perspective id for the given type, delegate and mode set combination, or <code>null</code> if none * * @since 3.3 */ public String getDefaultLaunchPerspective(ILaunchConfigurationType type, ILaunchDelegate delegate, Set<String> modes) { String id = null; if(delegate != null) { id = delegate.getPerspectiveId(modes); } if(id == null) { LaunchConfigurationTabGroupExtension extension = LaunchConfigurationPresentationManager.getDefault().getExtension(type.getIdentifier(), modes); if (extension != null) { id = extension.getPerspective(modes); if (id == null) { if (modes.contains(ILaunchManager.DEBUG_MODE)) { id = IDebugUIConstants.ID_DEBUG_PERSPECTIVE; } } } } return id; }
for(int k = 0; k < items.length; k++) { ILaunchConfigurationType type = (ILaunchConfigurationType)items[k].getData(); if(type.getIdentifier().equals(nodes[i])) { toexpand.add(type);
@Override public boolean performOk() { //save field editors for(int i = 0; i < fFieldEditors.size(); i++) { fFieldEditors.get(i).store(); } Preferences.setBoolean(DebugPlugin.getUniqueIdentifier(), DebugPlugin.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE, fDeleteConfigs.getSelection(), null); //save table String types = IInternalDebugCoreConstants.EMPTY_STRING; TableItem[] items = fTable.getItems(); ILaunchConfigurationType type; for(int i = 0; i < items.length; i++) { if(items[i].getChecked()) { type = (ILaunchConfigurationType)items[i].getData(); types += type.getIdentifier()+","; //$NON-NLS-1$ } } getPreferenceStore().setValue(IInternalDebugUIConstants.PREF_FILTER_TYPE_LIST, types); return super.performOk(); } }
/** * Initializes the field editors to their values * @since 3.2 */ private void initFieldEditors() { FieldEditor editor; for(int i = 0; i < fFieldEditors.size(); i++) { editor = fFieldEditors.get(i); editor.setPreferenceStore(getPreferenceStore()); editor.load(); } fDeleteConfigs.setSelection( Platform.getPreferencesService().getBoolean(DebugPlugin.getUniqueIdentifier(), DebugPlugin.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE, true, null)); //restore the tables' checked state String[] types = getPreferenceStore().getString(IInternalDebugUIConstants.PREF_FILTER_TYPE_LIST).split("\\,"); //$NON-NLS-1$ TableItem[] items = fTable.getItems(); ILaunchConfigurationType type; for(int i = 0; i < types.length; i++) { for(int j = 0; j < items.length; j++) { type = (ILaunchConfigurationType)items[j].getData(); if(type.getIdentifier().equals(types[i])) { items[j].setChecked(true); } } } }
/** * Goes through all the dart launches registered with the {@link ILaunchManager} and removes the * terminated launches * * @throws CoreException */ public static void removeTerminatedLaunches() throws CoreException { ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches(); for (ILaunch launch : launches) { if (launch.getLaunchConfiguration() == null || (launch.getLaunchConfiguration().getType().getIdentifier().startsWith( "com.github.sdbg") && launch.isTerminated())) { removeLaunch(launch); } } }
/** * Computes and returns the image descriptor for this console. * * @return an image descriptor for this console or <code>null</code> */ protected ImageDescriptor computeImageDescriptor() { ILaunchConfiguration configuration = getProcess().getLaunch().getLaunchConfiguration(); if (configuration != null) { ILaunchConfigurationType type; try { type = configuration.getType(); return DebugPluginImages.getImageDescriptor(type.getIdentifier()); } catch (CoreException e) { DebugUIPlugin.log(e); } } return null; }
@Override public Image getColumnImage(Object element, int columnIndex) { if (!(element instanceof GroupLaunchElement)) { return null; } if (columnIndex == 0) { GroupLaunchElement el = (GroupLaunchElement) element; if (el.data == null || !isValidLaunchReference(el.data)) { Image errorImage = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK); return errorImage; } try { String key = el.data.getType().getIdentifier(); return DebugPluginImages.getImage(key); } catch (CoreException e) { Image errorImage = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK); return errorImage; } } return null; }