Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJared Burns2003-05-01 20:25:10 +0000
committerJared Burns2003-05-01 20:25:10 +0000
commitf98e85ee85b2b6eb8475510bada67621b9c59531 (patch)
tree8e8ad670a50c5c943e0af2052286d20171b654b3 /org.eclipse.ui.externaltools
parent9bba49bc9ff5376bc7feb4b9f260c556a0244287 (diff)
downloadeclipse.platform.debug-f98e85ee85b2b6eb8475510bada67621b9c59531.tar.gz
eclipse.platform.debug-f98e85ee85b2b6eb8475510bada67621b9c59531.tar.xz
eclipse.platform.debug-f98e85ee85b2b6eb8475510bada67621b9c59531.zip
Bug 36930 - Support variables in launch configurations
Diffstat (limited to 'org.eclipse.ui.externaltools')
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/dialog/ExternalToolVariableForm.java237
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/group/IGroupDialogPage.java41
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuilderTab.java10
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsLaunchConfigurationMessages.properties3
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsMainTab.java20
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsRefreshTab.java10
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsUtil.java11
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/VariableSelectionDialog.java85
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolBuilder.java44
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsModelMessages.properties2
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsPlugin.java21
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolConstants.java116
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolsHelpContextIds.java1
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ToolUtil.java155
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/VariableContextManager.java172
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/ExternalToolMigration.java15
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/ExternalToolVariable.java151
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/ExternalToolVariableRegistry.java152
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/AbstractVariableComponent.java109
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ContainerExpander.java42
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ContainerNameExpander.java39
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/DefaultVariableExpander.java55
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ExpandVariableContext.java103
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ExternalToolsVariableMessages.java34
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ExternalToolsVariableMessages.properties27
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/FilePromptExpander.java36
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/FolderPromptExpander.java37
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/IVariableComponent.java85
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/IVariableExpander.java53
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ProjectExpander.java49
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ProjectNameExpander.java34
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/PromptExpanderBase.java102
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ResourceComponent.java223
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ResourceExpander.java120
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ResourceNameExpander.java33
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/SpecificFileResourceComponent.java69
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/SpecificFolderResourceComponent.java107
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/StringPromptExpander.java37
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/WorkingSetComponent.java184
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/WorkingSetExpander.java66
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/WorkspaceExpander.java38
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildTypeExpander.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/BuildTypeExpander.java)8
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/RefreshScopeVariableRegistry.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/RefreshScopeVariableRegistry.java)6
-rw-r--r--org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/BackgroundResourceRefresher.java2
-rw-r--r--org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramLaunchDelegate.java2
-rw-r--r--org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramMainTab.java6
-rw-r--r--org.eclipse.ui.externaltools/plugin.properties19
-rw-r--r--org.eclipse.ui.externaltools/plugin.xml87
48 files changed, 121 insertions, 2937 deletions
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/dialog/ExternalToolVariableForm.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/dialog/ExternalToolVariableForm.java
deleted file mode 100644
index 00c346faf..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/dialog/ExternalToolVariableForm.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.dialog;
-
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.ui.externaltools.internal.group.IGroupDialogPage;
-import org.eclipse.ui.externaltools.internal.model.ToolUtil;
-import org.eclipse.ui.externaltools.internal.registry.ExternalToolVariable;
-import org.eclipse.ui.externaltools.internal.variable.IVariableComponent;
-
-/**
- * Visual grouping of controls that allows the user to
- * select a variable and configure it with extra
- * information.
- */
-public class ExternalToolVariableForm {
- private static final int VISIBLE_ITEM_COUNT = 6;
-
- private String variableListLabelText;
- private ExternalToolVariable[] variables;
- private IVariableComponent[] components;
- private IGroupDialogPage dialogPage;
-
- private Label variableListLabel;
- private List variableList;
- private Composite variableComposite;
- private StackLayout variableLayout;
- private int activeComponentIndex = -1;
-
- /**
- * Creates the visual grouping
- *
- * @param variableListLabelText the label text to use for identifying the list of variables
- * @param variables the collection of variables to display to the user
- */
- public ExternalToolVariableForm(String variableListLabelText, ExternalToolVariable[] variables) {
- super();
- this.variableListLabelText = variableListLabelText;
- this.variables = variables;
- this.components = new IVariableComponent[variables.length];
- }
-
- public Composite createContents(Composite parent, IGroupDialogPage page) {
- Font font = parent.getFont();
-
- dialogPage = page;
-
- Composite mainComposite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 1;
- GridData data = new GridData(GridData.FILL_BOTH);
- mainComposite.setLayout(layout);
- mainComposite.setLayoutData(data);
-
- variableListLabel = new Label(mainComposite, SWT.NONE);
- variableListLabel.setText(variableListLabelText);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 1;
- variableListLabel.setLayoutData(data);
- variableListLabel.setFont(font);
-
- variableList = new List(mainComposite, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.heightHint = variableList.getItemHeight() * VISIBLE_ITEM_COUNT;
- variableList.setLayoutData(data);
- variableList.setFont(font);
-
- variableComposite = new Composite(mainComposite, SWT.NONE);
- variableLayout = new StackLayout();
- variableLayout.marginWidth = 0;
- variableLayout.marginHeight = 0;
- data = new GridData(GridData.FILL_BOTH);
- variableComposite.setLayout(variableLayout);
- variableComposite.setLayoutData(data);
- variableComposite.setFont(font);
-
- createVariableComponents();
-
- populateVariableList();
-
- variableList.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateVariableComposite(null, false);
- }
- });
-
- setEnabled(true);
- return mainComposite;
- }
-
- /**
- * Creates the visual component for each variable
- * and determine the initial size so the form
- * can be layout properly.
- */
- private void createVariableComponents() {
- for (int i = 0; i < variables.length; i++) {
- ExternalToolVariable var = variables[i];
- components[i] = var.getComponent();
- components[i].createContents(variableComposite, var.getTag(), dialogPage);
- }
- }
-
- /**
- * Returns the formatted variable or <code>null</code> if
- * none selected.
- */
- public String getSelectedVariable() {
- if (activeComponentIndex != -1) {
- String varValue = components[activeComponentIndex].getVariableValue();
- return ToolUtil.buildVariableTag(variables[activeComponentIndex].getTag(), varValue);
- }
-
- return null;
- }
-
- /**
- * Returns the variable list of this form.
- */
- public List getVariableList() {
- return variableList;
- }
-
- /**
- * Returns whether the current variable selection is
- * valid, including the selected variable value.
- */
- public boolean isValid() {
- if (activeComponentIndex != -1) {
- return components[activeComponentIndex].isValid();
- }
-
- return true;
- }
-
- private void populateVariableList() {
- String[] items = new String[variables.length];
- StringBuffer buffer = new StringBuffer(80);
- for (int i = 0; i < variables.length; i++) {
- ToolUtil.buildVariableTag(variables[i].getTag(), null, buffer);
- buffer.append(" - "); //$NON-NLS-1$
- buffer.append(variables[i].getDescription());
- items[i] = buffer.toString();
- buffer.setLength(0);
- }
- variableList.setItems(items);
- }
-
- public void selectVariable(String varName, String varValue) {
- if (varName != null && varName.length() > 0) {
- for (int i = 0; i < variables.length; i++) {
- if (varName.equals(variables[i].getTag())) {
- variableList.select(i);
- updateVariableComposite(varValue, true);
- return;
- }
- }
- }
-
- variableList.deselectAll();
- updateVariableComposite(varValue, false);
- }
-
- private void setComponentVisible(int index) {
- if (index == -1) {
- variableLayout.topControl = null;
- } else {
- variableLayout.topControl = components[index].getControl();
- }
- variableComposite.layout();
- }
-
- /**
- * Enables or disables the variable form controls.
- */
- public void setEnabled(boolean enabled) {
- variableListLabel.setEnabled(enabled);
- variableList.setEnabled(enabled);
- if (enabled && variableList.getSelection().length == 0) {
- if (variableList.getItemCount() > 0) {
- variableList.select(0);
- activeComponentIndex= 0;
- }
- }
- variableComposite.setVisible(enabled);
- setComponentVisible(activeComponentIndex);
- }
-
- private void updateVariableComposite(String value, boolean setValue) {
- if (variableList.getSelectionIndex() == activeComponentIndex) {
- return;
- }
- activeComponentIndex = variableList.getSelectionIndex();
- setComponentVisible(activeComponentIndex);
- if (activeComponentIndex != -1 && setValue) {
- components[activeComponentIndex].setVariableValue(value);
- }
- dialogPage.updateValidState();
- }
-
- /**
- * Validates the current variable selection is and
- * its value are acceptable.
- */
- public void validate() {
- if (activeComponentIndex != -1) {
- components[activeComponentIndex].validate();
- }
- }
-
- public void dispose() {
- for (int i = 0; i < components.length; i++) {
- IVariableComponent varComponent = components[i];
- varComponent.dispose();
- }
- }
-} \ No newline at end of file
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/group/IGroupDialogPage.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/group/IGroupDialogPage.java
deleted file mode 100644
index fc1aba897..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/group/IGroupDialogPage.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.group;
-
-
-import org.eclipse.jface.dialogs.IMessageProvider;
-
-/**
- * Represents the API for a group of visual components
- * to access the dialog page that contains it.
- * <p>
- * This interface is not intended to be extended
- * nor implemented by clients.
- * </p>
- */
-public interface IGroupDialogPage extends IMessageProvider {
-
- /**
- * Sets the error message for this page
- *
- * @param errorMessage the message, or <code>null</code> to clear the
- * message
- */
- public void setErrorMessage(String errorMessage);
-
- /**
- * Updates the page's valid state using the group's
- * current valid state. This will cause the dialog's
- * buttons dependent on the page's valid state to
- * update to reflect the new state.
- */
- public void updateValidState();
-}
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
index 603792e4d..c8b56ff02 100644
--- 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
@@ -16,6 +16,9 @@ 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.debug.ui.variables.IGroupDialogPage;
+import org.eclipse.debug.ui.variables.VariableUtil;
+import org.eclipse.debug.ui.variables.WorkingSetComponent;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@@ -29,12 +32,9 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.externaltools.internal.group.IGroupDialogPage;
import org.eclipse.ui.externaltools.internal.model.ExternalToolBuilder;
import org.eclipse.ui.externaltools.internal.model.IExternalToolConstants;
import org.eclipse.ui.externaltools.internal.model.IExternalToolsHelpContextIds;
-import org.eclipse.ui.externaltools.internal.model.ToolUtil;
-import org.eclipse.ui.externaltools.internal.variable.WorkingSetComponent;
import org.eclipse.ui.help.WorkbenchHelp;
public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab implements IGroupDialogPage {
@@ -133,7 +133,7 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab impl
updateWorkingSetComponent();
if (buildScope != null) {
- ToolUtil.VariableDefinition variable= ToolUtil.extractVariableTag(buildScope, 0);
+ VariableUtil.VariableDefinition variable= VariableUtil.extractVariableTag(buildScope, 0);
workingSetComponent.setVariableValue(variable.argument);
}
@@ -172,7 +172,7 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab impl
configuration.setAttribute(IExternalToolConstants.ATTR_RUN_BUILD_KINDS, buffer.toString());
if (workingSetButton.getSelection()) {
- String variableTag= ToolUtil.buildVariableTag("working_set", workingSetComponent.getVariableValue()); //$NON-NLS-1$
+ String variableTag= VariableUtil.buildVariableTag("working_set", workingSetComponent.getVariableValue()); //$NON-NLS-1$
configuration.setAttribute(IExternalToolConstants.ATTR_REFRESH_SCOPE, variableTag);
} else {
configuration.setAttribute(IExternalToolConstants.ATTR_REFRESH_SCOPE, (String)null);
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
index fba8040b9..f12fb6345 100644
--- 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
@@ -28,9 +28,6 @@ ExternalToolsMainTab.Varia&bles..._2=Variable&s...
ExternalToolsMainTab.Note__Enclose_an_argument_containing_spaces_using_double-quotes_(__)._Not_applicable_for_variables._3=Note: Enclose an argument containing spaces using double-quotes (\").\nNot applicable for variables.
ExternalToolsMainTab.Run_tool_in_bac&kground_4=&Run tool in background
ExternalToolsMainTab.Error_reading_configuration_7=Error reading configuration
-ExternalToolsMainTab.Select_variable_10=Select variable
-ExternalToolsMainTab.&Choose_a_variable__11=&Choose a variable:
-ExternalToolsMainTab.Invalid_selection_12=Invalid selection
ExternalToolsRefreshTab.Recursively_&include_sub-folders_1=Recursively &include sub-folders
ExternalToolsRefreshTab.Choose_scope_v&ariable___2=Choose scope v&ariable:
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
index d598e6032..c2be78f5e 100644
--- 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
@@ -20,7 +20,12 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
+import org.eclipse.debug.ui.variables.ExternalToolVariableRegistry;
+import org.eclipse.debug.ui.variables.IVariableConstants;
+import org.eclipse.debug.ui.variables.VariableSelectionDialog;
+import org.eclipse.debug.ui.variables.VariableUtil;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
@@ -44,9 +49,6 @@ import org.eclipse.ui.dialogs.SelectionDialog;
import org.eclipse.ui.externaltools.internal.model.ExternalToolsImages;
import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin;
import org.eclipse.ui.externaltools.internal.model.IExternalToolConstants;
-import org.eclipse.ui.externaltools.internal.model.ToolUtil;
-import org.eclipse.ui.externaltools.internal.model.ToolUtil.VariableDefinition;
-import org.eclipse.ui.externaltools.internal.registry.ExternalToolVariableRegistry;
public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTab {
@@ -423,7 +425,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
*/
private String validateVariables(String value) {
int start= 0;
- VariableDefinition variable = ToolUtil.extractVariableTag(value, start);
+ VariableUtil.VariableDefinition variable = VariableUtil.extractVariableTag(value, start);
while (variable.start != -1) {
if (variable.end == -1) {
return ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsMainTab.Invalid_Expected_closing_}"); //$NON-NLS-1$
@@ -431,18 +433,18 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
if (variable.name == null || variable.name.length() == 0) {
return ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsMainTab.No_variable_specified"); //$NON-NLS-1$
}
- ExternalToolVariableRegistry registry = ExternalToolsPlugin.getDefault().getToolVariableRegistry();
+ ExternalToolVariableRegistry registry = DebugUIPlugin.getDefault().getToolVariableRegistry();
if (registry.getVariable(variable.name) == null) {
return MessageFormat.format(ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsMainTab.Unknown_variable"), new String[] {variable.name}); //$NON-NLS-1$
}
start= variable.end;
- variable = ToolUtil.extractVariableTag(value, start);
+ variable = VariableUtil.extractVariableTag(value, start);
}
return null;
}
private boolean containsVariable(String value) {
- return ToolUtil.extractVariableTag(value, 0).start != -1;
+ return VariableUtil.extractVariableTag(value, 0).start != -1;
}
/**
@@ -500,7 +502,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
}
IResource resource = (IResource)results[0];
StringBuffer buf = new StringBuffer();
- ToolUtil.buildVariableTag(IExternalToolConstants.VAR_WORKSPACE_LOC, resource.getFullPath().toString(), buf);
+ VariableUtil.buildVariableTag(IVariableConstants.VAR_WORKSPACE_LOC, resource.getFullPath().toString(), buf);
String text= buf.toString();
if (text != null) {
locationField.setText(text);
@@ -523,7 +525,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
Object[] resource = containerDialog.getResult();
String text= null;
if (resource != null && resource.length > 0) {
- text= ToolUtil.buildVariableTag(IExternalToolConstants.VAR_WORKSPACE_LOC, ((IPath)resource[0]).toString());
+ text= VariableUtil.buildVariableTag(IVariableConstants.VAR_WORKSPACE_LOC, ((IPath)resource[0]).toString());
}
if (text != null) {
workDirectoryField.setText(text);
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsRefreshTab.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsRefreshTab.java
index bf5930656..29db51943 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsRefreshTab.java
+++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsRefreshTab.java
@@ -15,6 +15,10 @@ 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.debug.ui.variables.ExternalToolVariable;
+import org.eclipse.debug.ui.variables.ExternalToolVariableForm;
+import org.eclipse.debug.ui.variables.IGroupDialogPage;
+import org.eclipse.debug.ui.variables.VariableUtil;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@@ -24,14 +28,10 @@ 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.ui.externaltools.internal.dialog.ExternalToolVariableForm;
-import org.eclipse.ui.externaltools.internal.group.IGroupDialogPage;
import org.eclipse.ui.externaltools.internal.model.ExternalToolsImages;
import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin;
import org.eclipse.ui.externaltools.internal.model.IExternalToolConstants;
import org.eclipse.ui.externaltools.internal.model.IExternalToolsHelpContextIds;
-import org.eclipse.ui.externaltools.internal.model.ToolUtil;
-import org.eclipse.ui.externaltools.internal.registry.ExternalToolVariable;
import org.eclipse.ui.help.WorkbenchHelp;
public class ExternalToolsRefreshTab extends AbstractLaunchConfigurationTab implements IGroupDialogPage {
@@ -142,7 +142,7 @@ public class ExternalToolsRefreshTab extends AbstractLaunchConfigurationTab impl
String varName = null;
String varValue = null;
if (scope != null) {
- ToolUtil.VariableDefinition varDef = ToolUtil.extractVariableTag(scope, 0);
+ VariableUtil.VariableDefinition varDef = VariableUtil.extractVariableTag(scope, 0);
varName = varDef.name;
varValue = varDef.argument;
}
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
index d8e257104..77976defd 100644
--- 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
@@ -30,11 +30,12 @@ import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin;
import org.eclipse.ui.externaltools.internal.model.IExternalToolConstants;
import org.eclipse.ui.externaltools.internal.model.ToolUtil;
-import org.eclipse.ui.externaltools.internal.model.VariableContextManager;
import org.eclipse.ui.externaltools.internal.registry.ExternalToolMigration;
-import org.eclipse.ui.externaltools.internal.registry.ExternalToolVariable;
-import org.eclipse.ui.externaltools.internal.registry.RefreshScopeVariableRegistry;
-import org.eclipse.ui.externaltools.internal.variable.ExpandVariableContext;
+import org.eclipse.ui.externaltools.internal.variables.RefreshScopeVariableRegistry;
+import org.eclipse.debug.ui.variables.ExpandVariableContext;
+import org.eclipse.debug.ui.variables.ExternalToolVariable;
+import org.eclipse.debug.ui.variables.VariableContextManager;
+import org.eclipse.debug.ui.variables.VariableUtil;
/**
* Utilities for external tool launch configurations.
@@ -307,7 +308,7 @@ public class ExternalToolsUtil {
return null;
}
- ToolUtil.VariableDefinition varDef = ToolUtil.extractVariableTag(scope, 0);
+ VariableUtil.VariableDefinition varDef = VariableUtil.extractVariableTag(scope, 0);
if (varDef.start == -1 || varDef.end == -1 || varDef.name == null) {
String msg = MessageFormat.format(ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsUtil.invalidRefreshVarFormat"), new Object[] { configuration.getName()}); //$NON-NLS-1$
abort(msg, null, 0);
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/VariableSelectionDialog.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/VariableSelectionDialog.java
deleted file mode 100644
index 12acbc8ce..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/VariableSelectionDialog.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.launchConfigurations;
-
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.externaltools.internal.dialog.ExternalToolVariableForm;
-import org.eclipse.ui.externaltools.internal.group.IGroupDialogPage;
-import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin;
-import org.eclipse.ui.externaltools.internal.model.IExternalToolsHelpContextIds;
-import org.eclipse.ui.externaltools.internal.registry.ExternalToolVariable;
-import org.eclipse.ui.help.WorkbenchHelp;
-
-/**
- * Dialog that prompts the user to select an external tools variable
- */
-class VariableSelectionDialog extends SelectionDialog {
- private ExternalToolVariableForm form;
- public VariableSelectionDialog(Shell parent) {
- super(parent);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- setTitle(ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsMainTab.Select_variable_10")); //$NON-NLS-1$
- }
- /* (non-Javadoc)
- * Method declared in Window.
- */
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- WorkbenchHelp.setHelp(shell, IExternalToolsHelpContextIds.VARIABLE_SELECTION_DIALOG);
- }
- protected Control createDialogArea(Composite parent) {
- // Create the dialog area
- Composite composite= (Composite)super.createDialogArea(parent);
- ExternalToolVariable[] variables= ExternalToolsPlugin.getDefault().getToolVariableRegistry().getVariables();
- form= new ExternalToolVariableForm(ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsMainTab.&Choose_a_variable__11"), variables); //$NON-NLS-1$
- form.createContents(composite, new IGroupDialogPage() {
-
- public void setErrorMessage(String errorMessage) {
- VariableSelectionDialog.this.setMessage(errorMessage);
- }
-
- public void updateValidState() {
- }
-
- public String getMessage() {
- if (!form.isValid()) {
- return ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsMainTab.Invalid_selection_12"); //$NON-NLS-1$
- }
- return null;
- }
-
- public int getMessageType() {
- if (!form.isValid()) {
- return IMessageProvider.ERROR;
- }
- return 0;
- }
- });
-
- form.getVariableList().addListener(SWT.MouseDoubleClick, new Listener() {
- public void handleEvent(Event event) {
- okPressed();
- }
- });
- return composite;
- }
-
- public ExternalToolVariableForm getForm() {
- return form;
- }
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolBuilder.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolBuilder.java
index 5fbca9c6c..dd93e172b 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolBuilder.java
+++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolBuilder.java
@@ -41,6 +41,8 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
private static final int[] DEFAULT_BUILD_TYPES= new int[] {
IncrementalProjectBuilder.INCREMENTAL_BUILD,
IncrementalProjectBuilder.FULL_BUILD};
+
+ private static String buildType = IExternalToolConstants.BUILD_TYPE_NONE;
/* (non-Javadoc)
* Method declared on IncrementalProjectBuilder.
@@ -70,15 +72,53 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
if (buildForChange) {
monitor.subTask(MessageFormat.format(ExternalToolsModelMessages.getString("ExternalToolBuilder.Running_{0}..._1"), new String[]{config.getName()})); //$NON-NLS-1$
- VariableContextManager.getDefault().buildStarted(getProject(), kind);
+ buildStarted(kind);
config.launch(ILaunchManager.RUN_MODE, monitor);
- VariableContextManager.getDefault().buildEnded();
+ buildEnded();
forgetLastBuiltState();
}
return null;
}
+ /**
+ * Returns the build type being performed if the
+ * external tool is being run as a project builder.
+ *
+ * @return one of the <code>IExternalToolConstants.BUILD_TYPE_*</code> constants.
+ */
+ public static String getBuildType() {
+ return buildType;
+ }
+
+ /**
+ * Stores the currently active build kind when a build begins
+ * @param buildKind
+ */
+ private void buildStarted(int buildKind) {
+ switch (buildKind) {
+ case IncrementalProjectBuilder.INCREMENTAL_BUILD :
+ buildType = IExternalToolConstants.BUILD_TYPE_INCREMENTAL;
+ break;
+ case IncrementalProjectBuilder.FULL_BUILD :
+ buildType = IExternalToolConstants.BUILD_TYPE_FULL;
+ break;
+ case IncrementalProjectBuilder.AUTO_BUILD :
+ buildType = IExternalToolConstants.BUILD_TYPE_AUTO;
+ break;
+ default :
+ buildType = IExternalToolConstants.BUILD_TYPE_NONE;
+ break;
+ }
+ }
+
+ /**
+ * Clears the current build kind when a build finishes.
+ */
+ private void buildEnded() {
+ buildType= IExternalToolConstants.BUILD_TYPE_NONE;
+ }
+
private boolean buildScopeIndicatesBuild(IResource[] resources) {
for (int i = 0; i < resources.length; i++) {
IResourceDelta delta = getDelta(resources[i].getProject());
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsModelMessages.properties b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsModelMessages.properties
index b7c527298..17b32ee95 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsModelMessages.properties
+++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsModelMessages.properties
@@ -16,7 +16,5 @@ ToolUtil.fileLocVarMissing = The variable named ''{0}'' for the file location do
ToolUtil.argumentVarFormatWrong = A variable for the arguments is not in a valid format.
ToolUtil.argumentVarMissing = The variable named ''{0}'' for the arguments does not exist.
-ExternalToolVariable.componentErrorMessage = Problem displaying UI component of selected variable.
-
ImageDescriptorRegistry.Allocating_image_for_wrong_display_1=Allocating image for wrong display
ExternalToolBuilder.Running_{0}..._1=Running {0}...
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsPlugin.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsPlugin.java
index b5f2daca7..7573af56a 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsPlugin.java
+++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsPlugin.java
@@ -24,8 +24,7 @@ import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.externaltools.internal.registry.ExternalToolVariableRegistry;
-import org.eclipse.ui.externaltools.internal.registry.RefreshScopeVariableRegistry;
+import org.eclipse.ui.externaltools.internal.variables.RefreshScopeVariableRegistry;
import org.eclipse.ui.plugin.AbstractUIPlugin;
/**
@@ -40,7 +39,6 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin {
private static ExternalToolsPlugin plugin;
private RefreshScopeVariableRegistry refreshVarRegistry;
- private ExternalToolVariableRegistry toolVariableRegistry;
private static final String EMPTY_STRING= ""; //$NON-NLS-1$
@@ -78,16 +76,6 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin {
}
/**
- * Returns the registry of external tool variables.
- */
- public ExternalToolVariableRegistry getToolVariableRegistry() {
- if (toolVariableRegistry == null) {
- toolVariableRegistry = new ExternalToolVariableRegistry();
- }
- return toolVariableRegistry;
- }
-
- /**
* Returns the registry of refresh scope variables.
*/
public RefreshScopeVariableRegistry getRefreshVariableRegistry() {
@@ -178,13 +166,6 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin {
*/
public void startup() throws CoreException {
super.startup();
- getStandardDisplay().asyncExec(
- new Runnable() {
- public void run() {
- //initialize the variable context manager
- VariableContextManager.getDefault();
- }
- });
}
/**
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolConstants.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolConstants.java
index cd81fb325..39e155ee0 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolConstants.java
+++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolConstants.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.ui.externaltools.internal.model;
-
/**
* Defines the constants available for client use.
* <p>
@@ -30,19 +29,12 @@ public interface IExternalToolConstants {
*/
public static final String EXTENSION_POINT_CONFIGURATION_DUPLICATION_MAPS = "configurationDuplicationMaps"; //$NON-NLS-1$
/**
- * Extension point to declare external tool variables.
- * (value<code>toolVariables</code>).
- */
- public static final String EXTENSION_POINT_TOOL_VARIABLES = "toolVariables"; //$NON-NLS-1$
-
- /**
* Extension point to declare refresh scope variables. Refresh scope
* variables are external tool variables that are only valid for
* specifying a refresh scope.
* (value <code>refreshVariables</code>).
*/
- public static final String EXTENSION_POINT_REFRESH_VARIABLES = "refreshVariables"; //$NON-NLS-1$
-
+ public static final String EXTENSION_POINT_REFRESH_VARIABLES = "refreshVariables"; //$NON-NLS-1$}
// ------- Tool Types -------
/**
* External tool type for programs such as executables, batch files,
@@ -50,112 +42,6 @@ public interface IExternalToolConstants {
*/
public static final String TOOL_TYPE_PROGRAM = "programType"; //$NON-NLS-1$;
- // ------- Variables -------
-
- /**
- * Variable that expands to the absolute path on the system's hard drive
- * to the workspace directory (value <code>workspace_loc</code>).
- */
- public static final String VAR_WORKSPACE_LOC = "workspace_loc"; //$NON-NLS-1$
-
- /**
- * Variable that expands to the absolute path on the system's hard drive
- * to a project's directory (value <code>project_loc</code>).
- */
- public static final String VAR_PROJECT_LOC = "project_loc"; //$NON-NLS-1$
-
- /**
- * Variable that expands to the full path, relative to the workspace root,
- * of a project (value <code>project_path</code>).
- */
- public static final String VAR_PROJECT_PATH = "project_path"; //$NON-NLS-1$
-
- /**
- * Variable that expands to the name of a project (value <code>project_name</code>).
- */
- public static final String VAR_PROJECT_NAME = "project_name"; //$NON-NLS-1$
-
- /**
- * Variable that expands to the absolute path on the system's hard drive
- * to a resource's location (value <code>resource_loc</code>).
- */
- public static final String VAR_RESOURCE_LOC = "resource_loc"; //$NON-NLS-1$
-
- /**
- * Variable that expands to the full path, relative to the workspace root,
- * of a resource (value <code>resource_path</code>).
- */
- public static final String VAR_RESOURCE_PATH = "resource_path"; //$NON-NLS-1$
-
- /**
- * Variable that expands to the name of a resource (value <code>resource_name</code>).
- */
- public static final String VAR_RESOURCE_NAME = "resource_name"; //$NON-NLS-1$
-
- /**
- * Variable that expands to the absolute path on the system's hard drive
- * to a resource's containing directory (value <code>container_loc</code>).
- */
- public static final String VAR_CONTAINER_LOC = "container_loc"; //$NON-NLS-1$
-
- /**
- * Variable that expands to the full path, relative to the workspace root,
- * of a resource's parent (value <code>container_path</code>).
- */
- public static final String VAR_CONTAINER_PATH = "container_path"; //$NON-NLS-1$
-
- /**
- * Variable that expands to the name of a resource's parent (value <code>container_name</code>).
- */
- public static final String VAR_CONTAINER_NAME = "container_name"; //$NON-NLS-1$
-
- /**
- * Variable that expands to the type of build (value <code>build_type</code>). See
- * <code>BUILD_TYPE_*</code> constants for possible values.
- */
- public static final String VAR_BUILD_TYPE = "build_type"; //$NON-NLS-1$
-
- /**
- * Variable that expands to the current editor cursor column (value <code>editor_cur_col</code>).
- */
- public static final String VAR_EDITOR_CUR_COL = "editor_cur_col"; //$NON-NLS-1$
-
- /**
- * Variable that expands to the current editor cursor line (value <code>editor_cur_line</code>).
- */
- public static final String VAR_EDITOR_CUR_LINE = "editor_cur_line"; //$NON-NLS-1$
-
- /**
- * Variable that expands to the current editor selected text (value <code>editor_sel_text</code>).
- */
- public static final String VAR_EDITOR_SEL_TEXT = "editor_sel_text"; //$NON-NLS-1$
-
- // ------- Refresh Variables -------
- /**
- * Variable that expands to the workspace root object (value <code>workspace</code>).
- */
- public static final String VAR_WORKSPACE = "workspace"; //$NON-NLS-1$
-
- /**
- * Variable that expands to the project resource (value <code>project</code>).
- */
- public static final String VAR_PROJECT = "project"; //$NON-NLS-1$
-
- /**
- * Variable that expands to the container resource (value <code>container</code>).
- */
- public static final String VAR_CONTAINER = "container"; //$NON-NLS-1$
-
- /**
- * Variable that expands to a resource (value <code>resource</code>).
- */
- public static final String VAR_RESOURCE = "resource"; //$NON-NLS-1$
-
- /**
- * Variable that expands to the working set object (value <code>working_set</code>).
- */
- public static final String VAR_WORKING_SET = "working_set"; //$NON-NLS-1$
-
// ------- Build Types -------
/**
* Build type indicating an incremental project build request for
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolsHelpContextIds.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolsHelpContextIds.java
index 7dde91692..8668ce300 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolsHelpContextIds.java
+++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolsHelpContextIds.java
@@ -41,7 +41,6 @@ public interface IExternalToolsHelpContextIds {
public static final String STATUS_DIALOG = PREFIX + "status_dialog_context"; //$NON-NLS-1$
public static final String MESSAGE_WITH_TOGGLE_DIALOG = PREFIX + "message_with_toggle_dialog_context"; //$NON-NLS-1$
public static final String TARGET_ORDER_DIALOG = PREFIX + "target_order_dialog_context"; //$NON-NLS-1$
- public static final String VARIABLE_SELECTION_DIALOG = PREFIX + "variable_selection_dialog_context"; //$NON-NLS-1$
// Preference Pages
public static final String EXTERNAL_TOOLS_PREFERENCE_PAGE = PREFIX + "preference_page_context"; //$NON-NLS-1$
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ToolUtil.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ToolUtil.java
index 9969a42da..119a88bc9 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ToolUtil.java
+++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ToolUtil.java
@@ -23,9 +23,11 @@ import java.util.Map.Entry;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.ui.externaltools.internal.registry.ExternalToolVariable;
-import org.eclipse.ui.externaltools.internal.registry.ExternalToolVariableRegistry;
-import org.eclipse.ui.externaltools.internal.variable.ExpandVariableContext;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.ui.variables.ExpandVariableContext;
+import org.eclipse.debug.ui.variables.ExternalToolVariable;
+import org.eclipse.debug.ui.variables.ExternalToolVariableRegistry;
+import org.eclipse.debug.ui.variables.VariableUtil;
/**
* General utility class dealing with external tools
@@ -36,16 +38,6 @@ public final class ToolUtil {
*/
private static final char ARG_DELIMITER = ' '; //$NON-NLS-1$
private static final char ARG_DBL_QUOTE = '"'; //$NON-NLS-1$
-
- /**
- * Variable tag indentifiers
- */
- private static final char VAR_TAG_START_CHAR1 = '$'; //$NON-NLS-1$
- private static final char VAR_TAG_START_CHAR2 = '{'; //$NON-NLS-1$
- private static final char VAR_TAG_END_CHAR1 = '}'; //$NON-NLS-1$
- private static final String VAR_TAG_START = "${"; //$NON-NLS-1$
- private static final String VAR_TAG_END = "}"; //$NON-NLS-1$
- private static final String VAR_TAG_SEP = ":"; //$NON-NLS-1$
/**
* No instances allowed
@@ -53,37 +45,6 @@ public final class ToolUtil {
private ToolUtil() {
super();
}
-
- /**
- * Builds a variable tag that will be auto-expanded before
- * the tool is run.
- *
- * @param varName the name of a known variable (one of the VAR_* constants for instance)
- * @param varArgument an optional argument for the variable, <code>null</code> if none
- */
- public static String buildVariableTag(String varName, String varArgument) {
- StringBuffer buf = new StringBuffer();
- buildVariableTag(varName,varArgument, buf);
- return buf.toString();
- }
-
- /**
- * Builds a variable tag that will be auto-expanded before
- * the tool is run.
- *
- * @param varName the name of a known variable (one of the VAR_* constants for instance)
- * @param varArgument an optional argument for the variable, <code>null</code> if none
- * @param buffer the buffer to write the constructed variable tag
- */
- public static void buildVariableTag(String varName, String varArgument, StringBuffer buffer) {
- buffer.append(VAR_TAG_START);
- buffer.append(varName);
- if (varArgument != null && varArgument.length() > 0) {
- buffer.append(VAR_TAG_SEP);
- buffer.append(varArgument);
- }
- buffer.append(VAR_TAG_END);
- }
/**
* Return a list of all the environment variables (suitable for passing to
@@ -125,7 +86,7 @@ public final class ToolUtil {
int start = 0;
while (true) {
- VariableDefinition varDef = extractVariableTag(argument, start);
+ VariableUtil.VariableDefinition varDef = VariableUtil.extractVariableTag(argument, start);
// No more variables found...
if (varDef.start == -1) {
@@ -151,7 +112,7 @@ public final class ToolUtil {
start = varDef.end;
// Lookup the variable if it exist
- ExternalToolVariableRegistry registry = ExternalToolsPlugin.getDefault().getToolVariableRegistry();
+ ExternalToolVariableRegistry registry = DebugUIPlugin.getDefault().getToolVariableRegistry();
ExternalToolVariable variable = registry.getVariable(varDef.name);
if (variable == null) {
String msg = MessageFormat.format(ExternalToolsModelMessages.getString("ToolUtil.argumentVarMissing"), new Object[] {varDef.name}); //$NON-NLS-1$
@@ -213,7 +174,7 @@ public final class ToolUtil {
return ""; //$NON-NLS-1$
}
- VariableDefinition varDef = extractVariableTag(dirLocation, 0);
+ VariableUtil.VariableDefinition varDef = VariableUtil.extractVariableTag(dirLocation, 0);
// Return if no variable found
if (varDef.start < 0) {
return dirLocation;
@@ -234,7 +195,7 @@ public final class ToolUtil {
// Lookup the variable if it exist
ExternalToolVariableRegistry registry;
- registry = ExternalToolsPlugin.getDefault().getToolVariableRegistry();
+ registry = DebugUIPlugin.getDefault().getToolVariableRegistry();
ExternalToolVariable variable = registry.getVariable(varDef.name);
if (variable == null) {
String msg = MessageFormat.format(ExternalToolsModelMessages.getString("ToolUtil.dirLocVarMissing"), new Object[] {varDef.name}); //$NON-NLS-1$
@@ -252,7 +213,7 @@ public final class ToolUtil {
}
buffer.append(path.toOSString());
start= varDef.end;
- varDef= extractVariableTag(dirLocation, start);
+ varDef= VariableUtil.extractVariableTag(dirLocation, start);
}
// Append text remaining after the variables
buffer.append(dirLocation.substring(start));
@@ -275,7 +236,7 @@ public final class ToolUtil {
return ""; //$NON-NLS-1$
}
- VariableDefinition varDef = extractVariableTag(fileLocation, 0);
+ VariableUtil.VariableDefinition varDef = VariableUtil.extractVariableTag(fileLocation, 0);
// Return if no variable found
if (varDef.start < 0) {
return fileLocation;
@@ -296,7 +257,7 @@ public final class ToolUtil {
// Lookup the variable if it exist
ExternalToolVariableRegistry registry;
- registry = ExternalToolsPlugin.getDefault().getToolVariableRegistry();
+ registry = DebugUIPlugin.getDefault().getToolVariableRegistry();
ExternalToolVariable variable = registry.getVariable(varDef.name);
if (variable == null) {
String msg = MessageFormat.format(ExternalToolsModelMessages.getString("ToolUtil.fileLocVarMissing"), new Object[] {varDef.name}); //$NON-NLS-1$
@@ -314,7 +275,7 @@ public final class ToolUtil {
}
buffer.append(path.toOSString());
start= varDef.end;
- varDef= extractVariableTag(fileLocation, start);
+ varDef= VariableUtil.extractVariableTag(fileLocation, start);
}
// Append text remaining after the variables
buffer.append(fileLocation.substring(start));
@@ -324,48 +285,6 @@ public final class ToolUtil {
}
/**
- * Extracts from the source text the variable tag's name
- * and argument.
- *
- * @param text the source text to parse for a variable tag
- * @param start the index in the string to start the search
- * @return the variable definition
- */
- public static VariableDefinition extractVariableTag(String text, int start) {
- VariableDefinition varDef = new VariableDefinition();
-
- varDef.start = text.indexOf(VAR_TAG_START, start);
- if (varDef.start < 0){
- return varDef;
- }
- start = varDef.start + VAR_TAG_START.length();
-
- int end = text.indexOf(VAR_TAG_END, start);
- if (end < 0) {
- return varDef;
- }
- varDef.end = end + VAR_TAG_END.length();
- if (end == start) {
- return varDef;
- }
-
- int mid = text.indexOf(VAR_TAG_SEP, start);
- if (mid < 0 || mid > end) {
- varDef.name = text.substring(start, end);
- } else {
- if (mid > start) {
- varDef.name = text.substring(start, mid);
- }
- mid = mid + VAR_TAG_SEP.length();
- if (mid < end) {
- varDef.argument = text.substring(mid, end);
- }
- }
-
- return varDef;
- }
-
- /**
* Parses the argument text into an array of individual
* arguments using the space character as the delimiter.
* An individual argument containing spaces must have a
@@ -425,18 +344,18 @@ public final class ToolUtil {
}
break;
- case VAR_TAG_START_CHAR1 :
+ case VariableUtil.VAR_TAG_START_CHAR1 :
buffer.append(ch);
if (!inVar && start < end) {
- if (arguments.charAt(start) == VAR_TAG_START_CHAR2) {
- buffer.append(VAR_TAG_START_CHAR2);
+ if (arguments.charAt(start) == VariableUtil.VAR_TAG_START_CHAR2) {
+ buffer.append(VariableUtil.VAR_TAG_START_CHAR2);
inVar = true;
start++;
}
}
break;
- case VAR_TAG_END_CHAR1 :
+ case VariableUtil.VAR_TAG_END_CHAR1 :
buffer.append(ch);
inVar = false;
break;
@@ -457,44 +376,4 @@ public final class ToolUtil {
return results;
}
-
- /**
- * Structure to represent a variable definition within a
- * source string.
- */
- public static final class VariableDefinition {
- /**
- * Index in the source text where the variable started
- * or <code>-1</code> if no valid variable start tag
- * identifier found.
- */
- public int start = -1;
-
- /**
- * Index in the source text of the character following
- * the end of the variable or <code>-1</code> if no
- * valid variable end tag found.
- */
- public int end = -1;
-
- /**
- * The variable's name found in the source text, or
- * <code>null</code> if no valid variable found.
- */
- public String name = null;
-
- /**
- * The variable's argument found in the source text, or
- * <code>null</code> if no valid variable found or if
- * the variable did not specify an argument
- */
- public String argument = null;
-
- /**
- * Create an initialized variable definition.
- */
- private VariableDefinition() {
- super();
- }
- }
} \ No newline at end of file
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/VariableContextManager.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/VariableContextManager.java
deleted file mode 100644
index 6b55c65e8..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/VariableContextManager.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.model;
-
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.ISelectionService;
-import org.eclipse.ui.IWindowListener;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.externaltools.internal.variable.ExpandVariableContext;
-
-/**
- * Maintains the context used to expand variables. The context is based on
- * the selected resource, unless a build is in progress - in which case
- * the context is based on the project being built..
- */
-public class VariableContextManager implements IWindowListener, ISelectionListener {
-
- // singleton
- private static VariableContextManager fgDefault;
-
- private IResource fSelectedResource = null;
-
- private boolean fBuilding = false;
- private IProject fProject = null;
- private int fKind;
-
- private VariableContextManager() {
- IWorkbench workbench = PlatformUI.getWorkbench();
- if (workbench != null) { //may be running headless
- workbench.addWindowListener(this);
- IWorkbenchWindow activeWindow = workbench.getActiveWorkbenchWindow();
- if (activeWindow != null) {
- windowActivated(activeWindow);
- }
- }
- }
-
- /**
- * Returns the singleton resource selection manager
- *
- * @return VariableContextManager
- */
- public static VariableContextManager getDefault() {
- if (fgDefault == null) {
- fgDefault = new VariableContextManager();
- }
- return fgDefault;
- }
-
- /**
- * @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowActivated(IWorkbenchWindow window) {
- fSelectedResource = null;
- ISelectionService service = window.getSelectionService();
- service.addSelectionListener(this);
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IWorkbenchPart part = page.getActivePart();
- if (part != null) {
- ISelection selection = service.getSelection();
- if (selection != null) {
- selectionChanged(part, selection);
- }
- }
- }
- }
-
- /**
- * @see org.eclipse.ui.IWindowListener#windowClosed(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowClosed(IWorkbenchWindow window) {
- window.getSelectionService().removeSelectionListener(this);
- }
-
- /**
- * @see org.eclipse.ui.IWindowListener#windowDeactivated(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowDeactivated(IWorkbenchWindow window) {
- window.getSelectionService().removeSelectionListener(this);
- }
-
- /**
- * @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowOpened(IWorkbenchWindow window) {
- }
-
- /**
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- IResource selectedResource = null;
- if (selection instanceof IStructuredSelection) {
- Object result = ((IStructuredSelection)selection).getFirstElement();
- if (result instanceof IResource) {
- selectedResource = (IResource) result;
- } else if (result instanceof IAdaptable) {
- selectedResource = (IResource)((IAdaptable) result).getAdapter(IResource.class);
- }
- }
-
- if (selectedResource == null) {
- // If the active part is an editor, get the file resource used as input.
- if (part instanceof IEditorPart) {
- IEditorPart editorPart = (IEditorPart) part;
- IEditorInput input = editorPart.getEditorInput();
- selectedResource = (IResource) input.getAdapter(IResource.class);
- }
- }
-
- if (selectedResource != null) {
- fSelectedResource = selectedResource;
- }
- }
-
- /**
- * Returns the active variable context. The context is that of the selected
- * resource, or a project being built.
- *
- * @return variable context
- */
- public ExpandVariableContext getVariableContext() {
- if (fBuilding) {
- return new ExpandVariableContext(fProject, fKind);
- } else {
- return new ExpandVariableContext(fSelectedResource);
- }
- }
-
- /**
- * Notification that the given project is being built.
- *
- * @param project
- * @param kind
- * @see ExternalToolBuilder#build(int, Map, IProgressMonitor)
- */
- public void buildStarted(IProject project, int kind) {
- fBuilding = true;
- fProject = project;
- fKind = kind;
- }
-
- /**
- * Notification the building the current project has completed.
- * @see ExternalToolBuilder#build(int, Map, IProgressMonitor)
- */
- public void buildEnded() {
- fBuilding = false;
- fProject= null;
- }
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/ExternalToolMigration.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/ExternalToolMigration.java
index 57a94326c..8f0918cf5 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/ExternalToolMigration.java
+++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/ExternalToolMigration.java
@@ -20,8 +20,9 @@ import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.ui.variables.IVariableConstants;
+import org.eclipse.debug.ui.variables.VariableUtil;
import org.eclipse.ui.externaltools.internal.model.IExternalToolConstants;
-import org.eclipse.ui.externaltools.internal.model.ToolUtil;
/**
* Responsible reading an old external tool format and creating
@@ -171,9 +172,9 @@ public final class ExternalToolMigration {
// Update the location...
String location = (String) args.get(TAG_TOOL_LOCATION);
if (location != null) {
- ToolUtil.VariableDefinition varDef = ToolUtil.extractVariableTag(location, 0);
- if (IExternalToolConstants.VAR_WORKSPACE_LOC.equals(varDef.name)) {
- location = ToolUtil.buildVariableTag(IExternalToolConstants.VAR_RESOURCE_LOC, varDef.argument);
+ VariableUtil.VariableDefinition varDef = VariableUtil.extractVariableTag(location, 0);
+ if (IVariableConstants.VAR_WORKSPACE_LOC.equals(varDef.name)) {
+ location = VariableUtil.buildVariableTag(IVariableConstants.VAR_RESOURCE_LOC, varDef.argument);
}
config.setAttribute(IExternalToolConstants.ATTR_LOCATION, location);
}
@@ -181,7 +182,7 @@ public final class ExternalToolMigration {
// Update the refresh scope...
String refresh = (String) args.get(TAG_TOOL_REFRESH);
if (refresh != null) {
- ToolUtil.VariableDefinition varDef = ToolUtil.extractVariableTag(refresh, 0);
+ VariableUtil.VariableDefinition varDef = VariableUtil.extractVariableTag(refresh, 0);
if ("none".equals(varDef.name)) { //$NON-NLS-1$
refresh = null;
}
@@ -195,7 +196,7 @@ public final class ExternalToolMigration {
int start = 0;
ArrayList targets = new ArrayList();
StringBuffer buffer = new StringBuffer();
- ToolUtil.VariableDefinition varDef = ToolUtil.extractVariableTag(arguments, start);
+ VariableUtil.VariableDefinition varDef = VariableUtil.extractVariableTag(arguments, start);
while (varDef.end != -1) {
if ("ant_target".equals(varDef.name) && varDef.argument != null) { //$NON-NLS-1$
targets.add(varDef.argument);
@@ -204,7 +205,7 @@ public final class ExternalToolMigration {
buffer.append(arguments.substring(start, varDef.end));
}
start = varDef.end;
- varDef = ToolUtil.extractVariableTag(arguments, start);
+ varDef = VariableUtil.extractVariableTag(arguments, start);
}
buffer.append(arguments.substring(start, arguments.length()));
arguments = buffer.toString();
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/ExternalToolVariable.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/ExternalToolVariable.java
deleted file mode 100644
index 6676b0d7e..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/ExternalToolVariable.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.registry;
-
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jface.resource.JFaceColors;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.externaltools.internal.group.IGroupDialogPage;
-import org.eclipse.ui.externaltools.internal.model.ExternalToolsModelMessages;
-import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin;
-import org.eclipse.ui.externaltools.internal.variable.*;
-import org.eclipse.ui.externaltools.internal.variable.DefaultVariableExpander;
-import org.eclipse.ui.externaltools.internal.variable.IVariableComponent;
-import org.eclipse.ui.externaltools.internal.variable.IVariableExpander;
-
-/**
- * Abtract representation of the different variables.
- */
-public class ExternalToolVariable {
- private static final IVariableComponent defaultComponent = new DefaultVariableComponent(false);
-
- private String tag;
- private String description;
- private IConfigurationElement element;
- private IVariableExpander expander;
-
- /**
- * Creates an variable definition
- *
- * @param tag the variable tag
- * @param description a short description of what the variable will expand to
- * @param element the configuration element
- */
- /*package*/ ExternalToolVariable(String tag, String description, IConfigurationElement element) {
- super();
- this.tag = tag;
- this.description = description;
- this.element = element;
- }
-
- /**
- * Returns the object that can expand the variable
- */
- public IVariableExpander getExpander() {
- if (expander == null) {
- try {
- expander = (IVariableExpander) createObject(ExternalToolVariableRegistry.TAG_EXPANDER_CLASS);
- } catch (ClassCastException exception) {
- }
- if (expander == null) {
- return DefaultVariableExpander.getDefault();
- }
- }
- return expander;
- }
-
- /**
- * Creates an instance of the class specified by
- * the given element attribute name. Can return
- * <code>null</code> if none or if problems creating
- * the instance.
- */
- protected final Object createObject(String attributeName) {
- try {
- return element.createExecutableExtension(attributeName);
- } catch (CoreException e) {
- ExternalToolsPlugin.getDefault().getLog().log(e.getStatus());
- return null;
- }
- }
-
- /**
- * Returns the component class to allow
- * visual editing of the variable's value.
- */
- public final IVariableComponent getComponent() {
- String className = element.getAttribute(ExternalToolVariableRegistry.TAG_COMPONENT_CLASS);
- if (className == null || className.trim().length() == 0)
- return defaultComponent;
-
- Object component = createObject(ExternalToolVariableRegistry.TAG_COMPONENT_CLASS);
- if (component == null)
- return new DefaultVariableComponent(true);
- else
- return (IVariableComponent)component;
- }
-
- /**
- * Returns the variable's description
- */
- public final String getDescription() {
- return description;
- }
-
- /**
- * Returns the variable's tag
- */
- public final String getTag() {
- return tag;
- }
-
-
- /**
- * Default variable component implementation which does not
- * allow variable value editing visually.
- */
- private static final class DefaultVariableComponent extends AbstractVariableComponent {
- private boolean showError = false;
- private Label message = null;
-
- public DefaultVariableComponent(boolean showError) {
- super();
- this.showError = showError;
- }
-
- /* (non-Javadoc)
- * Method declared on IVariableComponent.
- */
- public Control getControl() {
- return message;
- }
-
- /* (non-Javadoc)
- * Method declared on IVariableComponent.
- */
- public void createContents(Composite parent, String varTag, IGroupDialogPage page) {
- if (showError) {
- message = new Label(parent, SWT.NONE);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- message.setLayoutData(data);
- message.setFont(parent.getFont());
- message.setText(ExternalToolsModelMessages.getString("ExternalToolVariable.componentErrorMessage")); //$NON-NLS-1$
- message.setForeground(JFaceColors.getErrorText(message.getDisplay()));
- }
- }
- }
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/ExternalToolVariableRegistry.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/ExternalToolVariableRegistry.java
deleted file mode 100644
index 9369736a4..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/ExternalToolVariableRegistry.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.registry;
-
-
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin;
-import org.eclipse.ui.externaltools.internal.model.IExternalToolConstants;
-
-/**
- * General registry reader for external tool variables.
- */
-public class ExternalToolVariableRegistry {
- // Format of the variable extension points
- // <extension point="org.eclipse.ui.externalTools.***Variables>
- // <variable
- // tag={string}
- // description={string}
- // componentClass={string:IVariableComponent}
- // expanderClass={string:IVariable***Expander}>
- // </variable>
- // </extension>
- //
-
- /**
- * Element and attribute tags of a variable extension.
- */
- /*package*/ static final String TAG_VARIABLE = "variable"; //$NON-NLS-1$
- /*package*/ static final String TAG_TAG = "tag"; //$NON-NLS-1$
- /*package*/ static final String TAG_DESCRIPTION = "description"; //$NON-NLS-1$
- /*package*/ static final String TAG_COMPONENT_CLASS = "componentClass"; //$NON-NLS-1$
- /*package*/ static final String TAG_EXPANDER_CLASS = "expanderClass"; //$NON-NLS-1$
-
-
- /**
- * Sorted map of variables where the key is the variable tag
- * and the value is the corresponding variable.
- */
- private SortedMap variables;
-
- /**
- * The extension point id to read the variables from
- */
- protected String extensionPointId;
-
- public ExternalToolVariableRegistry() {
- this(IExternalToolConstants.EXTENSION_POINT_TOOL_VARIABLES);
- }
-
- /**
- * Creates a new registry and loads the variables.
- */
- protected ExternalToolVariableRegistry(String extensionPointId) {
- this.extensionPointId = extensionPointId;
- loadVariables();
- }
-
- /**
- * Returns the variable for the specified tag, or
- * <code>null</code> if none found.
- */
- protected final ExternalToolVariable findVariable(String tag) {
- return (ExternalToolVariable) variables.get(tag);
- }
-
- /**
- * Returns the number of variables in the registry.
- */
- public final int getVariableCount() {
- return variables.size();
- }
-
-
- /**
- * Returns the variable for the given tag or <code>null</code> if none.
- */
- public ExternalToolVariable getVariable(String tag) {
- return findVariable(tag);
- }
-
- /**
- * Returns the list of argument variables in the registry.
- */
- public ExternalToolVariable[] getVariables() {
- ExternalToolVariable[] results = new ExternalToolVariable[getVariableCount()];
- variables.values().toArray(results);
- return results;
- }
-
- /**
- * Load the available variables
- */
- private void loadVariables() {
- variables = new TreeMap();
- IPluginRegistry registry = Platform.getPluginRegistry();
- IExtensionPoint point = registry.getExtensionPoint(IExternalToolConstants.PLUGIN_ID, extensionPointId);
- if (point != null) {
- IExtension[] extensions = point.getExtensions();
- for (int i = 0; i < extensions.length; i++) {
- IConfigurationElement[] elements = extensions[i].getConfigurationElements();
- for (int j = 0; j < elements.length; j++) {
- IConfigurationElement element = elements[j];
- if (element.getName().equals(TAG_VARIABLE)) {
- String tag = element.getAttribute(TAG_TAG);
- String description = element.getAttribute(TAG_DESCRIPTION);
- String className = element.getAttribute(TAG_EXPANDER_CLASS);
-
- boolean valid = true;
- if (tag == null || tag.length() == 0) {
- valid = false;
- ExternalToolsPlugin.getDefault().log("Missing tag attribute value for variable element.", null); //$NON-NLS-1$
- }
- if (description == null || description.length() == 0) {
- valid = false;
- ExternalToolsPlugin.getDefault().log("Missing description attribute value for variable element.", null); //$NON-NLS-1$
- }
- if (className == null || className.length() == 0) {
- valid = false;
- ExternalToolsPlugin.getDefault().log("Missing expander class attribute value for variable element.", null); //$NON-NLS-1$
- }
-
- if (valid)
- variables.put(tag, newVariable(tag, description, element));
- }
- }
- }
- }
- }
-
- /**
- * Creates a new variable from the specified information.
- */
- protected ExternalToolVariable newVariable(String tag, String description, IConfigurationElement element) {
- return new ExternalToolVariable(tag, description, element);
- }
-
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/AbstractVariableComponent.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/AbstractVariableComponent.java
deleted file mode 100644
index 633832031..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/AbstractVariableComponent.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.externaltools.internal.group.IGroupDialogPage;
-import org.eclipse.ui.externaltools.internal.model.ToolUtil;
-
-/**
- * The AbstractVariableComponent provides the base implementation of an
- * IVariableComponent
- */
-public abstract class AbstractVariableComponent implements IVariableComponent {
-
- protected Group mainGroup;
- protected IGroupDialogPage dialogPage;
- private boolean isValid = true;
-
- /**
- * @see IVariableComponent#getControl()
- */
- public Control getControl() {
- return null;
- }
-
- /**
- * Returns the dialog page this component is part of
- */
- protected IGroupDialogPage getPage() {
- return dialogPage;
- }
-
- /**
- * @see IVariableComponent#createContents(Composite, String, IGroupDialogPage)
- */
- public void createContents(Composite parent, String varTag, IGroupDialogPage page) {
- dialogPage= page;
-
- // main composite
- mainGroup = new Group(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- GridData gridData = new GridData(GridData.FILL_BOTH);
- mainGroup.setLayout(layout);
- mainGroup.setLayoutData(gridData);
- mainGroup.setFont(parent.getFont());
- mainGroup.setText(ToolUtil.buildVariableTag(varTag, null));
- }
-
- /**
- * @see IVariableComponent#getVariableValue()
- */
- public String getVariableValue() {
- return null;
- }
-
- /**
- * @see IVariableComponent#isValid()
- */
- public boolean isValid() {
- return isValid;
- }
-
- /**
- * Sets whether the component's values are all valid.
- * Updates the components's page valid state. No action
- * taken if new valid state same as current one.
- *
- * @param isValid <code>true</code> if all values valid,
- * <code>false</code> otherwise
- */
- protected void setIsValid(boolean isValid) {
- if (isValid() != isValid) {
- this.isValid= isValid;
- this.dialogPage.updateValidState();
- }
- }
-
- /**
- * @see IVariableComponent#setVariableValue(String)
- */
- public void setVariableValue(String varValue) {
- }
-
- /**
- * @see IVariableComponent#validate()
- */
- public void validate() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.externaltools.internal.variable.IVariableComponent#dispose()
- */
- public void dispose() {
- //by default do nothing
- }
-} \ No newline at end of file
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ContainerExpander.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ContainerExpander.java
deleted file mode 100644
index c017c0f4f..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ContainerExpander.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-
-import org.eclipse.core.resources.IResource;
-
-/**
- * Expands a resource's container type variable into the desired
- * result format.
- * <p>
- * This class is not intended to be extended by clients.
- * </p>
- */
-public class ContainerExpander extends ResourceExpander {
-
- /**
- * Create an instance
- */
- public ContainerExpander() {
- super();
- }
-
- /* (non-Javadoc)
- * Method declared on ResourceExpander.
- */
- /*package*/ IResource expand(String varValue, ExpandVariableContext context) {
- IResource resource = super.expand(varValue, context);
- if (resource != null) {
- return resource.getParent();
- }
- return null;
- }
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ContainerNameExpander.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ContainerNameExpander.java
deleted file mode 100644
index 96e7930d1..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ContainerNameExpander.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * Extracts the container name from a variable context
- */
-public class ContainerNameExpander extends DefaultVariableExpander {
-
- /**
- * @see IVariableTextExpander#getText(String, String, ExpandVariableContext)
- */
- public String getText(String varTag, String varValue, ExpandVariableContext context) throws CoreException {
- IResource resource= context.getSelectedResource();
- if (resource != null) {
- IContainer parent= resource.getParent();
- if (parent != null) {
- return parent.getName();
- }
- throwExpansionException(varTag, ExternalToolsVariableMessages.getString("ContainerNameExpander.No_container")); //$NON-NLS-1$
- }
- throwExpansionException(varTag, ExternalToolsVariableMessages.getString("ContainerNameExpander.No_resource")); //$NON-NLS-1$
- return null;
- }
-
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/DefaultVariableExpander.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/DefaultVariableExpander.java
deleted file mode 100644
index 17f89b6c9..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/DefaultVariableExpander.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin;
-
-public class DefaultVariableExpander implements IVariableExpander {
-
- private static DefaultVariableExpander instance;
-
- public static DefaultVariableExpander getDefault() {
- if (instance == null) {
- instance= new DefaultVariableExpander();
- }
- return instance;
- }
-
- public IPath getPath(String varTag, String varValue, ExpandVariableContext context) throws CoreException {
- throwExpansionException(varTag, MessageFormat.format(ExternalToolsVariableMessages.getString("DefaultVariableExpander.No_expander"), new String[] {varTag})); //$NON-NLS-1$
- return null;
- }
-
- public IResource[] getResources(String varTag, String varValue, ExpandVariableContext context) throws CoreException {
- throwExpansionException(varTag, MessageFormat.format(ExternalToolsVariableMessages.getString("DefaultVariableExpander.No_expander"), new String[] {varTag})); //$NON-NLS-1$
- return null;
- }
-
- public String getText(String varTag, String varValue, ExpandVariableContext context) throws CoreException {
- throwExpansionException(varTag, MessageFormat.format(ExternalToolsVariableMessages.getString("DefaultVariableExpander.No_expander"), new String[] {varTag})); //$NON-NLS-1$
- return null;
- }
-
- /**
- * Utility method which throws an exception that occurred for the given reason
- * while expanding the given variable tag.
- */
- public static void throwExpansionException(String varTag, String reason) throws CoreException {
- throw new CoreException(ExternalToolsPlugin.newErrorStatus(MessageFormat.format(ExternalToolsVariableMessages.getString("DefaultVariableExpander.Error"), new String[] {varTag, reason}), null)); //$NON-NLS-1$
- }
-
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ExpandVariableContext.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ExpandVariableContext.java
deleted file mode 100644
index 932c9a2d0..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ExpandVariableContext.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.ui.externaltools.internal.model.IExternalToolConstants;
-
-/**
- * Represents the context the external tool is running in
- * that a variable uses to expand itself.
- */
-public final class ExpandVariableContext {
- public static final ExpandVariableContext EMPTY_CONTEXT = new ExpandVariableContext(null);
-
- private IProject project = null;
- private IResource selectedResource = null;
- private String buildType = IExternalToolConstants.BUILD_TYPE_NONE;
-
- /**
- * Create a context for an external tool running
- * as a builder on the given project.
- *
- * @param project the <code>IProject</code> being built.
- * @param buildKind the kind of build being performed
- * (see <code>IncrementalProjectBuilder</code>).
- */
- public ExpandVariableContext(IProject project, int buildKind) {
- super();
- this.project = project;
- switch (buildKind) {
- case IncrementalProjectBuilder.INCREMENTAL_BUILD :
- this.buildType = IExternalToolConstants.BUILD_TYPE_INCREMENTAL;
- break;
- case IncrementalProjectBuilder.FULL_BUILD :
- this.buildType = IExternalToolConstants.BUILD_TYPE_FULL;
- break;
- case IncrementalProjectBuilder.AUTO_BUILD :
- this.buildType = IExternalToolConstants.BUILD_TYPE_AUTO;
- break;
- default :
- this.buildType = IExternalToolConstants.BUILD_TYPE_NONE;
- break;
- }
- }
-
- /**
- * Create a context for an external tool running
- * with the given resource selected.
- *
- * @param selectedResource the <code>IResource</code> selected
- * or <code>null</code> if none.
- */
- public ExpandVariableContext(IResource selectedResource) {
- super();
- if (selectedResource != null) {
- this.selectedResource = selectedResource;
- this.project = selectedResource.getProject();
- }
- }
-
- /**
- * Returns the build type being performed if the
- * external tool is being run as a project builder.
- *
- * @return one of the <code>IExternalToolConstants.BUILD_TYPE_*</code> constants.
- */
- public String getBuildType() {
- return buildType;
- }
-
- /**
- * Returns the project which the variable can use. This
- * will the the project being built if the tool is being
- * run as a builder. Otherwise, it is the project of the
- * selected resource, or <code>null</code> if none.
- *
- * @return the <code>IProject</code> or <code>null</code> if none
- */
- public IProject getProject() {
- return project;
- }
-
- /**
- * Returns the resource selected at the time the tool
- * is run, or <code>null</code> if none selected.
- *
- * @return the <code>IResource</code> selected, or <code>null</code> if none
- */
- public IResource getSelectedResource() {
- return selectedResource;
- }
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ExternalToolsVariableMessages.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ExternalToolsVariableMessages.java
deleted file mode 100644
index ced0bf0cc..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ExternalToolsVariableMessages.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class ExternalToolsVariableMessages {
-
- private static final String BUNDLE_NAME = "org.eclipse.ui.externaltools.internal.variable.ExternalToolsVariableMessages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE =
- ResourceBundle.getBundle(BUNDLE_NAME);
-
- private ExternalToolsVariableMessages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ExternalToolsVariableMessages.properties b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ExternalToolsVariableMessages.properties
deleted file mode 100644
index 90b28288d..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ExternalToolsVariableMessages.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2003 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-ResourceComponent.selectedResLabel = Use &selected resource
-ResourceComponent.specificResLabel = Us&e specific resource:
-ResourceComponent.selectionRequired = A specific resource must be selected from the list.
-WorkingSetComponent.Must_Select=A specific working set must be selected from the list.
-ContainerNameExpander.No_container=No container could be determined for the selected resource.
-ContainerNameExpander.No_resource=No resource selected.
-DefaultVariableExpander.No_expander=No expander class defined for the variable {0}
-DefaultVariableExpander.Error=An error occurred attempting to expand the variable {0}. {1}
-ProjectNameExpander.No_resource=No resource selected.
-ResourceExpander.No_resource=No resource selected.
-ResourceNameExpander.No_resource=No resource selected.
-WorkingSetExpander.No_working_set=No working set specified.
-WorkingSetExpander.No_working_set_found=No working set found with the name {0}.
-StringPromptExpander.Variable_input_1=Variable input
-PromptExpanderBase.Please_input_a_value_for_{0}_1=Please input a value for {0}
-PromptExpanderBase.Please_input_a_value_2=Please input a value
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/FilePromptExpander.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/FilePromptExpander.java
deleted file mode 100644
index 0b07d5ab9..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/FilePromptExpander.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 Matt Conway and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Matt Conway - initial implementation
- * IBM Corporation - integration and code cleanup
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin;
-
-/**
- * Prompts the user to choose a file and expands the selection
- */
-public class FilePromptExpander extends PromptExpanderBase {
- public FilePromptExpander() {
- super();
- }
-
- /**
- * Prompts the user to choose a file
- * @see PromptExpanderBase#prompt()
- */
- public void prompt() {
- FileDialog dialog = new FileDialog(ExternalToolsPlugin.getStandardDisplay().getActiveShell());
- dialog.setText(dialogMessage);
- dialog.setFileName(lastValue == null ? defaultValue : lastValue);
- dialogResultString = dialog.open();
- }
-
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/FolderPromptExpander.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/FolderPromptExpander.java
deleted file mode 100644
index af564b5e1..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/FolderPromptExpander.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 Matt Conway and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Matt Conway - initial implementation
- * IBM Corporation - integration and code cleanup
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin;
-
-/**
- * Prompts the user to choose a folder and expands the selection
- */
-public class FolderPromptExpander extends PromptExpanderBase {
-
- public FolderPromptExpander() {
- super();
- }
-
- /**
- * Prompts the user to choose a folder.
- * @see PromptExpanderBase#prompt()
- */
- public void prompt() {
- DirectoryDialog dialog = new DirectoryDialog(ExternalToolsPlugin.getStandardDisplay().getActiveShell());
- dialog.setText(dialogMessage);
- dialog.setFilterPath(lastValue == null ? defaultValue : lastValue);
- dialogResultString = dialog.open();
- }
-
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/IVariableComponent.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/IVariableComponent.java
deleted file mode 100644
index 17a0ee8f7..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/IVariableComponent.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.externaltools.internal.group.IGroupDialogPage;
-
-/**
- * Represents the API for a client extending one of the
- * variable extension points to provide visual editing
- * of the variable.
- * <p>
- * This interface is not to be extended by clients. Clients
- * may implement this interface.
- * </p>
- */
-public interface IVariableComponent {
- /**
- * Returns the control to edit the variable
- * value, otherwise <code>null</code> if no editing
- * supported or if <code>createContents</code> has
- * not been called yet
- *
- * @return the main control for the variable component
- * or <code>null</code> if none
- */
- public Control getControl();
-
- /**
- * Creates the control to edit the variable. Does nothing
- * if no editing supported.
- *
- * @param parent the composite to parent all controls to
- * @param varTag the variable tag name to create the controls for
- * @param page the dialog page this visual component will be part of
- */
- public void createContents(Composite parent, String varTag, IGroupDialogPage page);
-
- /**
- * Returns the variable value as specified by
- * the user thru the visual component.
- *
- * @return the variable value as indicated by the visual component
- */
- public String getVariableValue();
-
- /**
- * Returns whether the variable's visual component has an
- * acceptable value.
- *
- * @return <code>true</code> if all value acceptable, or <code>false</code> otherwise
- */
- public boolean isValid();
-
- /**
- * Sets the visual component to represent the
- * given variable value.
- *
- * @param varValue the variable value the visual component should indicate
- */
- public void setVariableValue(String varValue);
-
- /**
- * Validates visual component current values entered by the
- * user and updates it's valid state if needed
- */
- public void validate();
-
- /**
- * Notifies this variable component that it has
- * been disposed. Marks the end of this component's lifecycle,
- * allowing this component to perform any cleanup required.
- */
- public void dispose();
-} \ No newline at end of file
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/IVariableExpander.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/IVariableExpander.java
deleted file mode 100644
index c694acaac..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/IVariableExpander.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-
-public interface IVariableExpander {
- /**
- * Returns the path location to a file or directory
- * for the given variable tag and value. The path does
- * not need to exist.
- *
- * @param varTag the variable tag name
- * @param varValue the value for the variable
- * @param context the context the variable should use to expand itself
- * @return the <code>IPath</code> to a file/directory
- * @throws CoreException if the given variable could not be expanded
- */
- public IPath getPath(String varTag, String varValue, ExpandVariableContext context) throws CoreException;
- /**
- * Returns the <code>IResource</code> list
- * for the given variable tag and value.
- *
- * @param varTag the variable tag name
- * @param varValue the value for the variable
- * @param context the context the variable should use to expand itself
- * @return the list of <code>IResource</code> or <code>null</code> if not
- * @throws CoreException if the given variable could not be expanded
- */
- public IResource[] getResources(String varTag, String varValue, ExpandVariableContext context) throws CoreException;
- /**
- * Returns the expanded text for the given variable
- * tag and value.
- *
- * @param varTag the variable tag name
- * @param varValue the value for the variable
- * @param context the context the variable should use to expand itself
- * @return the text of the expanded variable
- * @throws CoreException if the given variable could not be expanded
- */
- public String getText(String varTag, String varValue, ExpandVariableContext context) throws CoreException;
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ProjectExpander.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ProjectExpander.java
deleted file mode 100644
index ab7efee43..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ProjectExpander.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-
-import org.eclipse.core.resources.IResource;
-
-/**
- * Expands a resource's project type variable into the desired
- * result format.
- * <p>
- * This class is not intended to be extended by clients.
- * </p>
- */
-public class ProjectExpander extends ResourceExpander {
-
- /**
- * Create an instance
- */
- public ProjectExpander() {
- super();
- }
-
- /* (non-Javadoc)
- * Method declared on ResourceExpander.
- */
- /*package*/ IResource expandUsingContext(ExpandVariableContext context) {
- return context.getProject();
- }
-
- /* (non-Javadoc)
- * Method declared on ResourceExpander.
- */
- /*package*/ IResource expandToMember(String varValue) {
- IResource member = super.expandToMember(varValue);
- if (member != null) {
- return member.getProject();
- }
- return null;
- }
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ProjectNameExpander.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ProjectNameExpander.java
deleted file mode 100644
index 8b68a872b..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ProjectNameExpander.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * Extracts the project name from a variable context
- */
-public class ProjectNameExpander extends DefaultVariableExpander {
-
- /**
- * Returns the name of the project in the given context or
- * <code>null</code> if there is no project in the context.
- */
- public String getText(String varTag, String varValue, ExpandVariableContext context) throws CoreException {
- IProject project= context.getProject();
- if (project != null) {
- return project.getName();
- }
- throwExpansionException(varTag, ExternalToolsVariableMessages.getString("ProjectNameExpander.No_resource")); //$NON-NLS-1$
- return null;
- }
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/PromptExpanderBase.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/PromptExpanderBase.java
deleted file mode 100644
index cc130378e..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/PromptExpanderBase.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 Matt Conway and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Matt Conway - initial implementation
- * IBM Corporation - integration and code cleanup
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin;
-
-/**
- * Base implementation for variable expanders that prompt the user
- * for their value.
- */
-abstract class PromptExpanderBase extends DefaultVariableExpander {
-
- /**
- * A hint that helps the user choose their input. If a prompt
- * hint is provider the user will be prompted:
- * Please input a value for <code>promptHint</code>
- */
- protected String promptHint = null;
- /**
- * The prompt displayed to the user.
- */
- protected String dialogMessage = null;
- /**
- * The default value selected when the prompt is displayed
- */
- protected String defaultValue = null;
- /**
- * The last value chosen by the user for this variable
- */
- protected String lastValue = null;
- /**
- * The result returned from the prompt dialog
- */
- protected String dialogResultString = null;
-
- /**
- * Prompts the user for input and returns a string representation of
- * the user's selection.
- */
- public String getText(String varTag, String varValue, ExpandVariableContext context) throws CoreException {
- String varText = null;
- setupDialog(varValue);
-
- ExternalToolsPlugin.getStandardDisplay().syncExec(new Runnable() {
- public void run() {
- prompt();
- }
- });
- if (dialogResultString != null) {
- varText = dialogResultString;
- lastValue = dialogResultString;
- }
- return varText;
- }
-
- /**
- * Presents the user with the appropriate prompt for the variable to be expanded
- * and sets the <code>dialogResultString</code> based on the user's selection.
- */
- public abstract void prompt();
-
- /**
- * Initializes values displayed when the user is prompted. If
- * a prompt hint and default value are supplied in the given
- * variable value, these are extracted for presentation
- *
- * @param varValue the value of the variable from which the prompt
- * hint and default value will be extracted
- */
- private void setupDialog(String varValue) {
- promptHint = null;
- defaultValue = null;
- dialogResultString = null;
- if (varValue != null) {
- int idx = varValue.indexOf(':');
- if (idx != -1) {
- promptHint = varValue.substring(0, idx);
- defaultValue = varValue.substring(idx + 1);
- } else {
- promptHint = varValue;
- }
- }
-
- if (promptHint != null) {
- dialogMessage = MessageFormat.format(ExternalToolsVariableMessages.getString("PromptExpanderBase.Please_input_a_value_for_{0}_1"), new String[] {promptHint}); //$NON-NLS-1$
- } else {
- dialogMessage = ExternalToolsVariableMessages.getString("PromptExpanderBase.Please_input_a_value_2"); //$NON-NLS-1$
- }
- }
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ResourceComponent.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ResourceComponent.java
deleted file mode 100644
index 6240cfd0b..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ResourceComponent.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.externaltools.internal.group.IGroupDialogPage;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-/**
- * Visual component to edit the resource type variable
- * value.
- * <p>
- * This class is not intended to be extended by clients.
- * </p>
- */
-public class ResourceComponent extends AbstractVariableComponent {
- protected Button selectedResourceButton;
- protected Button specificResourceButton;
- protected TreeViewer resourceList;
- private IResource selectedResource;
- private boolean selectedResourceVariable= true;
-
- /**
- * Creates the component
- */
- public ResourceComponent() {
- super();
- }
-
- /* (non-Javadoc)
- * Method declared on IVariableComponent.
- */
- public void createContents(Composite parent, String varTag, IGroupDialogPage page) {
- super.createContents(parent, varTag, page); // Creates the main group and sets the page
-
- createSelectedResourceOption();
- createSpecificResourceOption();
- createResourceList();
-
- updateResourceListEnablement();
- }
-
- /**
- * Creates the list of resources.
- */
- protected void createResourceList() {
- Tree tree = new Tree(mainGroup, SWT.SINGLE | SWT.BORDER);
- GridData data = new GridData(GridData.FILL_BOTH);
- data.heightHint = tree.getItemHeight() * 8;
- tree.setLayoutData(data);
- tree.setFont(mainGroup.getFont());
-
- resourceList = new TreeViewer(tree);
- resourceList.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- selectedResource= (IResource) ((IStructuredSelection)event.getSelection()).getFirstElement();
- validate();
- }
- });
- resourceList.setContentProvider(new WorkbenchContentProvider());
- resourceList.setLabelProvider(new WorkbenchLabelProvider());
- resourceList.setInput(ResourcesPlugin.getWorkspace().getRoot());
- }
-
- /**
- * Creates the option button for using the selected
- * resource.
- */
- private void createSelectedResourceOption() {
- selectedResourceButton = new Button(mainGroup, SWT.RADIO);
- selectedResourceButton.setText(ExternalToolsVariableMessages.getString("ResourceComponent.selectedResLabel")); //$NON-NLS-1$
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- selectedResourceButton.setLayoutData(data);
- selectedResourceButton.setFont(mainGroup.getFont());
- selectedResourceButton.setSelection(true);
- }
-
- /**
- * Creates the option button for using a specific
- * resource.
- */
- private void createSpecificResourceOption() {
- specificResourceButton = new Button(mainGroup, SWT.RADIO);
- specificResourceButton.setText(ExternalToolsVariableMessages.getString("ResourceComponent.specificResLabel")); //$NON-NLS-1$
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- specificResourceButton.setLayoutData(data);
- specificResourceButton.setFont(mainGroup.getFont());
- specificResourceButton.setSelection(false);
-
- specificResourceButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateResourceListEnablement();
- getPage().updateValidState();
- selectedResourceVariable= !specificResourceButton.getSelection();
- }
- });
- }
-
- /* (non-Javadoc)
- * Method declared on IVariableComponent.
- */
- public Control getControl() {
- return mainGroup;
- }
-
- /* (non-Javadoc)
- * Method declared on IVariableComponent.
- */
- public String getVariableValue() {
- if (selectedResourceVariable) {
- return null;
- }
-
- if (resourceList != null) {
- if (selectedResource != null) {
- return selectedResource.getFullPath().toString();
- }
- }
-
- return null;
- }
-
- /**
- * Updates the enablement of the resource list if needed
- */
- private void updateResourceListEnablement() {
- if (specificResourceButton != null && resourceList != null) {
- Tree tree= resourceList.getTree();
- tree.setEnabled(specificResourceButton.getSelection());
- if (tree.getItemCount() > 0) {
- tree.setSelection(new TreeItem[]{tree.getItems()[0]});
- selectedResource= (IResource)tree.getSelection()[0].getData();
- }
-
- validate();
- }
- }
-
- /* (non-Javadoc)
- * Method declared on IVariableComponent.
- */
- public void setVariableValue(String varValue) {
- if (varValue == null || varValue.length() == 0) {
- if (selectedResourceButton != null) {
- selectedResourceButton.setSelection(true);
- }
- if (specificResourceButton != null) {
- specificResourceButton.setSelection(false);
- }
- if (resourceList != null) {
- resourceList.getTree().setEnabled(false);
- }
- } else {
- if (selectedResourceButton != null) {
- selectedResourceButton.setSelection(false);
- }
- if (specificResourceButton != null) {
- specificResourceButton.setSelection(true);
- }
- if (resourceList != null) {
- resourceList.getTree().setEnabled(true);
- IResource member = ResourcesPlugin.getWorkspace().getRoot().findMember(varValue);
- if (member != null) {
- resourceList.setSelection(new StructuredSelection(member), true);
- } else {
- resourceList.setSelection(StructuredSelection.EMPTY);
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * Method declared on IVariableComponent.
- */
- public void validate() {
- getPage().setErrorMessage(null);
- setIsValid(true);
- if (specificResourceButton != null && specificResourceButton.getSelection()) {
- validateResourceListSelection();
- }
- getPage().updateValidState();
- }
-
- /**
- * Validates the resource selection list. If no resource is selected, the
- * component is updated with an error message and isValid is set
- * <code>false</code>
- */
- private void validateResourceListSelection() {
- if (resourceList == null) {
- return;
- }
- if (resourceList.getSelection().isEmpty()) {
- getPage().setErrorMessage(ExternalToolsVariableMessages.getString("ResourceComponent.selectionRequired")); //$NON-NLS-1$
- setIsValid(false);
- }
- }
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ResourceExpander.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ResourceExpander.java
deleted file mode 100644
index 900918fb6..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ResourceExpander.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.ui.externaltools.internal.model.IExternalToolConstants;
-
-/**
- * Expands a resource type variable into the desired
- * result format.
- * <p>
- * This class is not intended to be extended by clients.
- * </p>
- */
-public class ResourceExpander extends DefaultVariableExpander {
-
- /**
- * Expands the variable to a resource.
- */
- /*package*/ IResource expand(String varValue, ExpandVariableContext context) {
- if (varValue != null && varValue.length() > 0) {
- return expandToMember(varValue);
- } else {
- return expandUsingContext(context);
- }
- }
-
- /**
- * Expands using the current context information.
- * By default, return the selected resource of the
- * context.
- */
- /*package*/ IResource expandUsingContext(ExpandVariableContext context) {
- return context.getSelectedResource();
- }
-
- /**
- * Expands the variable value to a resource. The value
- * will not be <code>null</code> nor empty. By default,
- * lookup the member from the workspace root.
- */
- /*package*/ IResource expandToMember(String varValue) {
- return getWorkspaceRoot().findMember(varValue);
- }
-
- /* (non-Javadoc)
- * Method declared on IVariableLocationExpander.
- */
- public IPath getPath(String varTag, String varValue, ExpandVariableContext context) throws CoreException {
- IResource resource = expand(varValue, context);
- if (resource != null) {
- if (isPathVariable(varTag)) {
- return resource.getFullPath();
- } else {
- return resource.getLocation();
- }
- }
- throwExpansionException(varTag, ExternalToolsVariableMessages.getString("ResourceExpander.No_resource")); //$NON-NLS-1$
- return null;
- }
-
- /**
- * Returns whether the given variable tag is a known path
- * variable tag. Path variable tags represent variables that
- * expand to paths relative to the workspace root.
- */
- private boolean isPathVariable(String varTag) {
- return varTag.equals(IExternalToolConstants.VAR_CONTAINER_PATH) ||
- varTag.equals(IExternalToolConstants.VAR_PROJECT_PATH) ||
- varTag.equals(IExternalToolConstants.VAR_RESOURCE_PATH);
- }
-
- /* (non-Javadoc)
- * Method declared on IVariableResourceExpander.
- */
- public IResource[] getResources(String varTag, String varValue, ExpandVariableContext context) throws CoreException {
- IResource resource = expand(varValue, context);
- if (resource != null) {
- return new IResource[] {resource};
- }
- throwExpansionException(varTag, ExternalToolsVariableMessages.getString("ResourceExpander.No_resource")); //$NON-NLS-1$
- return null;
- }
-
- /**
- * Returns the workspace root resource.
- */
- protected final IWorkspaceRoot getWorkspaceRoot() {
- return ResourcesPlugin.getWorkspace().getRoot();
- }
-
- /**
- * Returns a string representation of the path to a file or directory
- * for the given variable tag and value or <code>null</code>.
- *
- * @see IVariableTextExpander#getText(String, String, ExpandVariableContext)
- */
- public String getText(String varTag, String varValue, ExpandVariableContext context) throws CoreException {
- IPath path= getPath(varTag, varValue, context);
- if (path != null) {
- return path.toOSString();
- }
- throwExpansionException(varTag, ExternalToolsVariableMessages.getString("ResourceExpander.No_resource")); //$NON-NLS-1$
- return null;
- }
-
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ResourceNameExpander.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ResourceNameExpander.java
deleted file mode 100644
index 649cd077d..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ResourceNameExpander.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * Extracts the resource name from a variable context
- */
-public class ResourceNameExpander extends DefaultVariableExpander {
-
- /**
- * @see IVariableTextExpander#getText(String, String, ExpandVariableContext)
- */
- public String getText(String varTag, String varValue, ExpandVariableContext context) throws CoreException {
- IResource resource= context.getSelectedResource();
- if (resource != null) {
- return resource.getName();
- }
- throwExpansionException(varTag, ExternalToolsVariableMessages.getString("ResourceNameExpander.No_resource")); //$NON-NLS-1$
- return null;
- }
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/SpecificFileResourceComponent.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/SpecificFileResourceComponent.java
deleted file mode 100644
index fb8ea82f4..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/SpecificFileResourceComponent.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Label;
-
-/**
- * Visual component to edit the resource type variable
- * value for the file location. Variable is limited to a specific
- * <code>IFile</code> resource.
- * <p>
- * This class is not intended to be extended by clients.
- * </p>
- */
-public class SpecificFileResourceComponent extends ResourceComponent {
-
- /**
- * Creates an instance
- */
- public SpecificFileResourceComponent() {
- super();
- }
-
- /* (non-Javadoc)
- * Method declared on ResourceComponent.
- */
- protected void createSelectedResourceOption() {
- // Do not present this option...
- }
-
- /* (non-Javadoc)
- * Method declared on ResourceComponent.
- */
- protected void createSpecificResourceOption() {
- Label label = new Label(mainGroup, SWT.NONE);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- label.setLayoutData(data);
- label.setFont(mainGroup.getFont());
- label.setText(ExternalToolsVariableMessages.getString("ResourceComponent.specificResLabel")); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * Method declared on ResourceComponent.
- */
- protected void validateResourceListSelection() {
- if (resourceList == null)
- return;
-
- IStructuredSelection sel = (IStructuredSelection) resourceList.getSelection();
- IResource resource = (IResource) sel.getFirstElement();
- if (resource == null || resource.getType() != IResource.FILE) {
- getPage().setErrorMessage(ExternalToolsVariableMessages.getString("ResourceComponent.selectionRequired")); //$NON-NLS-1$
- setIsValid(false);
- }
- }
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/SpecificFolderResourceComponent.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/SpecificFolderResourceComponent.java
deleted file mode 100644
index 73253822e..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/SpecificFolderResourceComponent.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Label;
-
-/**
- * Visual component to edit the resource type variable
- * value for the working directory. Variable is limited to a specific
- * <code>IContainer</code> resource.
- * <p>
- * This class is not intended to be extended by clients.
- * </p>
- */
-public class SpecificFolderResourceComponent extends ResourceComponent {
-
- /**
- * Creates an instance
- */
- public SpecificFolderResourceComponent() {
- super();
- }
-
- /* (non-Javadoc)
- * Method declared on ResourceComponent.
- */
- protected void createSelectedResourceOption() {
- // Do not present this option...
- }
-
- /* (non-Javadoc)
- * Method declared on ResourceComponent.
- */
- protected void createResourceList() {
- super.createResourceList();
- if (resourceList != null)
- resourceList.addFilter(new FileFilter());
- }
-
- /* (non-Javadoc)
- * Method declared on ResourceComponent.
- */
- protected void createSpecificResourceOption() {
- Label label = new Label(mainGroup, SWT.NONE);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- label.setLayoutData(data);
- label.setFont(mainGroup.getFont());
- label.setText(ExternalToolsVariableMessages.getString("ResourceComponent.specificResLabel")); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * Method declared on ResourceComponent.
- */
- protected void validateResourceListSelection() {
- if (resourceList == null)
- return;
-
- IStructuredSelection sel = (IStructuredSelection) resourceList.getSelection();
- IResource resource = (IResource) sel.getFirstElement();
- if (resource == null || resource.getType() == IResource.FILE) {
- getPage().setErrorMessage(ExternalToolsVariableMessages.getString("ResourceComponent.selectionRequired")); //$NON-NLS-1$
- setIsValid(false);
- }
- }
-
-
- /**
- * Filter to remove any IFile resources.
- */
- private static final class FileFilter extends ViewerFilter {
- /* (non-Javadoc)
- * Method declared on ViewerFilter.
- */
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- IResource resource = null;
- if (element instanceof IResource) {
- resource = (IResource) element;
- } else {
- if (element instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) element;
- resource = (IResource) adaptable.getAdapter(IResource.class);
- }
- }
-
- if (resource != null)
- return resource.getType() != IResource.FILE;
- else
- return false;
- }
- }
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/StringPromptExpander.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/StringPromptExpander.java
deleted file mode 100644
index 2882491b5..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/StringPromptExpander.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 Matt Conway and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Matt Conway - initial implementation
- * IBM Corporation - integration and code cleanup
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-import org.eclipse.jface.dialogs.InputDialog;
-
-/**
- * Prompts the user to input a string and expands to the value entered
- */
-public class StringPromptExpander extends PromptExpanderBase {
-
- public StringPromptExpander() {
- super();
- }
-
- /**
- * Prompts the user to input a string.
- * @see PromptExpanderBase#prompt()
- */
- public void prompt() {
- InputDialog dialog = new InputDialog(null, ExternalToolsVariableMessages.getString("StringPromptExpander.Variable_input_1"), dialogMessage, lastValue == null ? defaultValue : lastValue, null); //$NON-NLS-1$
- int dialogResult = dialog.open();
- if (dialogResult == InputDialog.OK) {
- dialogResultString = dialog.getValue();
- }
- }
-
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/WorkingSetComponent.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/WorkingSetComponent.java
deleted file mode 100644
index 275572645..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/WorkingSetComponent.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.externaltools.internal.group.IGroupDialogPage;
-
-/**
- * The working set component allows the user to choose a working set from the
- * workspace
- */
-public class WorkingSetComponent extends AbstractVariableComponent {
-
- private TableViewer viewer;
- private ILabelProvider labelProvider;
-
- /**
- * Label provider that provides labels for working sets
- */
- private static class WorkingSetLabelProvider extends LabelProvider {
- private Map icons;
-
- public WorkingSetLabelProvider() {
- icons = new Hashtable(5);
- }
-
- public void dispose() {
- Iterator iterator = icons.values().iterator();
-
- while (iterator.hasNext()) {
- Image icon = (Image) iterator.next();
- icon.dispose();
- }
- super.dispose();
- }
-
- public Image getImage(Object object) {
- if(object instanceof IWorkingSet){
- IWorkingSet workingSet = (IWorkingSet) object;
- ImageDescriptor imageDescriptor = workingSet.getImage();
-
- if (imageDescriptor == null) {
- return null;
- }
-
- Image icon = (Image) icons.get(imageDescriptor);
- if (icon == null) {
- icon = imageDescriptor.createImage();
- icons.put(imageDescriptor, icon);
- }
- return icon;
- }
- return super.getImage(object);
- }
-
- public String getText(Object element) {
- if (element instanceof IWorkingSet) {
- return ((IWorkingSet) element).getName();
- }
- return super.getText(element);
- }
- };
-
- /**
- * Content provider that provides working sets.
- */
- private static IStructuredContentProvider contentProvider = new IStructuredContentProvider() {
- public Object[] getElements(Object inputElement) {
- return PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSets();
- }
- public void dispose() {
- }
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- };
-
- /**
- * @see IVariableComponent#getControl()
- */
- public Control getControl() {
- return mainGroup;
- }
-
- /**
- * @see IVariableComponent#createContents(Composite, String, IGroupDialogPage)
- */
- public void createContents(Composite parent, String varTag, IGroupDialogPage page) {
- super.createContents(parent, varTag, page); // Creates the main group and sets the page
-
- viewer = new TableViewer(mainGroup);
- labelProvider= new WorkingSetLabelProvider();
- viewer.setLabelProvider(labelProvider);
- viewer.setContentProvider(contentProvider);
- viewer.setInput(PlatformUI.getWorkbench());
- GridData data = new GridData(GridData.FILL_BOTH);
- Table table= viewer.getTable();
- table.setLayoutData(data);
-
- if (table.getItemCount() > 0) {
- table.setSelection(new TableItem[]{table.getItems()[0]});
- }
-
- viewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- validate();
- }
- });
- }
-
- /**
- * @see IVariableComponent#getVariableValue()
- */
- public String getVariableValue() {
- IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
- Object element = selection.getFirstElement();
- if (element instanceof IWorkingSet) {
- return ((IWorkingSet) element).getName();
- }
- return null;
- }
-
- /**
- * @see IVariableComponent#setVariableValue(String)
- */
- public void setVariableValue(String varValue) {
- TableItem[] items = viewer.getTable().getItems();
- for (int i = 0; i < items.length; i++) {
- if (((IWorkingSet) items[i].getData()).getName().equals(varValue)) {
- viewer.setSelection(new StructuredSelection(items[i].getData()));
- break;
- }
- }
- }
-
- /**
- * @see IVariableComponent#validate()
- */
- public void validate() {
- boolean isValid= getVariableValue() != null;
- if (isValid) {
- getPage().setErrorMessage(null);
- } else {
- getPage().setErrorMessage(ExternalToolsVariableMessages.getString("WorkingSetComponent.Must_Select")); //$NON-NLS-1$
- }
- setIsValid(isValid);
- getPage().updateValidState();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.externaltools.internal.variable.IVariableComponent#dispose()
- */
- public void dispose() {
- labelProvider.dispose();
- }
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/WorkingSetExpander.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/WorkingSetExpander.java
deleted file mode 100644
index cc1236f78..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/WorkingSetExpander.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Expands a working set type variable into the desired
- * result format.
- * <p>
- * This class is not intended to be extended by clients.
- * </p>
- */
-public class WorkingSetExpander extends DefaultVariableExpander {
-
- /**
- * Create an instance
- */
- public WorkingSetExpander() {
- super();
- }
-
- /* (non-Javadoc)
- * Method declared on IVariableResourceExpander.
- */
- public IResource[] getResources(String varTag, String varValue, ExpandVariableContext context) throws CoreException {
- if (varValue == null || varValue.length() == 0) {
- throwExpansionException(varTag, ExternalToolsVariableMessages.getString("WorkingSetExpander.No_working_set")); //$NON-NLS-1$
- return null;
- }
-
- IWorkingSet set = PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSet(varValue);
- if (set == null) {
- throwExpansionException(varTag, MessageFormat.format(ExternalToolsVariableMessages.getString("WorkingSetExpander.No_working_set_found"), new String[] {varValue})); //$NON-NLS-1$
- return null;
- }
-
- IAdaptable[] elements = set.getElements();
- IResource[] resources = new IResource[elements.length];
- for (int i = 0; i < elements.length; i++) {
- IAdaptable adaptable = elements[i];
- if (adaptable instanceof IResource) {
- resources[i] = (IResource) adaptable;
- } else {
- resources[i] = (IResource) adaptable.getAdapter(IResource.class);
- }
- }
-
- return resources;
- }
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/WorkspaceExpander.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/WorkspaceExpander.java
deleted file mode 100644
index 7b79250d1..000000000
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/WorkspaceExpander.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
-
-import org.eclipse.core.resources.IResource;
-
-/**
- * Expands a workspace variable into the desired
- * result format.
- * <p>
- * This class is not intended to be extended by clients.
- * </p>
- */
-public class WorkspaceExpander extends ResourceExpander {
-
- /**
- * Create an instance
- */
- public WorkspaceExpander() {
- super();
- }
-
- /* (non-Javadoc)
- * Method declared on ResourceExpander.
- */
- /*package*/ IResource expandUsingContext(ExpandVariableContext context) {
- return getWorkspaceRoot();
- }
-}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/BuildTypeExpander.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildTypeExpander.java
index 31cd990c4..b514b5268 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/BuildTypeExpander.java
+++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildTypeExpander.java
@@ -8,12 +8,16 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
+package org.eclipse.ui.externaltools.internal.variables;
+
+import org.eclipse.debug.ui.variables.DefaultVariableExpander;
+import org.eclipse.debug.ui.variables.ExpandVariableContext;
+import org.eclipse.ui.externaltools.internal.model.ExternalToolBuilder;
public class BuildTypeExpander extends DefaultVariableExpander {
public String getText(String varTag, String varValue, ExpandVariableContext context) {
- return context.getBuildType();
+ return ExternalToolBuilder.getBuildType();
}
}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/RefreshScopeVariableRegistry.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/RefreshScopeVariableRegistry.java
index 409e51541..bdd6e44c3 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/RefreshScopeVariableRegistry.java
+++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/RefreshScopeVariableRegistry.java
@@ -8,9 +8,9 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.registry;
-
+package org.eclipse.ui.externaltools.internal.variables;
+import org.eclipse.debug.ui.variables.ExternalToolVariableRegistry;
import org.eclipse.ui.externaltools.internal.model.IExternalToolConstants;
/**
@@ -22,7 +22,7 @@ public class RefreshScopeVariableRegistry extends ExternalToolVariableRegistry {
* Creates the registry and loads the variables.
*/
public RefreshScopeVariableRegistry() {
- super(IExternalToolConstants.EXTENSION_POINT_REFRESH_VARIABLES);
+ super(IExternalToolConstants.PLUGIN_ID, IExternalToolConstants.EXTENSION_POINT_REFRESH_VARIABLES);
}
}
diff --git a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/BackgroundResourceRefresher.java b/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/BackgroundResourceRefresher.java
index b3c07403e..05563301e 100644
--- a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/BackgroundResourceRefresher.java
+++ b/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/BackgroundResourceRefresher.java
@@ -24,7 +24,7 @@ import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsUtil;
import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin;
-import org.eclipse.ui.externaltools.internal.variable.ExpandVariableContext;
+import org.eclipse.debug.ui.variables.ExpandVariableContext;
/**
* Refreshes resources as specified by a lanunch configuration, when
diff --git a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramLaunchDelegate.java b/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramLaunchDelegate.java
index 7ec67086e..0cbd47702 100644
--- a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramLaunchDelegate.java
+++ b/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramLaunchDelegate.java
@@ -32,7 +32,7 @@ import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsUtil;
import org.eclipse.ui.externaltools.internal.model.IExternalToolConstants;
-import org.eclipse.ui.externaltools.internal.variable.ExpandVariableContext;
+import org.eclipse.debug.ui.variables.ExpandVariableContext;
/**
* Launch delegate for a program.
diff --git a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramMainTab.java b/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramMainTab.java
index ae8c3211a..8fd1b3801 100644
--- a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramMainTab.java
+++ b/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramMainTab.java
@@ -13,11 +13,11 @@ package org.eclipse.ui.externaltools.internal.program.launchConfigurations;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.debug.ui.variables.IVariableConstants;
+import org.eclipse.debug.ui.variables.VariableUtil;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsMainTab;
-import org.eclipse.ui.externaltools.internal.model.IExternalToolConstants;
import org.eclipse.ui.externaltools.internal.model.IExternalToolsHelpContextIds;
-import org.eclipse.ui.externaltools.internal.model.ToolUtil;
import org.eclipse.ui.externaltools.internal.ui.FileSelectionDialog;
import org.eclipse.ui.help.WorkbenchHelp;
@@ -37,7 +37,7 @@ public class ProgramMainTab extends ExternalToolsMainTab {
return;
}
StringBuffer buf = new StringBuffer();
- ToolUtil.buildVariableTag(IExternalToolConstants.VAR_WORKSPACE_LOC, file.getFullPath().toString(), buf);
+ VariableUtil.buildVariableTag(IVariableConstants.VAR_WORKSPACE_LOC, file.getFullPath().toString(), buf);
String text= buf.toString();
if (text != null) {
locationField.setText(text);
diff --git a/org.eclipse.ui.externaltools/plugin.properties b/org.eclipse.ui.externaltools/plugin.properties
index ba9b7298b..775fedae5 100644
--- a/org.eclipse.ui.externaltools/plugin.properties
+++ b/org.eclipse.ui.externaltools/plugin.properties
@@ -12,9 +12,10 @@
Plugin.name = External Tools
Plugin.providerName = Eclipse.org
+build_type.description= Expands to the type of build, one of "incremental", "full", "auto", or "none".
+
ExtPoint.configurationDuplicationMaps = Launch Configuration Duplication Maps
ExtPoint.toolTypes = External Tool Types
-ExtPoint.toolVariables = External Tool Variables
ExtPoint.refreshVariables = Refresh Scope Variables
ExternalToolsLaunchGroup.label = &External Tools
ToolType.programName = Program
@@ -37,22 +38,6 @@ PreferencePage.externalToolsPreferences = External Tools
Program.externalTools = Program
-#tool variables
-workspace_loc.description= Expands to the workspace root's absolute file system path.
-project_loc.description= Expands to the absolute file system path of the selected resource's project.
-project_path.description= Expands to the full path, relative to the workspace root, of the selected resource's project.
-project_name.description= Expands to the name of the selected resource's project.
-resource_loc.description= Expands to the absolute file system path of the selected resource.
-resource_path.description= Expands to the full path, relative to the workspace root, of the selected resource.
-resource_name.description= Expands to the name of the selected resource.
-container_loc.description= Expands to the absolute file system path of the folder containing the selected resource.
-container_path.description= Expands to the full path, relative to the workspace root, of the folder containing the selected resource.
-container_name.description= Expands to the name of the folder containing selected resource.
-build_type.description= Expands to the type of build, one of "incremental", "full", "auto", or "none".
-string_prompt.description= Opens an input dialog and expands to the value entered.
-file_prompt.description= Opens a file selection dialog and expands to the value of the chosen file.
-folder_prompt.description= Opens a folder selection dialog and expands to the value of the chosen directory.
-
#refresh variables
workspace.description= Expands to the workspace root.
project.description= Expands to the project of the selected resource.
diff --git a/org.eclipse.ui.externaltools/plugin.xml b/org.eclipse.ui.externaltools/plugin.xml
index dbcfb3236..09529fab0 100644
--- a/org.eclipse.ui.externaltools/plugin.xml
+++ b/org.eclipse.ui.externaltools/plugin.xml
@@ -25,7 +25,6 @@
<!-- extension point definitions -->
<extension-point id="configurationDuplicationMaps" name="%ExtPoint.configurationDuplicationMaps"/>
- <extension-point id="toolVariables" name="%ExtPoint.toolVariables"/>
<extension-point id="refreshVariables" name="%ExtPoint.refreshVariables"/>
<!-- Extensions -->
@@ -194,108 +193,40 @@
</extension>
<!-- Variable Extensions -->
- <extension point="org.eclipse.ui.externaltools.toolVariables">
- <variable
- tag="workspace_loc"
- description="%workspace_loc.description"
- expanderClass="org.eclipse.ui.externaltools.internal.variable.WorkspaceExpander">
- </variable>
- <variable
- tag="project_loc"
- description="%project_loc.description"
- expanderClass="org.eclipse.ui.externaltools.internal.variable.ProjectExpander">
- </variable>
- <variable
- tag="project_path"
- description="%project_path.description"
- expanderClass="org.eclipse.ui.externaltools.internal.variable.ProjectExpander">
- </variable>
- <variable
- tag="project_name"
- description="%project_name.description"
- expanderClass="org.eclipse.ui.externaltools.internal.variable.ProjectNameExpander">
- </variable>
- <variable
- tag="resource_loc"
- description="%resource_loc.description"
- componentClass="org.eclipse.ui.externaltools.internal.variable.SpecificFileResourceComponent"
- expanderClass="org.eclipse.ui.externaltools.internal.variable.ResourceExpander">
- </variable>
- <variable
- tag="resource_path"
- description="%resource_path.description"
- componentClass="org.eclipse.ui.externaltools.internal.variable.SpecificFileResourceComponent"
- expanderClass="org.eclipse.ui.externaltools.internal.variable.ResourceExpander">
- </variable>
- <variable
- tag="resource_name"
- description="%resource_name.description"
- expanderClass="org.eclipse.ui.externaltools.internal.variable.ResourceNameExpander">
- </variable>
- <variable
- tag="container_loc"
- description="%container_loc.description"
- expanderClass="org.eclipse.ui.externaltools.internal.variable.ContainerExpander">
- </variable>
- <variable
- tag="container_path"
- description="%container_path.description"
- expanderClass="org.eclipse.ui.externaltools.internal.variable.ContainerExpander">
- </variable>
- <variable
- tag="container_name"
- description="%container_name.description"
- expanderClass="org.eclipse.ui.externaltools.internal.variable.ContainerNameExpander">
- </variable>
+ <extension point="org.eclipse.debug.ui.launchConfigurationVariables">
<variable
tag="build_type"
description="%build_type.description"
- expanderClass="org.eclipse.ui.externaltools.internal.variable.BuildTypeExpander">
- </variable>
- <variable
- tag="string_prompt"
- description="%string_prompt.description"
- expanderClass="org.eclipse.ui.externaltools.internal.variable.StringPromptExpander">
- </variable>
- <variable
- tag="file_prompt"
- description="%file_prompt.description"
- expanderClass="org.eclipse.ui.externaltools.internal.variable.FilePromptExpander">
- </variable>
- <variable
- tag="folder_prompt"
- description="%folder_prompt.description"
- expanderClass="org.eclipse.ui.externaltools.internal.variable.FolderPromptExpander">
+ expanderClass="org.eclipse.ui.externaltools.internal.variables.BuildTypeExpander">
</variable>
</extension>
-
<extension point="org.eclipse.ui.externaltools.refreshVariables">
<variable
tag="workspace"
description="%workspace.description"
- expanderClass="org.eclipse.ui.externaltools.internal.variable.WorkspaceExpander">
+ expanderClass="org.eclipse.debug.ui.variables.WorkspaceExpander">
</variable>
<variable
tag="project"
description="%project.description"
- expanderClass="org.eclipse.ui.externaltools.internal.variable.ProjectExpander">
+ expanderClass="org.eclipse.debug.ui.variables.ProjectExpander">
</variable>
<variable
tag="container"
description="%container.description"
- expanderClass="org.eclipse.ui.externaltools.internal.variable.ContainerExpander">
+ expanderClass="org.eclipse.debug.ui.variables.ContainerExpander">
</variable>
<variable
tag="resource"
description="%resource.description"
- componentClass="org.eclipse.ui.externaltools.internal.variable.ResourceComponent"
- expanderClass="org.eclipse.ui.externaltools.internal.variable.ResourceExpander">
+ componentClass="org.eclipse.debug.ui.variables.ResourceComponent"
+ expanderClass="org.eclipse.debug.ui.variables.ResourceExpander">
</variable>
<variable
tag="working_set"
description="%working_set.description"
- componentClass="org.eclipse.ui.externaltools.internal.variable.WorkingSetComponent"
- expanderClass="org.eclipse.ui.externaltools.internal.variable.WorkingSetExpander">
+ componentClass="org.eclipse.debug.ui.variables.WorkingSetComponent"
+ expanderClass="org.eclipse.debug.ui.variables.WorkingSetExpander">
</variable>
</extension>
</plugin>

Back to the top