Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations')
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuildTab.java384
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuilderTab.java531
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsLaunchConfigurationMessages.java94
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsLaunchConfigurationMessages.properties73
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsMainTab.java646
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsUtil.java147
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/IgnoreWhiteSpaceComparator.java47
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/WorkingSetComparator.java52
8 files changed, 0 insertions, 1974 deletions
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuildTab.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuildTab.java
deleted file mode 100644
index 35af87097..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuildTab.java
+++ /dev/null
@@ -1,384 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * dakshinamurthy.karra@gmail.com - bug 165371
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.launchConfigurations;
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.externaltools.internal.IExternalToolConstants;
-import org.eclipse.core.externaltools.internal.launchConfigurations.ExternalToolsCoreUtil;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.dialogs.ListSelectionDialog;
-import org.eclipse.ui.externaltools.internal.model.ExternalToolsImages;
-import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-/**
- * A launch configuration tab which allows the user to specify
- * which resources should be built before a build (a build scope)
- * <p>
- * This class may be instantiated; this class is not intended
- * to be subclassed.
- * </p>
- * A generalized version of AntBuildTab which was removed after the work of bug 165371
- * @since 3.4
- */
-public class ExternalToolsBuildTab extends AbstractLaunchConfigurationTab {
- // Check Buttons
- private Button fBuildButton;
-
- // Group box
- private Group fGroup;
-
- // Radio Buttons
- private Button fProjectButton;
- private Button fSpecificProjectsButton;
- private Button fWorkspaceButton;
-
- // Push Button
- private Button fSelectButton;
-
- // whether to include referenced projects
- private Button fReferencedProjects;
-
- // projects to build (empty if none)
- private List fProjects = new ArrayList();
-
- class ProjectsContentProvider implements IStructuredContentProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- public Object[] getElements(Object inputElement) {
- return ((IWorkspace)inputElement).getRoot().getProjects();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- }
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- Composite mainComposite = new Composite(parent, SWT.NONE);
- setControl(mainComposite);
-
- GridLayout layout = new GridLayout();
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- mainComposite.setLayout(layout);
- mainComposite.setLayoutData(gd);
- mainComposite.setFont(parent.getFont());
-
- fBuildButton = createCheckButton(mainComposite, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_1);
- fBuildButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateEnabledState();
- updateLaunchConfigurationDialog();
- }
- });
-
- fGroup = new Group(mainComposite, SWT.NONE);
- fGroup.setFont(mainComposite.getFont());
- layout = new GridLayout();
- layout.numColumns = 2;
- layout.makeColumnsEqualWidth = false;
- fGroup.setLayout(layout);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- fGroup.setLayoutData(gd);
-
- SelectionAdapter adapter = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (((Button)e.getSource()).getSelection()) {
- updateEnabledState();
- updateLaunchConfigurationDialog();
- }
- }
- };
-
- fWorkspaceButton = createRadioButton(fGroup, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_2);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- fWorkspaceButton.setLayoutData(gd);
- fWorkspaceButton.addSelectionListener(adapter);
-
- fProjectButton = createRadioButton(fGroup, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_3);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- fProjectButton.setLayoutData(gd);
- fProjectButton.addSelectionListener(adapter);
-
- fSpecificProjectsButton = createRadioButton(fGroup, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_4);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 1;
- fSpecificProjectsButton.setLayoutData(gd);
- fSpecificProjectsButton.addSelectionListener(adapter);
-
- fSelectButton = createPushButton(fGroup, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_5, null);
- gd = (GridData)fSelectButton.getLayoutData();
- gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_END;
- fSelectButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- selectResources();
- }
- });
-
- createVerticalSpacer(mainComposite, 1);
- fReferencedProjects = createCheckButton(mainComposite, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_6);
- }
-
- /**
- * Prompts the user to select the projects to build.
- */
- private void selectResources() {
- ListSelectionDialog dialog = new ListSelectionDialog(getShell(), ResourcesPlugin.getWorkspace(), new ProjectsContentProvider(), new WorkbenchLabelProvider(), ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_7);
- dialog.setInitialElementSelections(fProjects);
- if (dialog.open() == Window.CANCEL) {
- return;
- }
- Object[] res = dialog.getResult();
- fProjects = new ArrayList(res.length);
- for (int i = 0; i < res.length; i++) {
- fProjects.add(res[i]);
- }
- updateLaunchConfigurationDialog();
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- updateScope(configuration);
- updateReferencedProjects(configuration);
- updateEnabledState();
- }
-
- private void updateReferencedProjects(ILaunchConfiguration configuration) {
- boolean ref = false;
- try {
- ref = configuration.getAttribute(IExternalToolConstants.ATTR_INCLUDE_REFERENCED_PROJECTS, true);
- } catch (CoreException e) {
- ExternalToolsPlugin.getDefault().log("Exception reading launch configuration", e); //$NON-NLS-1$
- }
- fReferencedProjects.setSelection(ref);
- }
-
- /**
- * Updates the tab to display the build scope specified by the launch config
- */
- private void updateScope(ILaunchConfiguration configuration) {
- String scope = null;
- try {
- scope= configuration.getAttribute(IExternalToolConstants.ATTR_BUILD_SCOPE, (String)null);
- } catch (CoreException ce) {
- ExternalToolsPlugin.getDefault().log("Exception reading launch configuration", ce); //$NON-NLS-1$
- }
- fBuildButton.setSelection(scope != null);
- fWorkspaceButton.setSelection(false);
- fProjectButton.setSelection(false);
- fSpecificProjectsButton.setSelection(false);
- fProjects.clear();
- if (scope == null) {
- // select the workspace by default
- fBuildButton.setSelection(true);
- fWorkspaceButton.setSelection(true);
- } else {
- if (scope.equals("${none}")) { //$NON-NLS-1$
- fBuildButton.setSelection(false);
- } else if (scope.equals("${project}")) { //$NON-NLS-1$
- fProjectButton.setSelection(true);
- } else if (scope.startsWith("${projects:")) { //$NON-NLS-1$
- fSpecificProjectsButton.setSelection(true);
- IProject[] projects = getBuildProjects(configuration, IExternalToolConstants.ATTR_BUILD_SCOPE);
- fProjects = new ArrayList(projects.length);
- for (int i = 0; i < projects.length; i++) {
- fProjects.add(projects[i]);
- }
- }
- }
- }
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- String scope = generateScopeMemento();
- configuration.setAttribute(IExternalToolConstants.ATTR_BUILD_SCOPE, scope);
- if (fReferencedProjects.getSelection()) {
- // default is true
- configuration.setAttribute(IExternalToolConstants.ATTR_INCLUDE_REFERENCED_PROJECTS, (String)null);
- } else {
- configuration.setAttribute(IExternalToolConstants.ATTR_INCLUDE_REFERENCED_PROJECTS, false);
- }
- }
-
- /**
- * Generates a memento for the build scope.
- */
- private String generateScopeMemento() {
- if (fBuildButton.getSelection()) {
- if (fWorkspaceButton.getSelection()) {
- return null;
- }
- if (fProjectButton.getSelection()) {
- return "${project}"; //$NON-NLS-1$
- }
- if (fSpecificProjectsButton.getSelection()) {
- return getBuildScopeAttribute(fProjects);
- }
- return null;
-
- }
- return "${none}"; //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_8;
- }
-
- /**
- * Updates the enablement state of the fields.
- */
- private void updateEnabledState() {
- boolean enabled= fBuildButton.getSelection();
- fGroup.setEnabled(enabled);
- fWorkspaceButton.setEnabled(enabled);
- fProjectButton.setEnabled(enabled);
- fSpecificProjectsButton.setEnabled(enabled);
- fSelectButton.setEnabled(enabled && fSpecificProjectsButton.getSelection());
- if (!enabled) {
- super.setErrorMessage(null);
- }
- if (enabled) {
- if (!fWorkspaceButton.getSelection() && !fProjectButton.getSelection() &&
- !fSpecificProjectsButton.getSelection()) {
- fWorkspaceButton.setSelection(true);
- }
- }
- fReferencedProjects.setEnabled(fBuildButton.getSelection() && (fProjectButton.getSelection() || fSpecificProjectsButton.getSelection()));
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
- */
- public Image getImage() {
- return ExternalToolsImages.getImage(org.eclipse.ui.externaltools.internal.model.IExternalToolConstants.IMG_TAB_BUILD);
- }
-
- public boolean isValid(ILaunchConfiguration launchConfig) {
- setErrorMessage(null);
- setMessage(null);
- if (fBuildButton.getSelection() && fSpecificProjectsButton.getSelection() && fProjects.isEmpty()) {
- setErrorMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_9);
- return false;
- }
- return true;
- }
-
- /**
- * Returns a collection of projects referenced by a build scope attribute.
- *
- * @return collection of projects referred to by configuration
- */
- public static IProject[] getBuildProjects(ILaunchConfiguration configuration, String buildScopeId) {
- return ExternalToolsCoreUtil.getBuildProjects(configuration,
- buildScopeId);
-
- }
-
- /**
- * Whether referenced projects should be considered when building. Only valid
- * when a set of projects is to be built.
- *
- * @param configuration
- * @return whether referenced projects should be considerd when building
- * @throws CoreException if unable to access the associated attribute
- */
- public static boolean isIncludeReferencedProjects(ILaunchConfiguration configuration, String includeReferencedProjectsId) throws CoreException {
- return ExternalToolsCoreUtil.isIncludeReferencedProjects(configuration,
- includeReferencedProjectsId);
- }
-
- /**
- * Creates and returns a memento for the given project set, to be used as a
- * build scope attribute.
- *
- * @param projects list of projects
- * @return an equivalent refresh attribute
- */
- public static String getBuildScopeAttribute(List projects) {
- StringBuffer buf = new StringBuffer();
- buf.append("${projects:"); //$NON-NLS-1$
- Iterator iterator = projects.iterator();
- while (iterator.hasNext()) {
- IProject project = (IProject) iterator.next();
- buf.append(project.getName());
- if (iterator.hasNext()) {
- buf.append(","); //$NON-NLS-1$
- }
- }
- buf.append("}"); //$NON-NLS-1$
- return buf.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
- // do nothing on activation
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
- // do nothing on deactivation
- }
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuilderTab.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuilderTab.java
deleted file mode 100644
index 5b0c0a46b..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuilderTab.java
+++ /dev/null
@@ -1,531 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * dakshinamurthy.karra@gmail.com - bug 165371
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.launchConfigurations;
-
-
-import org.eclipse.core.externaltools.internal.IExternalToolConstants;
-import org.eclipse.core.externaltools.internal.launchConfigurations.ExternalToolsCoreUtil;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.variables.VariablesPlugin;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.RefreshTab;
-import org.eclipse.debug.ui.StringVariableSelectionDialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetManager;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.dialogs.IWorkingSetEditWizard;
-import org.eclipse.ui.externaltools.internal.model.BuilderUtils;
-import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin;
-import org.eclipse.ui.externaltools.internal.model.IExternalToolsHelpContextIds;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.views.navigator.ResourceComparator;
-
-public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
-
- protected Button afterClean;
- protected Button fDuringClean;
- protected Button autoBuildButton;
- protected Button manualBuild;
- protected Button workingSetButton;
- protected Button specifyResources;
- protected Button fLaunchInBackgroundButton;
- protected IWorkingSet workingSet;
- protected ILaunchConfiguration fConfiguration;
-
- private boolean fCreateBuildScheduleComponent= true;
-
- // Console Output widgets
- private Button fConsoleOutput;
- private Button fFileOutput;
- private Button fFileBrowse;
- private Text fFileText;
- private Button fVariables;
- private Button fAppend;
- private Button fWorkspaceBrowse;
-
- public ExternalToolsBuilderTab() {
- }
-
- public ExternalToolsBuilderTab(boolean createBuildScheduleComponent) {
- fCreateBuildScheduleComponent= createBuildScheduleComponent;
- }
-
- protected SelectionListener selectionListener= new SelectionAdapter() {
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e) {
- boolean enabled= !fCreateBuildScheduleComponent || autoBuildButton.getSelection() || manualBuild.getSelection();
- workingSetButton.setEnabled(enabled);
- specifyResources.setEnabled(enabled && workingSetButton.getSelection());
- updateLaunchConfigurationDialog();
- }
- };
-
- public void createControl(Composite parent) {
- Composite mainComposite = new Composite(parent, SWT.NONE);
- setControl(mainComposite);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IExternalToolsHelpContextIds.EXTERNAL_TOOLS_LAUNCH_CONFIGURATION_DIALOG_BUILDER_TAB);
-
- GridLayout layout = new GridLayout();
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.horizontalSpan = 2;
- layout.numColumns = 2;
- layout.makeColumnsEqualWidth = false;
- mainComposite.setLayout(layout);
- mainComposite.setLayoutData(gridData);
- mainComposite.setFont(parent.getFont());
- createOutputCaptureComponent(mainComposite);
- createLaunchInBackgroundComposite(mainComposite);
- createBuildScheduleComponent(mainComposite);
- }
-
- /**
- * Creates the controls needed to edit the launch in background
- * attribute of an external tool
- *
- * @param parent the composite to create the controls in
- */
- protected void createLaunchInBackgroundComposite(Composite parent) {
- fLaunchInBackgroundButton = createCheckButton(parent, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_14);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 2;
- fLaunchInBackgroundButton.setLayoutData(data);
- fLaunchInBackgroundButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateLaunchConfigurationDialog();
- }
- });
- }
-
- protected void createBuildScheduleComponent(Composite parent) {
- if (fCreateBuildScheduleComponent) {
- Label label= new Label(parent, SWT.NONE);
- label.setText(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_Run_this_builder_for__1);
- label.setFont(parent.getFont());
- afterClean= createButton(parent, selectionListener, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab__Full_builds_2, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_Full, 2);
- manualBuild= createButton(parent, selectionListener, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab__Incremental_builds_4, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_Inc, 2);
- autoBuildButton= createButton(parent, selectionListener, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab__Auto_builds__Not_recommended__6, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_Auto, 2);
- fDuringClean= createButton(parent, selectionListener, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_0, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_1, 2);
-
- createVerticalSpacer(parent, 2);
- }
-
- workingSetButton= createButton(parent, selectionListener, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_workingSet_label, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_workingSet_tooltip, 1);
- specifyResources= createPushButton(parent, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_13, null);
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
- specifyResources.setLayoutData(gd);
- specifyResources.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- selectResources();
- }
- });
- Label label= new Label(parent, SWT.NONE);
- label.setText(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_2);
- label.setFont(parent.getFont());
- }
-
- private void createOutputCaptureComponent(Composite parent) {
- Group group = new Group(parent, SWT.NONE);
- group.setText(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_17);
- GridData gd = new GridData(SWT.FILL, SWT.NONE, true, false);
- gd.horizontalSpan = 2;
- group.setLayoutData(gd);
- GridLayout layout = new GridLayout(5, false);
- group.setLayout(layout);
- group.setFont(parent.getFont());
-
- fConsoleOutput = createCheckButton(group, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_18);
- gd = new GridData(SWT.BEGINNING, SWT.NORMAL, true, false);
- gd.horizontalSpan = 5;
- fConsoleOutput.setLayoutData(gd);
-
- fConsoleOutput.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateLaunchConfigurationDialog();
- }
- });
-
- fFileOutput = createCheckButton(group, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_19);
- fFileOutput.setLayoutData(new GridData(SWT.BEGINNING, SWT.NORMAL, false, false));
-
- fFileText = new Text(group, SWT.SINGLE | SWT.BORDER);
- gd = new GridData(SWT.FILL, SWT.NORMAL, true, false);
- gd.horizontalSpan = 4;
- fFileText.setLayoutData(gd);
- fFileText.setFont(parent.getFont());
-
- Label spacer = new Label(group,SWT.NONE);
- gd = new GridData(SWT.FILL, SWT.NORMAL, true, false);
- gd.horizontalSpan=2;
- spacer.setLayoutData(gd);
- fWorkspaceBrowse = createPushButton(group, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_20, null);
- fFileBrowse = createPushButton(group, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_21, null);
- fVariables = createPushButton(group, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_22, null);
-
- spacer = new Label(group,SWT.NONE);
- spacer.setLayoutData(new GridData(SWT.FILL, SWT.NORMAL, false, false));
- fAppend = createCheckButton(group, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_23);
- gd = new GridData(SWT.LEFT, SWT.TOP, true, false);
- gd.horizontalSpan = 4;
- fAppend.setLayoutData(gd);
-
- fFileOutput.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- boolean enabled = fFileOutput.getSelection();
- fFileText.setEnabled(enabled);
- fFileBrowse.setEnabled(enabled);
- fWorkspaceBrowse.setEnabled(enabled);
- fVariables.setEnabled(enabled);
- fAppend.setEnabled(enabled);
- updateLaunchConfigurationDialog();
- }
- });
-
- fAppend.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateLaunchConfigurationDialog();
- }
- });
-
- fWorkspaceBrowse.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider());
- dialog.setTitle(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_24);
- dialog.setMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_25);
- dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
- dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
- int buttonId = dialog.open();
- if (buttonId == IDialogConstants.OK_ID) {
- IResource resource = (IResource) dialog.getFirstResult();
- String arg = resource.getFullPath().toString();
- String fileLoc = VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression("workspace_loc", arg); //$NON-NLS-1$
- fFileText.setText(fileLoc);
- }
- }
- });
-
- fFileBrowse.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- String filePath = fFileText.getText();
- FileDialog dialog = new FileDialog(getShell(), SWT.SAVE);
-
- filePath = dialog.open();
- if (filePath != null) {
- fFileText.setText(filePath);
- }
- }
- });
-
- fFileText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
- }
- });
-
- fVariables.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
- dialog.open();
- String variable = dialog.getVariableExpression();
- if (variable != null) {
- fFileText.insert(variable);
- }
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- });
- }
-
- /*
- * Creates a check button in the given composite with the given text
- */
- protected Button createButton(Composite parent, SelectionListener listener, String text, String tooltipText, int columns) {
- Button button= createCheckButton(parent, text);
- button.setToolTipText(tooltipText);
- button.addSelectionListener(listener);
- GridData gd= new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = columns;
- button.setLayoutData(gd);
- return button;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
- StringBuffer buffer= new StringBuffer(IExternalToolConstants.BUILD_TYPE_FULL);
- buffer.append(',');
- buffer.append(IExternalToolConstants.BUILD_TYPE_INCREMENTAL);
- buffer.append(',');
- configuration.setAttribute(IExternalToolConstants.ATTR_RUN_BUILD_KINDS, buffer.toString());
- configuration.setAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND, false);
- configuration.setAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- fConfiguration= configuration;
- if (fCreateBuildScheduleComponent) {
- afterClean.setSelection(false);
- manualBuild.setSelection(false);
- autoBuildButton.setSelection(false);
- fDuringClean.setSelection(false);
- }
-
- String buildKindString= null;
- String buildScope= null;
- try {
- buildKindString= configuration.getAttribute(IExternalToolConstants.ATTR_RUN_BUILD_KINDS, ""); //$NON-NLS-1$
- buildScope= configuration.getAttribute(IExternalToolConstants.ATTR_BUILDER_SCOPE, (String)null);
- } catch (CoreException e) {
- }
-
- workingSetButton.setSelection(buildScope != null);
- workingSetButton.setEnabled(buildScope != null);
-
- if (buildScope != null) {
- workingSet = RefreshTab.getWorkingSet(buildScope);
- }
-
- if (fCreateBuildScheduleComponent) {
- int buildTypes[]= BuilderUtils.buildTypesToArray(buildKindString);
- for (int i = 0; i < buildTypes.length; i++) {
- switch (buildTypes[i]) {
- case IncrementalProjectBuilder.FULL_BUILD:
- afterClean.setSelection(true);
- break;
- case IncrementalProjectBuilder.INCREMENTAL_BUILD:
- manualBuild.setSelection(true);
- break;
- case IncrementalProjectBuilder.AUTO_BUILD:
- autoBuildButton.setSelection(true);
- break;
- case IncrementalProjectBuilder.CLEAN_BUILD:
- fDuringClean.setSelection(true);
- break;
- }
- }
- }
-
- boolean enabled= true;
- if (fCreateBuildScheduleComponent) {
- enabled= autoBuildButton.getSelection() || manualBuild.getSelection();
- }
- workingSetButton.setEnabled(enabled);
- specifyResources.setEnabled(enabled && workingSetButton.getSelection());
- updateRunInBackground(configuration);
- updateConsoleOutput(configuration);
- }
-
- protected void updateRunInBackground(ILaunchConfiguration configuration) {
- fLaunchInBackgroundButton.setSelection(ExternalToolsCoreUtil.isAsynchronousBuild(configuration));
- }
-
- private void updateConsoleOutput(ILaunchConfiguration configuration) {
- boolean outputToConsole = true;
- String outputFile = null;
- boolean append = false;
-
- try {
- outputToConsole = configuration.getAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_CONSOLE, true);
- outputFile = configuration.getAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_FILE, (String)null);
- append = configuration.getAttribute(IDebugUIConstants.ATTR_APPEND_TO_FILE, false);
- } catch (CoreException e) {
- }
-
- fConsoleOutput.setSelection(outputToConsole);
- fAppend.setSelection(append);
- boolean haveOutputFile= outputFile != null;
- if (haveOutputFile) {
- fFileText.setText(outputFile);
- }
- fFileOutput.setSelection(haveOutputFile);
- fFileText.setEnabled(haveOutputFile);
- fFileBrowse.setEnabled(haveOutputFile);
- fWorkspaceBrowse.setEnabled(haveOutputFile);
- fVariables.setEnabled(haveOutputFile);
- fAppend.setEnabled(haveOutputFile);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- if (fCreateBuildScheduleComponent) {
- StringBuffer buffer= new StringBuffer();
- if (afterClean.getSelection()) {
- buffer.append(IExternalToolConstants.BUILD_TYPE_FULL).append(',');
- }
- if (manualBuild.getSelection()){
- buffer.append(IExternalToolConstants.BUILD_TYPE_INCREMENTAL).append(',');
- }
- if (autoBuildButton.getSelection()) {
- buffer.append(IExternalToolConstants.BUILD_TYPE_AUTO).append(',');
- }
-
- if (fDuringClean.getSelection()) {
- buffer.append(IExternalToolConstants.BUILD_TYPE_CLEAN);
- }
- configuration.setAttribute(IExternalToolConstants.ATTR_RUN_BUILD_KINDS, buffer.toString());
- }
- if (workingSetButton.getSelection()) {
- String scope = RefreshTab.getRefreshAttribute(workingSet);
- configuration.setAttribute(IExternalToolConstants.ATTR_BUILDER_SCOPE, scope);
- } else {
- configuration.setAttribute(IExternalToolConstants.ATTR_BUILDER_SCOPE, (String)null);
- }
- configuration.setAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND, fLaunchInBackgroundButton.getSelection());
-
- boolean captureOutput = false;
- if (fConsoleOutput.getSelection()) {
- captureOutput = true;
- configuration.setAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_CONSOLE, (String)null);
- } else {
- configuration.setAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_CONSOLE, false);
- }
- if (fFileOutput.getSelection()) {
- captureOutput = true;
- String file = fFileText.getText();
- configuration.setAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_FILE, file);
- if(fAppend.getSelection()) {
- configuration.setAttribute(IDebugUIConstants.ATTR_APPEND_TO_FILE, true);
- } else {
- configuration.setAttribute(IDebugUIConstants.ATTR_APPEND_TO_FILE, (String)null);
- }
- } else {
- configuration.setAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_FILE, (String)null);
- }
-
- if (!captureOutput) {
- configuration.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, false);
- } else {
- configuration.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, (String)null);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_Build_Options_9;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
- */
- public Image getImage() {
- return PlatformUI.getWorkbench().getSharedImages().getImage(IDE.SharedImages.IMG_OBJ_PROJECT);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public boolean isValid(ILaunchConfiguration launchConfig) {
- setErrorMessage(null);
- setMessage(null);
- if (fCreateBuildScheduleComponent) {
- boolean buildKindSelected= afterClean.getSelection() || manualBuild.getSelection() || autoBuildButton.getSelection() || fDuringClean.getSelection();
- if (!buildKindSelected) {
- setErrorMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_buildKindError);
- return false;
- }
- }
- if (workingSetButton.getSelection() && (workingSet == null || workingSet.getElements().length == 0)) {
- setErrorMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_16);
- return false;
- }
-
- return validateRedirectFile();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#canSave()
- */
- public boolean canSave() {
- return isValid(null);
- }
-
- /**
- * Prompts the user to select the working set that triggers the build.
- */
- private void selectResources() {
- IWorkingSetManager workingSetManager= PlatformUI.getWorkbench().getWorkingSetManager();
-
- if (workingSet == null){
- workingSet = workingSetManager.createWorkingSet(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_15, new IAdaptable[0]);
- }
- IWorkingSetEditWizard wizard= workingSetManager.createWorkingSetEditWizard(workingSet);
- WizardDialog dialog = new WizardDialog(ExternalToolsPlugin.getStandardDisplay().getActiveShell(), wizard);
- dialog.create();
-
- if (dialog.open() == Window.CANCEL) {
- return;
- }
- workingSet = wizard.getSelection();
- updateLaunchConfigurationDialog();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
- // do nothing on activation
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
- // do nothing on deactivation
- }
-
- private boolean validateRedirectFile() {
- if(fFileOutput.getSelection()) {
- int len = fFileText.getText().trim().length();
- if (len == 0) {
- setErrorMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_26);
- return false;
- }
- }
- return true;
- }
-} \ No newline at end of file
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsLaunchConfigurationMessages.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsLaunchConfigurationMessages.java
deleted file mode 100644
index aab850c3b..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsLaunchConfigurationMessages.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- * dakshinamurthy.karra@gmail.com - bug 165371
- **********************************************************************/
-package org.eclipse.ui.externaltools.internal.launchConfigurations;
-
-import org.eclipse.osgi.util.NLS;
-
-public class ExternalToolsLaunchConfigurationMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsLaunchConfigurationMessages";//$NON-NLS-1$
-
- public static String ExternalToolsMainTab__Location___2;
- public static String ExternalToolsMainTab__Browse_Workspace____3;
- public static String ExternalToolsMainTab_Brows_e_File_System____4;
- public static String ExternalToolsMainTab_Working__Directory__5;
- public static String ExternalToolsMainTab_Browse_Wor_kspace____6;
- public static String ExternalToolsMainTab_Browse_F_ile_System____7;
- public static String ExternalToolsMainTab_Error_reading_configuration_10;
- public static String ExternalToolsMainTab__Main_17;
- public static String ExternalToolsMainTab_External_tool_location_cannot_be_empty_18;
- public static String ExternalToolsMainTab_External_tool_location_does_not_exist_19;
- public static String ExternalToolsMainTab_External_tool_location_specified_is_not_a_file_20;
- public static String ExternalToolsMainTab_External_tool_working_directory_does_not_exist_or_is_invalid_21;
- public static String ExternalToolsMainTab_Select_a_resource_22;
- public static String ExternalToolsMainTab_23;
- public static String ExternalToolsMainTab__Arguments___1;
- public static String ExternalToolsMainTab_Varia_bles____2;
- public static String ExternalToolsMainTab_3;
- public static String ExternalToolsMainTab_Error_reading_configuration_7;
- public static String ExternalToolsMainTab_Not_a_directory;
- public static String ExternalToolsMainTab_30;
- public static String ExternalToolsMainTab_31;
- public static String ExternalToolsMainTab_32;
-
- public static String ExternalToolsBuildTab_1;
- public static String ExternalToolsBuildTab_2;
- public static String ExternalToolsBuildTab_3;
- public static String ExternalToolsBuildTab_4;
- public static String ExternalToolsBuildTab_5;
- public static String ExternalToolsBuildTab_6;
- public static String ExternalToolsBuildTab_7;
- public static String ExternalToolsBuildTab_8;
- public static String ExternalToolsBuildTab_9;
-
- public static String ExternalToolsBuilderTab_Run_this_builder_for__1;
- public static String ExternalToolsBuilderTab__Full_builds_2;
- public static String ExternalToolsBuilderTab_Full;
- public static String ExternalToolsBuilderTab__Incremental_builds_4;
- public static String ExternalToolsBuilderTab_Inc;
- public static String ExternalToolsBuilderTab__Auto_builds__Not_recommended__6;
- public static String ExternalToolsBuilderTab_Auto;
- public static String ExternalToolsBuilderTab_Build_Options_9;
- public static String ExternalToolsBuilderTab_workingSet_label;
- public static String ExternalToolsBuilderTab_workingSet_tooltip;
- public static String ExternalToolsBuilderTab_buildKindError;
- public static String ExternalToolsBuilderTab_14;
- public static String ExternalToolsBuilderTab_13;
- public static String ExternalToolsBuilderTab_16;
- public static String ExternalToolsBuilderTab_15;
- public static String ExternalToolsBuilderTab_0;
- public static String ExternalToolsBuilderTab_1;
- public static String ExternalToolsBuilderTab_2;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, ExternalToolsLaunchConfigurationMessages.class);
- }
-
- public static String ExternalToolsBuilderTab_17;
-
- public static String ExternalToolsBuilderTab_18;
-
- public static String ExternalToolsBuilderTab_19;
-
- public static String ExternalToolsBuilderTab_20;
-
- public static String ExternalToolsBuilderTab_21;
-
- public static String ExternalToolsBuilderTab_22;
-
- public static String ExternalToolsBuilderTab_23;
-
- public static String ExternalToolsBuilderTab_24;
-
- public static String ExternalToolsBuilderTab_25;
-
- public static String ExternalToolsBuilderTab_26;
-} \ No newline at end of file
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsLaunchConfigurationMessages.properties b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsLaunchConfigurationMessages.properties
deleted file mode 100644
index 9de69a4f7..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsLaunchConfigurationMessages.properties
+++ /dev/null
@@ -1,73 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2009 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-# dakshinamurthy.karra@gmail.com - bug 165371
-###############################################################################
-
-ExternalToolsMainTab__Location___2=&Location:
-ExternalToolsMainTab__Browse_Workspace____3=Browse Works&pace...
-ExternalToolsMainTab_Brows_e_File_System____4=Brows&e File System...
-ExternalToolsMainTab_Working__Directory__5=Working &Directory:
-ExternalToolsMainTab_Browse_Wor_kspace____6=Browse Wor&kspace...
-ExternalToolsMainTab_Browse_F_ile_System____7=Browse File Syste&m...
-ExternalToolsMainTab_Error_reading_configuration_10=Error reading configuration
-ExternalToolsMainTab__Main_17=Main
-ExternalToolsMainTab_External_tool_location_cannot_be_empty_18=External tool location cannot be empty
-ExternalToolsMainTab_External_tool_location_does_not_exist_19=External tool location does not exist
-ExternalToolsMainTab_External_tool_location_specified_is_not_a_file_20=External tool location specified is not a file
-ExternalToolsMainTab_External_tool_working_directory_does_not_exist_or_is_invalid_21=External tool working directory does not exist or is invalid
-ExternalToolsMainTab_Select_a_resource_22=Select a resource:
-ExternalToolsMainTab_23=Select a working directory:
-ExternalToolsMainTab__Arguments___1=&Arguments:
-ExternalToolsMainTab_Varia_bles____2=Variable&s...
-ExternalToolsMainTab_3=Note: Enclose an argument containing spaces using double-quotes (\").
-ExternalToolsMainTab_Error_reading_configuration_7=Error reading configuration
-ExternalToolsMainTab_Not_a_directory=The specified location is not a directory
-ExternalToolsMainTab_30=Please specify the location of the external tool you would like to configure.
-ExternalToolsMainTab_31=Var&iables...
-ExternalToolsMainTab_32=Varia&bles...
-
-ExternalToolsBuildTab_1=&Build before launch
-ExternalToolsBuildTab_2=The &entire workspace
-ExternalToolsBuildTab_3=The &project containing the selected resource
-ExternalToolsBuildTab_4=&Specific projects
-ExternalToolsBuildTab_5=P&rojects...
-ExternalToolsBuildTab_6=Include referenced pro&jects
-ExternalToolsBuildTab_7=Select &Projects:
-ExternalToolsBuildTab_8=Build
-ExternalToolsBuildTab_9=No projects specified
-
-ExternalToolsBuilderTab_Run_this_builder_for__1=Run the builder:
-ExternalToolsBuilderTab__Full_builds_2=A&fter a \"Clean\"
-ExternalToolsBuilderTab_Full=Runs on the first build that occurs after a clean.
-ExternalToolsBuilderTab__Incremental_builds_4=&During manual builds
-ExternalToolsBuilderTab_Inc=Runs whenever the user invokes a build (but not for auto-build).
-ExternalToolsBuilderTab__Auto_builds__Not_recommended__6=During a&uto builds
-ExternalToolsBuilderTab_Auto=Runs whenever a resource in the workspace is modified if autobuilding is enabled. Enabling this option should be paired with a specifying a resource working set.
-ExternalToolsBuilderTab_Build_Options_9=&Build Options
-ExternalToolsBuilderTab_workingSet_label=Specify working set of &relevant resources
-ExternalToolsBuilderTab_workingSet_tooltip=The working set of resources that if changed from a manual or auto build will trigger the external tool builder
-ExternalToolsBuilderTab_buildKindError=At least one type of build kind must be selected
-ExternalToolsBuilderTab_14=Launch in bac&kground
-ExternalToolsBuilderTab_13=&Specify Resources...
-ExternalToolsBuilderTab_16=Must select resources in working set.
-ExternalToolsBuilderTab_15=workingSet
-ExternalToolsBuilderTab_17=Standard Input and Output
-ExternalToolsBuilderTab_18=Allocate &Console (necessary for input)
-ExternalToolsBuilderTab_19=Fi&le
-ExternalToolsBuilderTab_0=During a "&Clean"
-ExternalToolsBuilderTab_1=Runs when a "clean" has been initiated
-ExternalToolsBuilderTab_2=Note: Not applied for the builds during or after a \"Clean\"
-ExternalToolsBuilderTab_20=Browse Worksp&ace...
-ExternalToolsBuilderTab_21=Browse File Syste&m...
-ExternalToolsBuilderTab_22=Varia&bles...
-ExternalToolsBuilderTab_23=A&ppend
-ExternalToolsBuilderTab_24=Select a Resource
-ExternalToolsBuilderTab_25=Select a resource to redirect output to:
-ExternalToolsBuilderTab_26=No file specified for process output
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsMainTab.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsMainTab.java
deleted file mode 100644
index d1bf2d994..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsMainTab.java
+++ /dev/null
@@ -1,646 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.launchConfigurations;
-
-
-import java.io.File;
-
-import org.eclipse.core.externaltools.internal.IExternalToolConstants;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.variables.IStringVariableManager;
-import org.eclipse.core.variables.VariablesPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-import org.eclipse.debug.ui.StringVariableSelectionDialog;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.ContainerSelectionDialog;
-import org.eclipse.ui.dialogs.ResourceSelectionDialog;
-import org.eclipse.ui.externaltools.internal.model.ExternalToolsImages;
-import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin;
-
-/**
- * The external tools main tab allows the user to configure primary attributes
- * of external tool launch configurations such as the location, working directory,
- * and arguments.
- */
-public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTab {
- public final static String FIRST_EDIT = "editedByExternalToolsMainTab"; //$NON-NLS-1$
-
- protected Text locationField;
- protected Text workDirectoryField;
- protected Button fileLocationButton;
- protected Button workspaceLocationButton;
- protected Button variablesLocationButton;
- protected Button fileWorkingDirectoryButton;
- protected Button workspaceWorkingDirectoryButton;
- protected Button variablesWorkingDirectoryButton;
-
- protected Text argumentField;
- protected Button argumentVariablesButton;
-
- protected SelectionAdapter selectionAdapter;
-
- protected boolean fInitializing= false;
- private boolean userEdited= false;
-
- protected WidgetListener fListener= new WidgetListener();
-
- /**
- * A listener to update for text modification and widget selection.
- */
- protected class WidgetListener extends SelectionAdapter implements ModifyListener {
- public void modifyText(ModifyEvent e) {
- if (!fInitializing) {
- setDirty(true);
- userEdited= true;
- updateLaunchConfigurationDialog();
- }
- }
- public void widgetSelected(SelectionEvent e) {
- setDirty(true);
- Object source= e.getSource();
- if (source == workspaceLocationButton) {
- handleWorkspaceLocationButtonSelected();
- } else if (source == fileLocationButton) {
- handleFileLocationButtonSelected();
- } else if (source == workspaceWorkingDirectoryButton) {
- handleWorkspaceWorkingDirectoryButtonSelected();
- } else if (source == fileWorkingDirectoryButton) {
- handleFileWorkingDirectoryButtonSelected();
- } else if (source == argumentVariablesButton) {
- handleVariablesButtonSelected(argumentField);
- } else if (source == variablesLocationButton) {
- handleVariablesButtonSelected(locationField);
- } else if (source == variablesWorkingDirectoryButton) {
- handleVariablesButtonSelected(workDirectoryField);
- }
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- Composite mainComposite = new Composite(parent, SWT.NONE);
- setControl(mainComposite);
- mainComposite.setFont(parent.getFont());
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- mainComposite.setLayout(layout);
- mainComposite.setLayoutData(gridData);
-
- createLocationComponent(mainComposite);
- createWorkDirectoryComponent(mainComposite);
- createArgumentComponent(mainComposite);
- createVerticalSpacer(mainComposite, 1);
-
- Dialog.applyDialogFont(parent);
- }
-
- /**
- * Creates the controls needed to edit the location
- * attribute of an external tool
- *
- * @param parent the composite to create the controls in
- */
- protected void createLocationComponent(Composite parent) {
- Group group = new Group(parent, SWT.NONE);
- String locationLabel = getLocationLabel();
- group.setText(locationLabel);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- group.setLayout(layout);
- group.setLayoutData(gridData);
-
- locationField = new Text(group, SWT.BORDER);
- gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
- locationField.setLayoutData(gridData);
- locationField.addModifyListener(fListener);
- addControlAccessibleListener(locationField, group.getText());
-
- Composite buttonComposite = new Composite(group, SWT.NONE);
- layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.numColumns = 3;
- gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
- buttonComposite.setLayout(layout);
- buttonComposite.setLayoutData(gridData);
- buttonComposite.setFont(parent.getFont());
-
- workspaceLocationButton= createPushButton(buttonComposite, ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab__Browse_Workspace____3, null);
- workspaceLocationButton.addSelectionListener(fListener);
- addControlAccessibleListener(workspaceLocationButton, group.getText() + " " + workspaceLocationButton.getText()); //$NON-NLS-1$
-
- fileLocationButton= createPushButton(buttonComposite, ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Brows_e_File_System____4, null);
- fileLocationButton.addSelectionListener(fListener);
- addControlAccessibleListener(fileLocationButton, group.getText() + " " + fileLocationButton.getText()); //$NON-NLS-1$
-
- variablesLocationButton = createPushButton(buttonComposite, ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_31, null);
- variablesLocationButton.addSelectionListener(fListener);
- addControlAccessibleListener(variablesLocationButton, group.getText() + " " + variablesLocationButton.getText()); //$NON-NLS-1$
- }
-
- /**
- * Returns the label used for the location widgets. Subclasses may wish to override.
- */
- protected String getLocationLabel() {
- return ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab__Location___2;
- }
-
- /**
- * Creates the controls needed to edit the working directory
- * attribute of an external tool
- *
- * @param parent the composite to create the controls in
- */
- protected void createWorkDirectoryComponent(Composite parent) {
- Group group = new Group(parent, SWT.NONE);
- String groupName = getWorkingDirectoryLabel();
- group.setText(groupName);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- group.setLayout(layout);
- group.setLayoutData(gridData);
-
- workDirectoryField = new Text(group, SWT.BORDER);
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
- workDirectoryField.setLayoutData(data);
- workDirectoryField.addModifyListener(fListener);
- addControlAccessibleListener(workDirectoryField,group.getText());
-
- Composite buttonComposite = new Composite(group, SWT.NONE);
- layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 3;
- gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
- buttonComposite.setLayout(layout);
- buttonComposite.setLayoutData(gridData);
- buttonComposite.setFont(parent.getFont());
-
- workspaceWorkingDirectoryButton= createPushButton(buttonComposite, ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Browse_Wor_kspace____6, null);
- workspaceWorkingDirectoryButton.addSelectionListener(fListener);
- addControlAccessibleListener(workspaceWorkingDirectoryButton, group.getText() + " " + workspaceWorkingDirectoryButton.getText()); //$NON-NLS-1$
-
- fileWorkingDirectoryButton= createPushButton(buttonComposite, ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Browse_F_ile_System____7, null);
- fileWorkingDirectoryButton.addSelectionListener(fListener);
- addControlAccessibleListener(fileWorkingDirectoryButton, group.getText() + " " + fileLocationButton.getText()); //$NON-NLS-1$
-
- variablesWorkingDirectoryButton = createPushButton(buttonComposite, ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_32, null);
- variablesWorkingDirectoryButton.addSelectionListener(fListener);
- addControlAccessibleListener(variablesWorkingDirectoryButton, group.getText() + " " + variablesWorkingDirectoryButton.getText()); //$NON-NLS-1$
- }
-
- /**
- * Return the String to use as the label for the working directory field.
- * Subclasses may wish to override.
- */
- protected String getWorkingDirectoryLabel() {
- return ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Working__Directory__5;
- }
-
- /**
- * Creates the controls needed to edit the argument and
- * prompt for argument attributes of an external tool
- *
- * @param parent the composite to create the controls in
- */
- protected void createArgumentComponent(Composite parent) {
- Group group = new Group(parent, SWT.NONE);
- String groupName = ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab__Arguments___1;
- group.setText(groupName);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- GridData gridData = new GridData(GridData.FILL_BOTH);
- group.setLayout(layout);
- group.setLayoutData(gridData);
- group.setFont(parent.getFont());
-
- argumentField = new Text(group, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
- gridData = new GridData(GridData.FILL_BOTH);
- gridData.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
- gridData.heightHint = 30;
- argumentField.setLayoutData(gridData);
- argumentField.addModifyListener(fListener);
- addControlAccessibleListener(argumentField, group.getText());
-
- Composite composite = new Composite(group, SWT.NONE);
- layout = new GridLayout();
- layout.numColumns= 1;
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
- composite.setLayout(layout);
- composite.setLayoutData(gridData);
- composite.setFont(parent.getFont());
-
- argumentVariablesButton= createPushButton(composite, ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Varia_bles____2, null);
- argumentVariablesButton.addSelectionListener(fListener);
- addControlAccessibleListener(argumentVariablesButton, argumentVariablesButton.getText()); // need to strip the mnemonic from buttons
-
- Label instruction = new Label(group, SWT.NONE);
- instruction.setText(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_3);
- gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gridData.horizontalSpan = 2;
- instruction.setLayoutData(gridData);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
- configuration.setAttribute(FIRST_EDIT, true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- fInitializing= true;
- updateLocation(configuration);
- updateWorkingDirectory(configuration);
- updateArgument(configuration);
- fInitializing= false;
- setDirty(false);
- }
-
- /**
- * Updates the working directory widgets to match the state of the given launch
- * configuration.
- */
- protected void updateWorkingDirectory(ILaunchConfiguration configuration) {
- String workingDir= ""; //$NON-NLS-1$
- try {
- workingDir= configuration.getAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, ""); //$NON-NLS-1$
- } catch (CoreException ce) {
- ExternalToolsPlugin.getDefault().log(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Error_reading_configuration_10, ce);
- }
- workDirectoryField.setText(workingDir);
- }
-
- /**
- * Updates the location widgets to match the state of the given launch
- * configuration.
- */
- protected void updateLocation(ILaunchConfiguration configuration) {
- String location= ""; //$NON-NLS-1$
- try {
- location= configuration.getAttribute(IExternalToolConstants.ATTR_LOCATION, ""); //$NON-NLS-1$
- } catch (CoreException ce) {
- ExternalToolsPlugin.getDefault().log(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Error_reading_configuration_10, ce);
- }
- locationField.setText(location);
- }
-
- /**
- * Updates the argument widgets to match the state of the given launch
- * configuration.
- */
- protected void updateArgument(ILaunchConfiguration configuration) {
- String arguments= ""; //$NON-NLS-1$
- try {
- arguments= configuration.getAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, ""); //$NON-NLS-1$
- } catch (CoreException ce) {
- ExternalToolsPlugin.getDefault().log(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Error_reading_configuration_7, ce);
- }
- argumentField.setText(arguments);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- String location= locationField.getText().trim();
- if (location.length() == 0) {
- configuration.setAttribute(IExternalToolConstants.ATTR_LOCATION, (String)null);
- } else {
- configuration.setAttribute(IExternalToolConstants.ATTR_LOCATION, location);
- }
-
- String workingDirectory= workDirectoryField.getText().trim();
- if (workingDirectory.length() == 0) {
- configuration.setAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, (String)null);
- } else {
- configuration.setAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, workingDirectory);
- }
-
- String arguments= argumentField.getText().trim();
- if (arguments.length() == 0) {
- configuration.setAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, (String)null);
- } else {
- configuration.setAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, arguments);
- }
-
- if(userEdited) {
- configuration.setAttribute(FIRST_EDIT, (String)null);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab__Main_17;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public boolean isValid(ILaunchConfiguration launchConfig) {
- setErrorMessage(null);
- setMessage(null);
- boolean newConfig = false;
- try {
- newConfig = launchConfig.getAttribute(FIRST_EDIT, false);
- } catch (CoreException e) {
- //assume false is correct
- }
- return validateLocation(newConfig) && validateWorkDirectory();
- }
-
- /**
- * Validates the content of the location field.
- */
- protected boolean validateLocation(boolean newConfig) {
- String location = locationField.getText().trim();
- if (location.length() < 1) {
- if (newConfig) {
- setErrorMessage(null);
- setMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_30);
- } else {
- setErrorMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_External_tool_location_cannot_be_empty_18);
- setMessage(null);
- }
- return false;
- }
-
- String expandedLocation= null;
- try {
- expandedLocation= resolveValue(location);
- if (expandedLocation == null) { //a variable that needs to be resolved at runtime
- return true;
- }
- } catch (CoreException e) {
- setErrorMessage(e.getStatus().getMessage());
- return false;
- }
-
- File file = new File(expandedLocation);
- if (!file.exists()) { // The file does not exist.
- if (!newConfig) {
- setErrorMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_External_tool_location_does_not_exist_19);
- }
- return false;
- }
- if (!file.isFile()) {
- if (!newConfig) {
- setErrorMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_External_tool_location_specified_is_not_a_file_20);
- }
- return false;
- }
- return true;
- }
-
- /**
- * Validates the variables of the given string to determine if all variables are valid
- *
- * @param expression expression with variables
- * @exception CoreException if a variable is specified that does not exist
- */
- private void validateVaribles(String expression) throws CoreException {
- IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
- manager.validateStringVariables(expression);
- }
-
- private String resolveValue(String expression) throws CoreException {
- String expanded= null;
- try {
- expanded= getValue(expression);
- } catch (CoreException e) { //possibly just a variable that needs to be resolved at runtime
- validateVaribles(expression);
- return null;
- }
- return expanded;
- }
-
- /**
- * Validates the value of the given string to determine if any/all variables are valid
- *
- * @param expression expression with variables
- * @return whether the expression contained any variable values
- * @exception CoreException if variable resolution fails
- */
- private String getValue(String expression) throws CoreException {
- IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
- return manager.performStringSubstitution(expression);
- }
-
- /**
- * Validates the content of the working directory field.
- */
- protected boolean validateWorkDirectory() {
- String dir = workDirectoryField.getText().trim();
- if (dir.length() <= 0) {
- return true;
- }
-
- String expandedDir= null;
- try {
- expandedDir= resolveValue(dir);
- if (expandedDir == null) { //a variable that needs to be resolved at runtime
- return true;
- }
- } catch (CoreException e) {
- setErrorMessage(e.getStatus().getMessage());
- return false;
- }
-
- File file = new File(expandedDir);
- if (!file.exists()) { // The directory does not exist.
- setErrorMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_External_tool_working_directory_does_not_exist_or_is_invalid_21);
- return false;
- }
- if (!file.isDirectory()) {
- setErrorMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Not_a_directory);
- return false;
- }
- return true;
- }
-
- /**
- * Prompts the user to choose a location from the filesystem and
- * sets the location as the full path of the selected file.
- */
- protected void handleFileLocationButtonSelected() {
- FileDialog fileDialog = new FileDialog(getShell(), SWT.NONE);
- fileDialog.setFileName(locationField.getText());
- String text= fileDialog.open();
- if (text != null) {
- locationField.setText(text);
- }
- }
-
- /**
- * Prompts the user for a workspace location within the workspace and sets
- * the location as a String containing the workspace_loc variable or
- * <code>null</code> if no location was obtained from the user.
- */
- protected void handleWorkspaceLocationButtonSelected() {
- ResourceSelectionDialog dialog;
- dialog = new ResourceSelectionDialog(getShell(), ResourcesPlugin.getWorkspace().getRoot(), ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Select_a_resource_22);
- dialog.open();
- Object[] results = dialog.getResult();
- if (results == null || results.length < 1) {
- return;
- }
- IResource resource = (IResource)results[0];
- locationField.setText(newVariableExpression("workspace_loc", resource.getFullPath().toString())); //$NON-NLS-1$
- }
-
- /**
- * Prompts the user for a working directory location within the workspace
- * and sets the working directory as a String containing the workspace_loc
- * variable or <code>null</code> if no location was obtained from the user.
- */
- protected void handleWorkspaceWorkingDirectoryButtonSelected() {
- ContainerSelectionDialog containerDialog;
- containerDialog = new ContainerSelectionDialog(
- getShell(),
- ResourcesPlugin.getWorkspace().getRoot(),
- false,
- ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_23);
- containerDialog.open();
- Object[] resource = containerDialog.getResult();
- String text= null;
- if (resource != null && resource.length > 0) {
- text= newVariableExpression("workspace_loc", ((IPath)resource[0]).toString()); //$NON-NLS-1$
- }
- if (text != null) {
- workDirectoryField.setText(text);
- }
- }
-
- /**
- * Returns a new variable expression with the given variable and the given argument.
- * @see IStringVariableManager#generateVariableExpression(String, String)
- */
- protected String newVariableExpression(String varName, String arg) {
- return VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression(varName, arg);
- }
-
- /**
- * Prompts the user to choose a working directory from the filesystem.
- */
- protected void handleFileWorkingDirectoryButtonSelected() {
- DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.SAVE);
- dialog.setMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_23);
- dialog.setFilterPath(workDirectoryField.getText());
- String text= dialog.open();
- if (text != null) {
- workDirectoryField.setText(text);
- }
- }
-
- /**
- * A variable entry button has been pressed for the given text
- * field. Prompt the user for a variable and enter the result
- * in the given field.
- */
- private void handleVariablesButtonSelected(Text textField) {
- String variable = getVariable();
- if (variable != null) {
- textField.insert(variable);
- }
- }
-
- /**
- * Prompts the user to choose and configure a variable and returns
- * the resulting string, suitable to be used as an attribute.
- */
- private String getVariable() {
- StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
- dialog.open();
- return dialog.getVariableExpression();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
- */
- public Image getImage() {
- return ExternalToolsImages.getImage(org.eclipse.ui.externaltools.internal.model.IExternalToolConstants.IMG_TAB_MAIN);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
- }
-
- /*
- * Fix for Bug 60163 Accessibility: New Builder Dialog missing object info for textInput controls
- */
- public void addControlAccessibleListener(Control control, String controlName) {
- //strip mnemonic (&)
- String[] strs = controlName.split("&"); //$NON-NLS-1$
- StringBuffer stripped = new StringBuffer();
- for (int i = 0; i < strs.length; i++) {
- stripped.append(strs[i]);
- }
- control.getAccessible().addAccessibleListener(new ControlAccessibleListener(stripped.toString()));
- }
-
- private class ControlAccessibleListener extends AccessibleAdapter {
- private String controlName;
- ControlAccessibleListener(String name) {
- controlName = name;
- }
- public void getName(AccessibleEvent e) {
- e.result = controlName;
- }
-
- }
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsUtil.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsUtil.java
deleted file mode 100644
index 8f7a871b2..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsUtil.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Keith Seitz (keiths@redhat.com) - Bug 27243 (environment variables contribution)
- * dakshinamurthy.karra@gmail.com - bug 165371
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.launchConfigurations;
-
-
-import org.eclipse.core.externaltools.internal.launchConfigurations.ExternalToolsCoreUtil;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin;
-
-/**
- * Utilities for external tool launch configurations.
- * <p>
- * This class it not intended to be instantiated.
- * </p>
- */
-public class ExternalToolsUtil {
-
- /**
- * Throws a core exception with an error status object built from
- * the given message, lower level exception, and error code.
- *
- * @param message the status message
- * @param exception lower level exception associated with the
- * error, or <code>null</code> if none
- * @param code error code
- */
- protected static void abort(String message, Throwable exception, int code) throws CoreException {
- throw new CoreException(new Status(IStatus.ERROR, ExternalToolsPlugin.PLUGIN_ID, code, message, exception));
- }
-
- /**
- * Expands and returns the location attribute of the given launch
- * configuration. The location is
- * verified to point to an existing file, in the local file system.
- *
- * @param configuration launch configuration
- * @return an absolute path to a file in the local file system
- * @throws CoreException if unable to retrieve the associated launch
- * configuration attribute, if unable to resolve any variables, or if the
- * resolved location does not point to an existing file in the local file
- * system
- */
- public static IPath getLocation(ILaunchConfiguration configuration) throws CoreException {
- return ExternalToolsCoreUtil.getLocation(configuration);
- }
-
- /**
- * Returns a boolean specifying whether or not output should be captured for
- * the given configuration
- *
- * @param configuration the configuration from which the value will be
- * extracted
- * @return boolean specifying whether or not output should be captured
- * @throws CoreException if unable to access the associated attribute
- */
- public static boolean getCaptureOutput(ILaunchConfiguration configuration) throws CoreException {
- return ExternalToolsCoreUtil.getCaptureOutput(configuration);
- }
-
- /**
- * Expands and returns the working directory attribute of the given launch
- * configuration. Returns <code>null</code> if a working directory is not
- * specified. If specified, the working is verified to point to an existing
- * directory in the local file system.
- *
- * @param configuration launch configuration
- * @return an absolute path to a directory in the local file system, or
- * <code>null</code> if unspecified
- * @throws CoreException if unable to retrieve the associated launch
- * configuration attribute, if unable to resolve any variables, or if the
- * resolved location does not point to an existing directory in the local
- * file system
- */
- public static IPath getWorkingDirectory(ILaunchConfiguration configuration) throws CoreException {
- return ExternalToolsCoreUtil.getWorkingDirectory(configuration);
- }
-
- /**
- * Expands and returns the arguments attribute of the given launch
- * configuration. Returns <code>null</code> if arguments are not specified.
- *
- * @param configuration launch configuration
- * @return an array of resolved arguments, or <code>null</code> if
- * unspecified
- * @throws CoreException if unable to retrieve the associated launch
- * configuration attribute, or if unable to resolve any variables
- */
- public static String[] getArguments(ILaunchConfiguration configuration) throws CoreException {
- return ExternalToolsCoreUtil.getArguments(configuration);
- }
-
- /**
- * Returns whether the given launch configuration is enabled. This property
- * is intended only to apply to external tool builder configurations and
- * determines whether the project builder will launch the configuration
- * when it builds.
- *
- * @param configuration the configuration for which the enabled state should
- * be determined.
- * @return whether the given configuration is enabled to be run when a build occurs.
- * @throws CoreException if unable to access the associated attribute
- */
- public static boolean isBuilderEnabled(ILaunchConfiguration configuration) throws CoreException {
- return ExternalToolsCoreUtil.isBuilderEnabled(configuration);
- }
-
- /**
- * Returns the collection of resources for the build scope as specified by the given launch configuration.
- *
- * @param configuration launch configuration
- * @throws CoreException if an exception occurs while retrieving the resources
- */
- public static IResource[] getResourcesForBuildScope(ILaunchConfiguration configuration) throws CoreException {
- return ExternalToolsCoreUtil.getResourcesForBuildScope(configuration);
- }
-
- /**
- * Parses the argument text into an array of individual
- * strings using the space character as the delimiter.
- * An individual argument containing spaces must have a
- * double quote (") at the start and end. Two double
- * quotes together is taken to mean an embedded double
- * quote in the argument text.
- *
- * @param arguments the arguments as one string
- * @return the array of arguments
- */
- public static String[] parseStringIntoList(String arguments) {
- return ExternalToolsCoreUtil.parseStringIntoList(arguments);
- }
-
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/IgnoreWhiteSpaceComparator.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/IgnoreWhiteSpaceComparator.java
deleted file mode 100644
index ab3f41e18..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/IgnoreWhiteSpaceComparator.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.launchConfigurations;
-
-import java.util.Comparator;
-
-public class IgnoreWhiteSpaceComparator implements Comparator {
-
- /* (non-Javadoc)
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
- */
- public int compare(Object o1, Object o2) {
- String one= (String)o1;
- String two= (String)o2;
- int i1 = 0;
- int i2 = 0;
- int l1 = one.length();
- int l2 = two.length();
- char ch1 = ' ';
- char ch2 = ' ';
- while (i1 < l1 && i2 < l2) {
- while (i1 < l1 && Character.isWhitespace(ch1 = one.charAt(i1))) {
- i1++;
- }
- while (i2 < l2 && Character.isWhitespace(ch2 = two.charAt(i2))) {
- i2++;
- }
- if (i1 == l1 && i2 == l2) {
- return 0;
- }
- if (ch1 != ch2) {
- return -1;
- }
- i1++;
- i2++;
- }
- return 0;
- }
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/WorkingSetComparator.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/WorkingSetComparator.java
deleted file mode 100644
index a92fc2da6..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/WorkingSetComparator.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.launchConfigurations;
-
-import java.util.Comparator;
-
-import org.eclipse.debug.ui.RefreshTab;
-import org.eclipse.ui.IWorkingSet;
-
-/**
- * Comparator for refresh scope launch configuration attribute
- * <code>ATTR_REFRESH_SCOPE</code>.
- */
-public class WorkingSetComparator implements Comparator {
-
- /* (non-Javadoc)
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
- */
- public int compare(Object o1, Object o2) {
- String one= (String)o1;
- String two= (String)o2;
- if (one == null || two == null) {
- if (one == two) {
- return 0;
- }
- return -1;
- }
- if (one.startsWith("${working_set:") && two.startsWith("${working_set:")) { //$NON-NLS-1$//$NON-NLS-2$
- IWorkingSet workingSet1 = RefreshTab.getWorkingSet(one);
- IWorkingSet workingSet2 = RefreshTab.getWorkingSet(two);
- if (workingSet1 == null || workingSet2 == null) {
- if (workingSet1 == workingSet2) {
- return 0;
- }
- return -1;
- }
- if (workingSet1.equals(workingSet2)) {
- return 0;
- }
- return -1;
- }
- return one.compareTo(two);
- }
-}

Back to the top