private ILaunchConfiguration[] getGradleLaunchConfigurations() { ILaunchConfigurationType launchConfigurationType = this.launchManager.getLaunchConfigurationType(GradleRunConfigurationDelegate.ID); try { return this.launchManager.getLaunchConfigurations(launchConfigurationType); } catch (CoreException e) { throw new GradlePluginsRuntimeException("Cannot get Gradle launch configurations.", e); } }
public JUnitTestRunListener( ILaunchManager launchManager, ResourceManager resourceManager, ProgressUI progressUI ) { this.launchListener = new LaunchTerminatedListener(); this.resourceManager = resourceManager; this.progressUI = progressUI; this.launchManager = launchManager; this.launchManager.addLaunchListener( launchListener ); }
@Override public void launchesRemoved(ILaunch[] launches) { if (Arrays.asList(launches).contains(fLaunch)) { if (fTestRunnerClient != null) { fTestRunnerClient.stopWaiting(); } launchManager.removeLaunchListener(this); } } @Override
private void attachSelfToLaunchManager() { ILaunchManager launchManager = getLaunchManager(); launchManager.addLaunchListener(this); // heuristic... rather than updating all the time, just assume there's // something that's not terminated. setEnabled(launchManager.getLaunches().length > 0); }
/** * Creates a new launch history for the given launch group */ public LaunchHistory(ILaunchGroup group) { fGroup = group; ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); manager.addLaunchListener(this); manager.addLaunchConfigurationListener(this); fgLaunchHistoryInstances.add(this); }
@Override protected ILaunchConfigurationType getConfigurationType() { return getLaunchManager().getLaunchConfigurationType( RutaLaunchConfigurationConstants.ID_RUTA_SCRIPT); }
/** * Creates an {@link ILaunchConfiguration} from the given set of {@link ILaunchConfigurationType}s * @param types the set of {@link String} {@link ILaunchConfigurationType} identifiers * @return a new {@link ILaunchConfiguration} * @since 3.6 */ private ILaunchConfiguration createConfigurationFromTypes(Set<String> types) { //context launching always takes the first type, so we do that here as well if(types != null && types.size() > 0) { try { ILaunchConfigurationType type = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType((String) types.toArray()[0]); ILaunchConfigurationWorkingCopy copy = type.newInstance(null, DebugPlugin.getDefault().getLaunchManager().generateLaunchConfigurationName(LaunchConfigurationsMessages.CreateLaunchConfigurationAction_New_configuration_2)); return copy; } catch(CoreException ce) { //do nothing return null } } return null; }
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; }
protected ILaunchConfiguration getLaunchConfiguration(IServer server, ModuleArtifactDelegate moduleArtifact, ILaunchableAdapter launchableAdapter2, IClient client2, IProgressMonitor monitor) throws CoreException { String serverId = server.getId(); ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); ILaunchConfigurationType launchConfigType = launchManager.getLaunchConfigurationType("org.eclipse.wst.server.ui.launchConfigurationType"); ILaunchConfiguration[] launchConfigs = null; try { launchConfigs = launchManager.getLaunchConfigurations(launchConfigType); } catch (CoreException e) { launchName = launchManager.generateUniqueLaunchConfigurationNameFrom(launchName); ILaunchConfigurationWorkingCopy wc = launchConfigType.newInstance(null, launchName); wc.setAttribute(RunOnServerLaunchConfigurationDelegate.ATTR_SERVER_ID, serverId);
private ILaunchConfiguration[] getConfigurationTypeChildren(ILaunchConfigurationType launchConfigurationTypeParent) throws CoreException { return lm.getLaunchConfigurations(launchConfigurationTypeParent, ILaunchConfiguration.CONFIGURATION | ILaunchConfiguration.PROTOTYPE); }
private void hookListener(boolean add) { DebugPlugin debugPlugin = DebugPlugin.getDefault(); ILaunchManager launchManager = debugPlugin.getLaunchManager(); if (add) { launchManager.addLaunchListener(this); debugPlugin.addDebugEventListener(this); } else { launchManager.removeLaunchListener(this); debugPlugin.removeDebugEventListener(this); } }
@Override public String generateName(String name) { if (name == null) { name = ""; //$NON-NLS-1$ } String providerConfigutationName = generateProviderConfigurationName(name, providerToolName); return getLaunchManager().generateLaunchConfigurationName(providerConfigutationName); } };
try { ILaunchConfiguration[] configs = DebugPlugin.getDefault() .getLaunchManager().getLaunchConfigurations(type); for (int i = 0; i < configs.length; i++) { try .generateUniqueLaunchConfigurationNameFrom(newProc.getProcName()); copy.rename(newName);
/** * Removes the specified launch and notifies listeners. Has no effect if an identical launch is * not already registered. This is a convenience method for a call to * ILaunchManager.removeLaunch(). * * @param launch the launch to remove */ public static void removeLaunch(ILaunch launch) { DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch); }
/** * Disposes this history */ public void dispose() { ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); manager.removeLaunchListener(this); manager.removeLaunchConfigurationListener(this); fgLaunchHistoryInstances.remove(this); }
public String uniqueLCName(String prefix) { return getLaunchManager().generateUniqueLaunchConfigurationNameFrom(prefix); }
/** * Removes terminated launches from the launch view, leaving the specified launch in the view * @param newLaunch the newly added launch to leave in the view */ protected void removeTerminatedLaunches(ILaunch newLaunch) { if (DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugUIConstants.PREF_AUTO_REMOVE_OLD_LAUNCHES)) { ILaunchManager lManager= DebugPlugin.getDefault().getLaunchManager(); Object[] launches= lManager.getLaunches(); for (int i= 0; i < launches.length; i++) { ILaunch launch= (ILaunch)launches[i]; if (launch != newLaunch && launch.isTerminated()) { lManager.removeLaunch(launch); } } } }
workingCopy.setAttribute(ATTR_LAUNCHING_CONFIG_HANDLE, configuration.getMemento()); final ILaunch pendingLaunch = new PendingLaunch(workingCopy, mode, this); DebugPlugin.getDefault().getLaunchManager().addLaunch(pendingLaunch); IJobChangeListener listener= new IJobChangeListener() { @Override DebugPlugin.getDefault().getLaunchManager().removeLaunch(pendingLaunch);
ILaunchConfigurationType getConfigurationType() { return getLaunchManager() .getLaunchConfigurationType("aQute.bnd.launch"); }
private ILaunchConfiguration createLaunchConfiguration(GradleRunConfigurationAttributes configurationAttributes) { // derive the name of the launch configuration from the configuration attributes // since the launch configuration name must not contain ':', we replace all ':' with '.' String taskNamesOrDefault = configurationAttributes.getTasks().isEmpty() ? "(default tasks)" : CollectionsUtils.joinWithSpace(configurationAttributes.getTasks()); String rawLaunchConfigurationName = String.format("%s - %s", configurationAttributes.getWorkingDir().getName(), taskNamesOrDefault); String launchConfigurationName = this.launchManager.generateLaunchConfigurationName(rawLaunchConfigurationName.replace(':', '.')); ILaunchConfigurationType launchConfigurationType = this.launchManager.getLaunchConfigurationType(GradleRunConfigurationDelegate.ID); try { // create new launch configuration instance ILaunchConfigurationWorkingCopy launchConfiguration = launchConfigurationType.newInstance(null, launchConfigurationName); // configure the launch configuration configurationAttributes.apply(launchConfiguration); // try to persist the launch configuration and return it return persistConfiguration(launchConfiguration); } catch (CoreException e) { throw new GradlePluginsRuntimeException(String.format("Cannot create Gradle launch configuration %s.", launchConfigurationName), e); } }