/** * Returns the names of the launch configurations passed in as original input to the tree viewer * @return the names of the original launch configurations */ private Set<String> getConfigurationNames() { Set<String> names = new HashSet<>(); for(ILaunchConfiguration config : fOriginalCandidates) { names.add(config.getName()); } for(ILaunchConfigurationWorkingCopy config : fChangedConfigurations) { names.add(config.getName()); } return names; }
public void performApply(ILaunchConfigurationWorkingCopy configuration) { configuration.setAttribute(IPDELauncherConstants.CONFIG_USE_DEFAULT_AREA, fUseDefaultLocationButton.getSelection()); // Check if the default area has changed because the launch config name changed if (fUseDefaultLocationButton.getSelection() && !fLastKnownConfigName.equals(configuration.getName())) { fLocationText.setText(DEFAULT_DIR + configuration.getName()); } configuration.setAttribute(IPDELauncherConstants.CONFIG_LOCATION, getLocation()); configuration.setAttribute(IPDELauncherConstants.CONFIG_CLEAR_AREA, fClearConfig.getSelection()); }
ILaunchConfigurationWorkingCopy workingCopy = launchConfig.getWorkingCopy(); workingCopy.delete(); ILaunchConfigurationType launchType = launchConfig.getType(); IContainer container = launchConfig.getFile() == null ? null : launchConfig.getFile().getParent(); ILaunchConfigurationWorkingCopy newLaunchConfig = launchType.newInstance( container, workingCopy.getName() ); // copy all attributes from 'launchConfig' to 'newLaunchConfig' newLaunchConfig.doSave();
public void performApply(ILaunchConfigurationWorkingCopy config, boolean isJUnit) { /* * Update the workspace location when the configuration name changed and ... * - the workspace location has not been changed manually * - the launch configuration is new but not created as duplicate */ String currentLocation = getLocation(); String currentName = config.getName(); if (fLastKnownName != null && !fLastKnownName.equals(currentName)) { if (currentLocation.equals(fLastKnownLocation)) { if (fIsCreatedLaunchConfiguration) { currentLocation = LaunchArgumentsHelper.getDefaultWorkspaceLocation(currentName, isJUnit); fLocationText.setText(currentLocation); fLastKnownName = currentName; fLastKnownLocation = currentLocation; } } } config.setAttribute(IPDELauncherConstants.LOCATION, currentLocation); config.setAttribute(IPDELauncherConstants.DOCLEAR, fClearWorkspaceCheck.getSelection()); config.setAttribute(IPDELauncherConstants.ASKCLEAR, fAskClearCheck.getSelection()); config.setAttribute(IPDEConstants.DOCLEARLOG, fClearWorkspaceLogRadio.getSelection()); }
/** * Edit the selection */ private void handleEdit() { ILaunchConfigurationWorkingCopy config = getSelectedConfigurations()[0]; int ret = edit(config, false); if(ret == IDialogConstants.OK_ID) { fChangedConfigurations.add(config); fViewer.refresh(config, true, true); } else if(ret == IDialogConstants.ABORT_ID) { setErrorMessage(MessageFormat.format(DebugPreferencesMessages.RunDebugPropertiesPage_0, new Object[] { config.getName() })); } }
public void setDefaults(ILaunchConfigurationWorkingCopy configuration, boolean isJUnit) { configuration.setAttribute(IPDELauncherConstants.CONFIG_CLEAR_AREA, isJUnit); boolean useDefaultArea = !isJUnit || LaunchArgumentsHelper.getDefaultJUnitWorkspaceIsContainer(); configuration.setAttribute(IPDELauncherConstants.CONFIG_USE_DEFAULT_AREA, useDefaultArea); String location; if (isJUnit && !useDefaultArea) { location = LaunchArgumentsHelper.getDefaultJUnitConfigurationLocation(); } else { location = DEFAULT_DIR + configuration.getName(); } configuration.setAttribute(IPDELauncherConstants.CONFIG_LOCATION, location); }
@Override public boolean performOk() { //delete for (ILaunchConfigurationWorkingCopy currentConfig : fDeletedConfigurations) { try{ if (currentConfig.getOriginal() != null){ currentConfig.getOriginal().delete(); } } catch (CoreException e) { DebugPlugin.logMessage("Problem deleting configuration " + currentConfig.getName(), e); //$NON-NLS-1$ } } //add for (ILaunchConfigurationWorkingCopy currentConfig : fChangedConfigurations) { try{ currentConfig.doSave(); } catch (CoreException e) { DebugPlugin.logMessage("Problem saving changes to configuration " + currentConfig.getName(), e); //$NON-NLS-1$ } } return super.performOk(); }
public void setDefaults(ILaunchConfigurationWorkingCopy configuration, boolean isJUnit) { fLastKnownName = configuration.getName(); fLastKnownLocation = LaunchArgumentsHelper.getDefaultWorkspaceLocation(fLastKnownName, isJUnit); configuration.setAttribute(IPDELauncherConstants.LOCATION, fLastKnownLocation); configuration.setAttribute(IPDELauncherConstants.DOCLEAR, isJUnit); configuration.setAttribute(IPDELauncherConstants.ASKCLEAR, !isJUnit); configuration.setAttribute(IPDEConstants.DOCLEARLOG, false); configuration.setAttribute(ATTR_IS_NEWLY_CREATED, true); }
protected void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy config, IServer server, ModuleArtifactDelegate moduleArtifact, ILaunchableAdapter launchableAdapter, IClient client) { String launchName = NLS.bind(Messages.runOnServerLaunchConfigName, moduleArtifact.getName()); launchName = getValidLaunchConfigurationName(launchName); if (!launchName.equals(config.getName())) { ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); launchName = launchManager.generateUniqueLaunchConfigurationNameFrom(launchName); config.rename(launchName); } config.setAttribute(RunOnServerLaunchConfigurationDelegate.ATTR_SERVER_ID, server.getId()); config.setAttribute(RunOnServerLaunchConfigurationDelegate.ATTR_MODULE_ARTIFACT, moduleArtifact.serialize()); config.setAttribute(RunOnServerLaunchConfigurationDelegate.ATTR_MODULE_ARTIFACT_CLASS, moduleArtifact.getClass().getName()); config.setAttribute(RunOnServerLaunchConfigurationDelegate.ATTR_LAUNCHABLE_ADAPTER_ID, launchableAdapter.getId()); config.setAttribute(RunOnServerLaunchConfigurationDelegate.ATTR_CLIENT_ID, client.getId()); }
workingCopy.setContainer(getBuilderFolder(project, true)); String name = workingCopy.getName(); name = name.replace('/', '.'); if (name.charAt(0) == ('.')) {
StringBuffer buffer = new StringBuffer(MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationDialog_The_configuration___35, new Object[] { fTabViewer.getWorkingCopy().getName() })); buffer.append(fTabViewer.getErrorMesssage()); buffer.append(LaunchConfigurationsMessages.LaunchConfigurationDialog_Do_you_wish_to_discard_changes_37);
private int showSaveChangesDialog() { String message = MessageFormat.format( LaunchConfigurationsMessages.LaunchConfigurationDialog_ShowCommandLine_Apply_Revert_Question, new Object[] { getWorkingCopy().getName() }); MessageDialog dialog = new MessageDialog(getShell(), LaunchConfigurationsMessages.LaunchConfigurationDialog_ShowCommandLine_Apply_Revert_Title, null, message, MessageDialog.QUESTION, new String[] { LaunchConfigurationsMessages.LaunchConfigurationDialog_ShowCommandLine_Apply_Revert_Apply, LaunchConfigurationsMessages.LaunchConfigurationDialog_ShowCommandLine_Apply_Revert_Revert, LaunchConfigurationsMessages.LaunchConfigurationDialog_ShowCommandLine_Apply_Revert_Cancel }, 0); int ret = dialog.open(); int val = IDialogConstants.CANCEL_ID; if (ret == 0 || ret == 1) { if (ret == 0) { val = IDialogConstants.YES_ID; } else { val = IDialogConstants.NO_ID; } } return val; }
String message = MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationDialog_The_configuration___29, new Object[] { fTabViewer.getWorkingCopy().getName() }); MessageDialog dialog = new MessageDialog(getShell(), LaunchConfigurationsMessages.LaunchConfigurationFilteredTree_save_changes,
/** * Copy the selection */ private void handleCopy() { ILaunchConfigurationWorkingCopy configuration = getSelectedConfigurations()[0]; try { ILaunchConfigurationWorkingCopy copy = configuration.copy( ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).generateUniqueLaunchConfigurationNameFrom(configuration.getName(), getConfigurationNames())); copy.setAttributes(configuration.getAttributes()); fChangedConfigurations.add(copy); fViewer.add(copy); fViewer.setSelection(new StructuredSelection(copy)); } catch (CoreException e) { setErrorMessage(e.getMessage()); } }
String curConfigName = wc.getName(); Pattern configNamePattern = Pattern.compile(".+\\s\\[.+\\](\\s\\(\\d+\\))?$"); //$NON-NLS-1$ Matcher match = configNamePattern.matcher(curConfigName);
fNameWidget.setText(getWorkingCopy().getName());
setErrorMessage(MessageFormat.format(DebugPreferencesMessages.RunDebugPropertiesPage_0, new Object[] { wc.getName() }));
@Override protected ILaunchConfigurationWorkingCopy createLaunchConfiguration(IJavaElement element) throws CoreException { ILaunchConfigurationWorkingCopy configuration = super.createLaunchConfiguration(element); String configName = configuration.getName();
else if (TargetPlatformHelper.getTargetVersion() >= 3.2) wc.setAttribute(IPDEConstants.LAUNCHER_PDE_VERSION, "3.2a"); //$NON-NLS-1$ wc.setAttribute(IPDELauncherConstants.LOCATION, LaunchArgumentsHelper.getDefaultWorkspaceLocation(wc.getName())); initializeProgramArguments(wc); initializeVMArguments(wc);