@SuppressWarnings("rawtypes") public Set getModes() throws CoreException { return delegate.getModes(); }
/** * Returns the perspective associated with the * given launch, or <code>null</code> if none. * * @param launch a launch * @return the perspective associated with the launch, * or <code>null</code> * @exception CoreException if unable to retrieve a required * launch configuration attribute */ protected String getPerspectiveId(ILaunch launch) throws CoreException { if (launch == null) { return null; } ILaunchConfiguration config = launch.getLaunchConfiguration(); if (config == null) { return null; } Set<String> modes = launch.getLaunchConfiguration().getModes(); modes.add(launch.getLaunchMode()); String perspectiveId = getLaunchPerspective(config.getType(), modes, resolveLaunchDelegate(launch)); if (perspectiveId != null && perspectiveId.equals(IDebugUIConstants.PERSPECTIVE_NONE)) { perspectiveId = null; } return perspectiveId; }
Set<String> modes = config.getModes(); modes.add(mode); ILaunchDelegate delegate = config.getPreferredDelegate(modes);
private ILaunchConfiguration getLaunchConfiguration(String mode, IResource resource) { ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); ILaunchConfigurationType configType = launchManager .getLaunchConfigurationType("org.eclipse.acute.dotnetrun.DotnetRunDelegate"); //$NON-NLS-1$ try { ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations(configType); String configName; if (resource.getLocation().toFile().isFile()) { configName = NLS.bind(Messages.DotnetRunDelegate_configuration, resource.getParent().getName() + "." + resource.getName()); //$NON-NLS-1$ } else { configName = NLS.bind(Messages.DotnetRunDelegate_configuration, resource.getName()); } for (ILaunchConfiguration iLaunchConfiguration : launchConfigurations) { if (iLaunchConfiguration.getName().equals(configName) && iLaunchConfiguration.getModes().contains(mode)) { return iLaunchConfiguration; } } configName = launchManager.generateLaunchConfigurationName(configName); ILaunchConfigurationWorkingCopy wc = configType.newInstance(null, configName); if (resource.getLocation().toFile().isFile()) { resource = resource.getParent(); } wc.setAttribute(PROJECT_FOLDER, resource.getLocation().toString()); return wc; } catch (CoreException e) { AcutePlugin.logError(e); } return null; }
ILaunchConfiguration config = iterator.next(); try { Set<String> modes = config.getModes(); modes.add(mode); if (!config.getType().supportsModeCombination(modes)) {
&& iLaunchConfiguration.getModes().contains(mode)) { return iLaunchConfiguration;
HashSet<String> modes = new HashSet<>(); modes.add(mode); modes.addAll(config.getModes()); SelectLaunchersDialog sldd = new SelectLaunchersDialog(shell, config.getType().getDelegates(modes),
&& iLaunchConfiguration.getModes().contains(mode)) { return iLaunchConfiguration;
/** * Resolves the <code>ILaunchDelegate</code> from the given <code>ILaunch</code> * @param launch the launch * @return * @throws CoreException */ private ILaunchDelegate resolveLaunchDelegate(ILaunch launch) throws CoreException { Set<String> modes = launch.getLaunchConfiguration().getModes(); modes.add(launch.getLaunchMode()); ILaunchConfigurationType type = launch.getLaunchConfiguration().getType(); ILaunchDelegate[] delegates = LaunchConfigurationManager.filterLaunchDelegates(type, modes); ILaunchDelegate delegate = null; if(delegates.length == 1) { delegate = delegates[0]; } else if(delegates.length > 1) { delegate = launch.getLaunchConfiguration().getPreferredDelegate(modes); if(delegate == null) { delegate = type.getPreferredDelegate(modes); } } return delegate; }
if (configuration.getModes().isEmpty()) { if (!configuration.supportsMode(mode)) { ILaunchMode launchMode = DebugPlugin.getDefault().getLaunchManager().getLaunchMode(mode);
Set<String> modes = flaunchConfiguration.getModes(); modes.add(fMode); ILaunchDelegate[] delegates = flaunchConfiguration.getType().getDelegates(modes);