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
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
-rw-r--r--org.eclipse.debug.ui/plugin.properties16
-rw-r--r--org.eclipse.debug.ui/plugin.xml76
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java25
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties23
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/AbstractVariableComponent.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/AbstractVariableComponent.java)8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ContainerExpander.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ContainerExpander.java)2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ContainerNameExpander.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ContainerNameExpander.java)7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/DefaultVariableExpander.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/DefaultVariableExpander.java)20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ExpandVariableContext.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ExpandVariableContext.java)30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ExternalToolVariable.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/ExternalToolVariable.java)15
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ExternalToolVariableForm.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/dialog/ExternalToolVariableForm.java)12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ExternalToolVariableRegistry.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/ExternalToolVariableRegistry.java)24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ExternalToolsVariableMessages.properties (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ExternalToolsVariableMessages.properties)11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/FilePromptExpander.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/FilePromptExpander.java)6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/FolderPromptExpander.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/FolderPromptExpander.java)6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/IGroupDialogPage.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/group/IGroupDialogPage.java)2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/IVariableComponent.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/IVariableComponent.java)3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/IVariableConstants.java105
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/IVariableExpander.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/IVariableExpander.java)2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ProjectExpander.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ProjectExpander.java)2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ProjectNameExpander.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ProjectNameExpander.java)4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/PromptExpanderBase.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/PromptExpanderBase.java)13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ResourceComponent.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ResourceComponent.java)10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ResourceExpander.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ResourceExpander.java)16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ResourceNameExpander.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ResourceNameExpander.java)5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/SpecificFileResourceComponent.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/SpecificFileResourceComponent.java)7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/SpecificFolderResourceComponent.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/SpecificFolderResourceComponent.java)8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/StringPromptExpander.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/StringPromptExpander.java)75
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/VariableContextManager.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/VariableContextManager.java)37
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/VariableSelectionDialog.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/VariableSelectionDialog.java)23
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/VariableUtil.java140
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/WorkingSetComponent.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/WorkingSetComponent.java)8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/WorkingSetExpander.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/WorkingSetExpander.java)7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/WorkspaceExpander.java (renamed from org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/WorkspaceExpander.java)2
-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/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/registry/ExternalToolMigration.java15
-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/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
55 files changed, 655 insertions, 668 deletions
diff --git a/org.eclipse.debug.ui/plugin.properties b/org.eclipse.debug.ui/plugin.properties
index 2e8967a8d..f0956f7ae 100644
--- a/org.eclipse.debug.ui/plugin.properties
+++ b/org.eclipse.debug.ui/plugin.properties
@@ -45,6 +45,7 @@ ExpressionView.name=Expressions
LaunchActionSet.label=Launch
LaunchConfigurationTabGroupExtensionName=Launch Configuration Tab Group
LaunchShortcutsName=Launch Shortcut
+LaunchConfigurationVariablesName=Launch Configuration Variables
LaunchConfigurationTypeImageExtensionName=Launch Configuration Type Image
LaunchConfigurationTypePropertyPage.name=Launch Configuration Type
LaunchConfigurationTypesPreferencePage.name=Launch Configuration Types
@@ -91,6 +92,21 @@ TerminateAndRemoveAction.label=Terminate and Remo&ve
VariablesView.name=Variables
VariableViewsPreferencePage.name=Variable Views
+#launch configuration 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.
+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.
+
providerName=Eclipse.org
runCategory.name= Run
diff --git a/org.eclipse.debug.ui/plugin.xml b/org.eclipse.debug.ui/plugin.xml
index e5b76eda2..dd5eb3f02 100644
--- a/org.eclipse.debug.ui/plugin.xml
+++ b/org.eclipse.debug.ui/plugin.xml
@@ -32,7 +32,8 @@
<extension-point id="launchConfigurationTypeImages" name="%LaunchConfigurationTypeImageExtensionName" schema="schema/launchConfigurationTypeImages.exsd"/>
<extension-point id="launchGroups" name="%LaunchGroupsExtensionName" schema="schema/launchGroups.exsd"/>
<extension-point id="launchShortcuts" name="%LaunchShortcutsName" schema="schema/launchShortcuts.exsd"/>
-
+ <extension-point id="launchConfigurationVariables" name="%LaunchConfigurationVariablesName"/>
+
<!-- Extensions -->
<extension
point="org.eclipse.ui.perspectives">
@@ -1119,6 +1120,77 @@
configuration="org.eclipse.ui.defaultAcceleratorConfiguration"
/>
- </extension>
+ </extension>
+
+ <!-- Variable Extensions -->
+ <extension point="org.eclipse.debug.ui.launchConfigurationVariables">
+ <variable
+ tag="workspace_loc"
+ description="%workspace_loc.description"
+ expanderClass="org.eclipse.debug.ui.variables.WorkspaceExpander">
+ </variable>
+ <variable
+ tag="project_loc"
+ description="%project_loc.description"
+ expanderClass="org.eclipse.debug.ui.variables.ProjectExpander">
+ </variable>
+ <variable
+ tag="project_path"
+ description="%project_path.description"
+ expanderClass="org.eclipse.debug.ui.variables.ProjectExpander">
+ </variable>
+ <variable
+ tag="project_name"
+ description="%project_name.description"
+ expanderClass="org.eclipse.debug.ui.variables.ProjectNameExpander">
+ </variable>
+ <variable
+ tag="resource_loc"
+ description="%resource_loc.description"
+ componentClass="org.eclipse.debug.ui.variables.SpecificFileResourceComponent"
+ expanderClass="org.eclipse.debug.ui.variables.ResourceExpander">
+ </variable>
+ <variable
+ tag="resource_path"
+ description="%resource_path.description"
+ componentClass="org.eclipse.debug.ui.variables.SpecificFileResourceComponent"
+ expanderClass="org.eclipse.debug.ui.variables.ResourceExpander">
+ </variable>
+ <variable
+ tag="resource_name"
+ description="%resource_name.description"
+ expanderClass="org.eclipse.debug.ui.variables.ResourceNameExpander">
+ </variable>
+ <variable
+ tag="container_loc"
+ description="%container_loc.description"
+ expanderClass="org.eclipse.debug.ui.variables.ContainerExpander">
+ </variable>
+ <variable
+ tag="container_path"
+ description="%container_path.description"
+ expanderClass="org.eclipse.debug.ui.variables.ContainerExpander">
+ </variable>
+ <variable
+ tag="container_name"
+ description="%container_name.description"
+ expanderClass="org.eclipse.debug.ui.variables.ContainerNameExpander">
+ </variable>
+ <variable
+ tag="string_prompt"
+ description="%string_prompt.description"
+ expanderClass="org.eclipse.debug.ui.variables.StringPromptExpander">
+ </variable>
+ <variable
+ tag="file_prompt"
+ description="%file_prompt.description"
+ expanderClass="org.eclipse.debug.ui.variables.FilePromptExpander">
+ </variable>
+ <variable
+ tag="folder_prompt"
+ description="%folder_prompt.description"
+ expanderClass="org.eclipse.debug.ui.variables.FolderPromptExpander">
+ </variable>
+ </extension>
</plugin>
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
index 409049bde..5081ba8bc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
@@ -48,6 +48,8 @@ import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
import org.eclipse.debug.internal.ui.views.console.ConsoleDocumentManager;
import org.eclipse.debug.ui.IDebugModelPresentation;
import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.debug.ui.variables.ExternalToolVariableRegistry;
+import org.eclipse.debug.ui.variables.VariableContextManager;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
@@ -114,6 +116,11 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener {
private LaunchConfigurationManager fLaunchConfigurationManager = null;
/**
+ * Collection of launch configuration variables
+ */
+ private ExternalToolVariableRegistry toolVariableRegistry;
+
+ /**
* Returns whether the debug UI plug-in is in trace
* mode.
*
@@ -180,6 +187,17 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener {
}
return fLaunchConfigurationManager;
}
+
+ /**
+ * Returns the registry of launch configuration variables.
+ */
+ public ExternalToolVariableRegistry getToolVariableRegistry() {
+ if (toolVariableRegistry == null) {
+ toolVariableRegistry = new ExternalToolVariableRegistry();
+ }
+ return toolVariableRegistry;
+ }
+
public static IWorkbenchWindow getActiveWorkbenchWindow() {
return getDefault().getWorkbench().getActiveWorkbenchWindow();
}
@@ -293,6 +311,13 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener {
DebugUIAdapterFactory uiFactory = new DebugUIAdapterFactory();
manager.registerAdapters(uiFactory, ILaunchConfiguration.class);
manager.registerAdapters(uiFactory, ILaunchConfigurationType.class);
+ getStandardDisplay().asyncExec(
+ new Runnable() {
+ public void run() {
+ //initialize the variable context manager
+ VariableContextManager.getDefault();
+ }
+ });
}
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java
index e70e6dce5..98b98abca 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java
@@ -59,6 +59,7 @@ public interface IDebugHelpContextIds {
public static final String LAUNCH_CONFIGURATION_DIALOG = PREFIX + "launch_configuration_dialog"; //$NON-NLS-1$
public static final String LAUNCH_CONFIGURATION_PROPERTIES_DIALOG = PREFIX + "launch_configuration_properties_dialog"; //$NON-NLS-1$
public static final String SINGLE_LAUNCH_CONFIGURATION_DIALOG = PREFIX + "single_launch_configuration_dialog"; //$NON-NLS-1$
+ public static final String VARIABLE_SELECTION_DIALOG = PREFIX + "variable_selection_dialog_context"; //$NON-NLS-1$
// Property pages
public static final String PROCESS_PROPERTY_PAGE = PREFIX + "process_property_page_context"; //$NON-NLS-1$
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
index 9454928be..4e8ec6a01 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
@@ -102,3 +102,26 @@ EnvironmentTab.Remove_6=&Remove
EnvironmentTab.variable_7=variable
EnvironmentTab.value_8=value
EnvironmentTab.Environment_9=Environment
+VariableSelectionDialog.Select_variable_1=Select variable
+VariableSelectionDialog.Choose_a_variable__2=Choose a variable:
+VariableSelectionDialog.Invalid_selection_3=Invalid selection
+ContainerNameExpander.No_container_could_be_determined_for_the_selected_resource._1=No container could be determined for the selected resource.
+ContainerNameExpander.No_resource_selected._2=No resource selected.
+ExternalToolVariable.Problem_displaying_UI_component_of_selected_variable._1=Problem displaying UI component of selected variable.
+WorkingSetComponent.A_specific_working_set_must_be_selected_from_the_list._1=A specific working set must be selected from the list.
+ResourceExpander.No_resource_selected._1=No resource selected.
+ResourceExpander.No_resource_selected._2=No resource selected.
+ResourceExpander.No_resource_selected._3=No resource selected.
+ResourceNameExpander.No_resource_selected._1=No resource selected.
+PromptExpanderBase.Please_input_a_value_for_{0}_1=Please input a value for {0}
+PromptExpanderBase.Please_input_a_value_2=Please input a value
+ResourceComponent.Use_&selected_resource_1=Use &selected resource
+ResourceComponent.Us&e_specific_resource__2=Us&e specific resource:
+ResourceComponent.A_specific_resource_must_be_selected_from_the_list._3=A specific resource must be selected from the list.
+SpecificFileResourceComponent.Us&e_specific_resource__1=Us&e specific resource:
+SpecificFileResourceComponent.Use_&selected_resource_2=Use &selected resource
+SpecificFolderResourceComponent.Us&e_specific_resource__1=Us&e specific resource:
+SpecificFolderResourceComponent.Use_&selected_resource_2=Use &selected resource
+StringPromptExpander.Variable_input_1=Variable input
+WorkingSetExpander.No_working_set_specified._1=No working set specified.
+WorkingSetExpander.No_working_set_found_with_the_name_{0}._2=No working set found with the name {0}.
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/AbstractVariableComponent.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/AbstractVariableComponent.java
index 633832031..5bc62519c 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/AbstractVariableComponent.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/AbstractVariableComponent.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
+package org.eclipse.debug.ui.variables;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@@ -16,8 +16,6 @@ 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
@@ -56,7 +54,7 @@ public abstract class AbstractVariableComponent implements IVariableComponent {
mainGroup.setLayout(layout);
mainGroup.setLayoutData(gridData);
mainGroup.setFont(parent.getFont());
- mainGroup.setText(ToolUtil.buildVariableTag(varTag, null));
+ mainGroup.setText(VariableUtil.buildVariableTag(varTag, null));
}
/**
@@ -101,7 +99,7 @@ public abstract class AbstractVariableComponent implements IVariableComponent {
}
/* (non-Javadoc)
- * @see org.eclipse.ui.externaltools.internal.variable.IVariableComponent#dispose()
+ * @see org.eclipse.debug.ui.variables.IVariableComponent#dispose()
*/
public void dispose() {
//by default do nothing
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ContainerExpander.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ContainerExpander.java
index c017c0f4f..78fdd4899 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ContainerExpander.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ContainerExpander.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
+package org.eclipse.debug.ui.variables;
import org.eclipse.core.resources.IResource;
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ContainerNameExpander.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ContainerNameExpander.java
index 96e7930d1..b45d797d0 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ContainerNameExpander.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ContainerNameExpander.java
@@ -8,12 +8,13 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
+package org.eclipse.debug.ui.variables;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsMessages;
/**
* Extracts the container name from a variable context
@@ -30,9 +31,9 @@ public class ContainerNameExpander extends DefaultVariableExpander {
if (parent != null) {
return parent.getName();
}
- throwExpansionException(varTag, ExternalToolsVariableMessages.getString("ContainerNameExpander.No_container")); //$NON-NLS-1$
+ throwExpansionException(varTag, LaunchConfigurationsMessages.getString("ContainerNameExpander.No_container_could_be_determined_for_the_selected_resource._1")); //$NON-NLS-1$
}
- throwExpansionException(varTag, ExternalToolsVariableMessages.getString("ContainerNameExpander.No_resource")); //$NON-NLS-1$
+ throwExpansionException(varTag, LaunchConfigurationsMessages.getString("ContainerNameExpander.No_resource_selected._2")); //$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.debug.ui/ui/org/eclipse/debug/ui/variables/DefaultVariableExpander.java
index 17f89b6c9..3a26b8bb7 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/DefaultVariableExpander.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/DefaultVariableExpander.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
+package org.eclipse.debug.ui.variables;
import java.text.MessageFormat;
@@ -16,8 +16,16 @@ 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;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+/**
+ * Default variable expander implementation. Does nothing.
+ *
+ * Clients are intended to extend this class.
+ * @since 3.0
+ */
public class DefaultVariableExpander implements IVariableExpander {
private static DefaultVariableExpander instance;
@@ -30,17 +38,17 @@ public class DefaultVariableExpander implements IVariableExpander {
}
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$
+ throwExpansionException(varTag, MessageFormat.format("No expander class defined for the variable {0}", new String[] {varTag}));
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$
+ throwExpansionException(varTag, MessageFormat.format("No expander class defined for the variable {0}", new String[] {varTag}));
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$
+ throwExpansionException(varTag, MessageFormat.format("No expander class defined for the variable {0}", new String[] {varTag}));
return null;
}
@@ -49,7 +57,7 @@ public class DefaultVariableExpander implements IVariableExpander {
* 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$
+ throw new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IStatus.ERROR, MessageFormat.format("An error occurred attempting to expand the variable {0}. {1}", new String[] {varTag, reason}), null));
}
}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ExpandVariableContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ExpandVariableContext.java
index 932c9a2d0..363589dbe 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ExpandVariableContext.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ExpandVariableContext.java
@@ -8,13 +8,11 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
+package org.eclipse.debug.ui.variables;
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
@@ -25,7 +23,6 @@ public final class ExpandVariableContext {
private IProject project = null;
private IResource selectedResource = null;
- private String buildType = IExternalToolConstants.BUILD_TYPE_NONE;
/**
* Create a context for an external tool running
@@ -38,20 +35,7 @@ public final class ExpandVariableContext {
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;
- }
+
}
/**
@@ -70,16 +54,6 @@ public final class ExpandVariableContext {
}
/**
- * 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
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/ExternalToolVariable.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ExternalToolVariable.java
index 6676b0d7e..e6cbfbde8 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/ExternalToolVariable.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ExternalToolVariable.java
@@ -8,24 +8,19 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.registry;
+package org.eclipse.debug.ui.variables;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsMessages;
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.
@@ -78,7 +73,7 @@ public class ExternalToolVariable {
try {
return element.createExecutableExtension(attributeName);
} catch (CoreException e) {
- ExternalToolsPlugin.getDefault().getLog().log(e.getStatus());
+ DebugUIPlugin.log(e.getStatus());
return null;
}
}
@@ -143,7 +138,7 @@ public class ExternalToolVariable {
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.setText(LaunchConfigurationsMessages.getString("ExternalToolVariable.Problem_displaying_UI_component_of_selected_variable._1")); //$NON-NLS-1$
message.setForeground(JFaceColors.getErrorText(message.getDisplay()));
}
}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/dialog/ExternalToolVariableForm.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ExternalToolVariableForm.java
index 00c346faf..26ddc287f 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/dialog/ExternalToolVariableForm.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ExternalToolVariableForm.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.dialog;
+package org.eclipse.debug.ui.variables;
import org.eclipse.swt.SWT;
@@ -21,10 +21,6 @@ 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
@@ -128,12 +124,12 @@ public class ExternalToolVariableForm {
public String getSelectedVariable() {
if (activeComponentIndex != -1) {
String varValue = components[activeComponentIndex].getVariableValue();
- return ToolUtil.buildVariableTag(variables[activeComponentIndex].getTag(), varValue);
+ return VariableUtil.buildVariableTag(variables[activeComponentIndex].getTag(), varValue);
}
return null;
}
-
+
/**
* Returns the variable list of this form.
*/
@@ -157,7 +153,7 @@ public class ExternalToolVariableForm {
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);
+ VariableUtil.buildVariableTag(variables[i].getTag(), null, buffer);
buffer.append(" - "); //$NON-NLS-1$
buffer.append(variables[i].getDescription());
items[i] = buffer.toString();
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/ExternalToolVariableRegistry.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ExternalToolVariableRegistry.java
index 9369736a4..c36b82867 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/registry/ExternalToolVariableRegistry.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ExternalToolVariableRegistry.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.registry;
+package org.eclipse.debug.ui.variables;
import java.util.SortedMap;
@@ -18,9 +18,10 @@ 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.IStatus;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin;
-import org.eclipse.ui.externaltools.internal.model.IExternalToolConstants;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
/**
* General registry reader for external tool variables.
@@ -57,15 +58,20 @@ public class ExternalToolVariableRegistry {
* The extension point id to read the variables from
*/
protected String extensionPointId;
+ /**
+ * The plugin id to read the extension point from
+ */
+ protected String pluginId;
public ExternalToolVariableRegistry() {
- this(IExternalToolConstants.EXTENSION_POINT_TOOL_VARIABLES);
+ this(DebugUIPlugin.getUniqueIdentifier(), IVariableConstants.EXTENSION_POINT_TOOL_VARIABLES);
}
/**
* Creates a new registry and loads the variables.
*/
- protected ExternalToolVariableRegistry(String extensionPointId) {
+ protected ExternalToolVariableRegistry(String pluginId, String extensionPointId) {
+ this.pluginId= pluginId;
this.extensionPointId = extensionPointId;
loadVariables();
}
@@ -108,7 +114,7 @@ public class ExternalToolVariableRegistry {
private void loadVariables() {
variables = new TreeMap();
IPluginRegistry registry = Platform.getPluginRegistry();
- IExtensionPoint point = registry.getExtensionPoint(IExternalToolConstants.PLUGIN_ID, extensionPointId);
+ IExtensionPoint point = registry.getExtensionPoint(pluginId, extensionPointId);
if (point != null) {
IExtension[] extensions = point.getExtensions();
for (int i = 0; i < extensions.length; i++) {
@@ -123,15 +129,15 @@ public class ExternalToolVariableRegistry {
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$
+ DebugUIPlugin.log(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IStatus.ERROR, "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$
+ DebugUIPlugin.log(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IStatus.ERROR, "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$
+ DebugUIPlugin.log(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IStatus.ERROR, "Missing expander class attribute value for variable element.", null)); //$NON-NLS-1$
}
if (valid)
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ExternalToolsVariableMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ExternalToolsVariableMessages.properties
index 90b28288d..3753169d8 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ExternalToolsVariableMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ExternalToolsVariableMessages.properties
@@ -12,16 +12,5 @@
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.debug.ui/ui/org/eclipse/debug/ui/variables/FilePromptExpander.java
index 0b07d5ab9..6c79bd449 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/FilePromptExpander.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/FilePromptExpander.java
@@ -9,10 +9,10 @@
* Matt Conway - initial implementation
* IBM Corporation - integration and code cleanup
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
+package org.eclipse.debug.ui.variables;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
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
@@ -27,7 +27,7 @@ public class FilePromptExpander extends PromptExpanderBase {
* @see PromptExpanderBase#prompt()
*/
public void prompt() {
- FileDialog dialog = new FileDialog(ExternalToolsPlugin.getStandardDisplay().getActiveShell());
+ FileDialog dialog = new FileDialog(DebugUIPlugin.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.debug.ui/ui/org/eclipse/debug/ui/variables/FolderPromptExpander.java
index af564b5e1..ed0316432 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/FolderPromptExpander.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/FolderPromptExpander.java
@@ -9,10 +9,10 @@
* Matt Conway - initial implementation
* IBM Corporation - integration and code cleanup
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
+package org.eclipse.debug.ui.variables;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
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
@@ -28,7 +28,7 @@ public class FolderPromptExpander extends PromptExpanderBase {
* @see PromptExpanderBase#prompt()
*/
public void prompt() {
- DirectoryDialog dialog = new DirectoryDialog(ExternalToolsPlugin.getStandardDisplay().getActiveShell());
+ DirectoryDialog dialog = new DirectoryDialog(DebugUIPlugin.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/group/IGroupDialogPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/IGroupDialogPage.java
index fc1aba897..80ec65586 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/group/IGroupDialogPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/IGroupDialogPage.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.group;
+package org.eclipse.debug.ui.variables;
import org.eclipse.jface.dialogs.IMessageProvider;
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/IVariableComponent.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/IVariableComponent.java
index 17a0ee8f7..08e6cad91 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/IVariableComponent.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/IVariableComponent.java
@@ -8,12 +8,11 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
+package org.eclipse.debug.ui.variables;
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
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/IVariableConstants.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/IVariableConstants.java
new file mode 100644
index 000000000..311422585
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/IVariableConstants.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * 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.debug.ui.variables;
+
+public interface IVariableConstants {
+ /**
+ * 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$
+ /**
+ * Extension point to declare external tool variables.
+ * (value<code>toolVariables</code>).
+ */
+ public static final String EXTENSION_POINT_TOOL_VARIABLES = "launchConfigurationVariables"; //$NON-NLS-1$
+
+} \ 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.debug.ui/ui/org/eclipse/debug/ui/variables/IVariableExpander.java
index c694acaac..58accbe5d 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/IVariableExpander.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/IVariableExpander.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
+package org.eclipse.debug.ui.variables;
import org.eclipse.core.resources.IResource;
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ProjectExpander.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ProjectExpander.java
index ab7efee43..b2947a692 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ProjectExpander.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ProjectExpander.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
+package org.eclipse.debug.ui.variables;
import org.eclipse.core.resources.IResource;
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ProjectNameExpander.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ProjectNameExpander.java
index 8b68a872b..3f8f28abe 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ProjectNameExpander.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ProjectNameExpander.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
+package org.eclipse.debug.ui.variables;
import org.eclipse.core.resources.IProject;
@@ -28,7 +28,7 @@ public class ProjectNameExpander extends DefaultVariableExpander {
if (project != null) {
return project.getName();
}
- throwExpansionException(varTag, ExternalToolsVariableMessages.getString("ProjectNameExpander.No_resource")); //$NON-NLS-1$
+ throwExpansionException(varTag, "No resource selected.");
return null;
}
}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/PromptExpanderBase.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/PromptExpanderBase.java
index cc130378e..af0f89018 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/PromptExpanderBase.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/PromptExpanderBase.java
@@ -9,12 +9,13 @@
* Matt Conway - initial implementation
* IBM Corporation - integration and code cleanup
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
+package org.eclipse.debug.ui.variables;
import java.text.MessageFormat;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsMessages;
/**
* Base implementation for variable expanders that prompt the user
@@ -53,7 +54,7 @@ abstract class PromptExpanderBase extends DefaultVariableExpander {
String varText = null;
setupDialog(varValue);
- ExternalToolsPlugin.getStandardDisplay().syncExec(new Runnable() {
+ DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
public void run() {
prompt();
}
@@ -79,7 +80,7 @@ abstract class PromptExpanderBase extends DefaultVariableExpander {
* @param varValue the value of the variable from which the prompt
* hint and default value will be extracted
*/
- private void setupDialog(String varValue) {
+ protected void setupDialog(String varValue) {
promptHint = null;
defaultValue = null;
dialogResultString = null;
@@ -94,9 +95,9 @@ abstract class PromptExpanderBase extends DefaultVariableExpander {
}
if (promptHint != null) {
- dialogMessage = MessageFormat.format(ExternalToolsVariableMessages.getString("PromptExpanderBase.Please_input_a_value_for_{0}_1"), new String[] {promptHint}); //$NON-NLS-1$
+ dialogMessage = MessageFormat.format(LaunchConfigurationsMessages.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$
+ dialogMessage = LaunchConfigurationsMessages.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.debug.ui/ui/org/eclipse/debug/ui/variables/ResourceComponent.java
index 6240cfd0b..06d91cc0c 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ResourceComponent.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ResourceComponent.java
@@ -8,11 +8,12 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
+package org.eclipse.debug.ui.variables;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsMessages;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
@@ -27,7 +28,6 @@ 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;
@@ -93,7 +93,7 @@ public class ResourceComponent extends AbstractVariableComponent {
*/
private void createSelectedResourceOption() {
selectedResourceButton = new Button(mainGroup, SWT.RADIO);
- selectedResourceButton.setText(ExternalToolsVariableMessages.getString("ResourceComponent.selectedResLabel")); //$NON-NLS-1$
+ selectedResourceButton.setText(LaunchConfigurationsMessages.getString("ResourceComponent.Use_&selected_resource_1")); //$NON-NLS-1$
GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
selectedResourceButton.setLayoutData(data);
selectedResourceButton.setFont(mainGroup.getFont());
@@ -106,7 +106,7 @@ public class ResourceComponent extends AbstractVariableComponent {
*/
private void createSpecificResourceOption() {
specificResourceButton = new Button(mainGroup, SWT.RADIO);
- specificResourceButton.setText(ExternalToolsVariableMessages.getString("ResourceComponent.specificResLabel")); //$NON-NLS-1$
+ specificResourceButton.setText(LaunchConfigurationsMessages.getString("ResourceComponent.Us&e_specific_resource__2")); //$NON-NLS-1$
GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
specificResourceButton.setLayoutData(data);
specificResourceButton.setFont(mainGroup.getFont());
@@ -216,7 +216,7 @@ public class ResourceComponent extends AbstractVariableComponent {
return;
}
if (resourceList.getSelection().isEmpty()) {
- getPage().setErrorMessage(ExternalToolsVariableMessages.getString("ResourceComponent.selectionRequired")); //$NON-NLS-1$
+ getPage().setErrorMessage(LaunchConfigurationsMessages.getString("ResourceComponent.A_specific_resource_must_be_selected_from_the_list._3")); //$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.debug.ui/ui/org/eclipse/debug/ui/variables/ResourceExpander.java
index 900918fb6..dba1e26ba 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ResourceExpander.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ResourceExpander.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
+package org.eclipse.debug.ui.variables;
import org.eclipse.core.resources.IResource;
@@ -16,7 +16,7 @@ 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;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsMessages;
/**
* Expands a resource type variable into the desired
@@ -68,7 +68,7 @@ public class ResourceExpander extends DefaultVariableExpander {
return resource.getLocation();
}
}
- throwExpansionException(varTag, ExternalToolsVariableMessages.getString("ResourceExpander.No_resource")); //$NON-NLS-1$
+ throwExpansionException(varTag, LaunchConfigurationsMessages.getString("ResourceExpander.No_resource_selected._1")); //$NON-NLS-1$
return null;
}
@@ -78,9 +78,9 @@ public class ResourceExpander extends DefaultVariableExpander {
* 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);
+ return varTag.equals(IVariableConstants.VAR_CONTAINER_PATH) ||
+ varTag.equals(IVariableConstants.VAR_PROJECT_PATH) ||
+ varTag.equals(IVariableConstants.VAR_RESOURCE_PATH);
}
/* (non-Javadoc)
@@ -91,7 +91,7 @@ public class ResourceExpander extends DefaultVariableExpander {
if (resource != null) {
return new IResource[] {resource};
}
- throwExpansionException(varTag, ExternalToolsVariableMessages.getString("ResourceExpander.No_resource")); //$NON-NLS-1$
+ throwExpansionException(varTag, LaunchConfigurationsMessages.getString("ResourceExpander.No_resource_selected._2")); //$NON-NLS-1$
return null;
}
@@ -113,7 +113,7 @@ public class ResourceExpander extends DefaultVariableExpander {
if (path != null) {
return path.toOSString();
}
- throwExpansionException(varTag, ExternalToolsVariableMessages.getString("ResourceExpander.No_resource")); //$NON-NLS-1$
+ throwExpansionException(varTag, LaunchConfigurationsMessages.getString("ResourceExpander.No_resource_selected._3")); //$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.debug.ui/ui/org/eclipse/debug/ui/variables/ResourceNameExpander.java
index 649cd077d..1820f82f8 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/ResourceNameExpander.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/ResourceNameExpander.java
@@ -8,11 +8,12 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
+package org.eclipse.debug.ui.variables;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsMessages;
/**
* Extracts the resource name from a variable context
@@ -27,7 +28,7 @@ public class ResourceNameExpander extends DefaultVariableExpander {
if (resource != null) {
return resource.getName();
}
- throwExpansionException(varTag, ExternalToolsVariableMessages.getString("ResourceNameExpander.No_resource")); //$NON-NLS-1$
+ throwExpansionException(varTag, LaunchConfigurationsMessages.getString("ResourceNameExpander.No_resource_selected._1")); //$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.debug.ui/ui/org/eclipse/debug/ui/variables/SpecificFileResourceComponent.java
index fb8ea82f4..e7a406dda 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/SpecificFileResourceComponent.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/SpecificFileResourceComponent.java
@@ -8,10 +8,11 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
+package org.eclipse.debug.ui.variables;
import org.eclipse.core.resources.IResource;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsMessages;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@@ -49,7 +50,7 @@ public class SpecificFileResourceComponent extends ResourceComponent {
GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
label.setLayoutData(data);
label.setFont(mainGroup.getFont());
- label.setText(ExternalToolsVariableMessages.getString("ResourceComponent.specificResLabel")); //$NON-NLS-1$
+ label.setText(LaunchConfigurationsMessages.getString("SpecificFileResourceComponent.Us&e_specific_resource__1")); //$NON-NLS-1$
}
/* (non-Javadoc)
@@ -62,7 +63,7 @@ public class SpecificFileResourceComponent extends ResourceComponent {
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$
+ getPage().setErrorMessage(LaunchConfigurationsMessages.getString("SpecificFileResourceComponent.Use_&selected_resource_2")); //$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.debug.ui/ui/org/eclipse/debug/ui/variables/SpecificFolderResourceComponent.java
index 73253822e..d0671d09c 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/SpecificFolderResourceComponent.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/SpecificFolderResourceComponent.java
@@ -8,11 +8,11 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
-
+package org.eclipse.debug.ui.variables;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsMessages;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
@@ -61,7 +61,7 @@ public class SpecificFolderResourceComponent extends ResourceComponent {
GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
label.setLayoutData(data);
label.setFont(mainGroup.getFont());
- label.setText(ExternalToolsVariableMessages.getString("ResourceComponent.specificResLabel")); //$NON-NLS-1$
+ label.setText(LaunchConfigurationsMessages.getString("SpecificFolderResourceComponent.Us&e_specific_resource__1")); //$NON-NLS-1$
}
/* (non-Javadoc)
@@ -74,7 +74,7 @@ public class SpecificFolderResourceComponent extends ResourceComponent {
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$
+ getPage().setErrorMessage(LaunchConfigurationsMessages.getString("SpecificFolderResourceComponent.Use_&selected_resource_2")); //$NON-NLS-1$
setIsValid(false);
}
}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/StringPromptExpander.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/StringPromptExpander.java
index 2882491b5..cf43d9e44 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/StringPromptExpander.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/StringPromptExpander.java
@@ -1,37 +1,38 @@
-/*******************************************************************************
- * 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();
- }
- }
-
-}
+/*******************************************************************************
+ * 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.debug.ui.variables;
+
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsMessages;
+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, LaunchConfigurationsMessages.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/model/VariableContextManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/VariableContextManager.java
index 6b55c65e8..4fe0250f7 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/VariableContextManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/VariableContextManager.java
@@ -8,10 +8,8 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.model;
+package org.eclipse.debug.ui.variables;
-
-import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.viewers.ISelection;
@@ -26,7 +24,6 @@ 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
@@ -40,10 +37,6 @@ public class VariableContextManager implements IWindowListener, ISelectionListen
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
@@ -141,32 +134,6 @@ public class VariableContextManager implements IWindowListener, ISelectionListen
* @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;
+ return new ExpandVariableContext(fSelectedResource);
}
}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/VariableSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/VariableSelectionDialog.java
index 12acbc8ce..e096533b8 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/VariableSelectionDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/VariableSelectionDialog.java
@@ -8,8 +8,11 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.launchConfigurations;
+package org.eclipse.debug.ui.variables;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsMessages;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
@@ -18,35 +21,30 @@ 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 {
+public 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$
+ setTitle(LaunchConfigurationsMessages.getString("VariableSelectionDialog.Select_variable_1")); //$NON-NLS-1$
}
/* (non-Javadoc)
* Method declared in Window.
*/
protected void configureShell(Shell shell) {
super.configureShell(shell);
- WorkbenchHelp.setHelp(shell, IExternalToolsHelpContextIds.VARIABLE_SELECTION_DIALOG);
+ WorkbenchHelp.setHelp(shell, IDebugHelpContextIds.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$
+ ExternalToolVariable[] variables= DebugUIPlugin.getDefault().getToolVariableRegistry().getVariables();
+ form= new ExternalToolVariableForm(LaunchConfigurationsMessages.getString("VariableSelectionDialog.Choose_a_variable__2"), variables); //$NON-NLS-1$
form.createContents(composite, new IGroupDialogPage() {
public void setErrorMessage(String errorMessage) {
@@ -58,7 +56,7 @@ class VariableSelectionDialog extends SelectionDialog {
public String getMessage() {
if (!form.isValid()) {
- return ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsMainTab.Invalid_selection_12"); //$NON-NLS-1$
+ return LaunchConfigurationsMessages.getString("VariableSelectionDialog.Invalid_selection_3"); //$NON-NLS-1$
}
return null;
}
@@ -70,7 +68,6 @@ class VariableSelectionDialog extends SelectionDialog {
return 0;
}
});
-
form.getVariableList().addListener(SWT.MouseDoubleClick, new Listener() {
public void handleEvent(Event event) {
okPressed();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/VariableUtil.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/VariableUtil.java
new file mode 100644
index 000000000..927dca729
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/VariableUtil.java
@@ -0,0 +1,140 @@
+/*******************************************************************************
+ * 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.debug.ui.variables;
+
+/**
+ * Utility for dealing with variables
+ */
+public class VariableUtil {
+ /**
+ * Variable tag indentifiers
+ */
+ public static final char VAR_TAG_START_CHAR1 = '$'; //$NON-NLS-1$
+ public static final char VAR_TAG_START_CHAR2 = '{'; //$NON-NLS-1$
+ public 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$
+
+ /**
+ * 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();
+ }
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * 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);
+ }
+
+}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/WorkingSetComponent.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/WorkingSetComponent.java
index 275572645..1761b2de9 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/WorkingSetComponent.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/WorkingSetComponent.java
@@ -8,12 +8,13 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
+package org.eclipse.debug.ui.variables;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsMessages;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -32,7 +33,6 @@ 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
@@ -169,14 +169,14 @@ public class WorkingSetComponent extends AbstractVariableComponent {
if (isValid) {
getPage().setErrorMessage(null);
} else {
- getPage().setErrorMessage(ExternalToolsVariableMessages.getString("WorkingSetComponent.Must_Select")); //$NON-NLS-1$
+ getPage().setErrorMessage(LaunchConfigurationsMessages.getString("WorkingSetComponent.A_specific_working_set_must_be_selected_from_the_list._1")); //$NON-NLS-1$
}
setIsValid(isValid);
getPage().updateValidState();
}
/* (non-Javadoc)
- * @see org.eclipse.ui.externaltools.internal.variable.IVariableComponent#dispose()
+ * @see org.eclipse.debug.ui.variables.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.debug.ui/ui/org/eclipse/debug/ui/variables/WorkingSetExpander.java
index cc1236f78..c02ff5acf 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/WorkingSetExpander.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/WorkingSetExpander.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
+package org.eclipse.debug.ui.variables;
import java.text.MessageFormat;
@@ -16,6 +16,7 @@ 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.debug.internal.ui.launchConfigurations.LaunchConfigurationsMessages;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.PlatformUI;
@@ -40,13 +41,13 @@ public class WorkingSetExpander extends DefaultVariableExpander {
*/
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$
+ throwExpansionException(varTag, LaunchConfigurationsMessages.getString("WorkingSetExpander.No_working_set_specified._1")); //$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$
+ throwExpansionException(varTag, MessageFormat.format(LaunchConfigurationsMessages.getString("WorkingSetExpander.No_working_set_found_with_the_name_{0}._2"), new String[] {varValue})); //$NON-NLS-1$
return null;
}
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/WorkspaceExpander.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/WorkspaceExpander.java
index 7b79250d1..80c08dd31 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variable/WorkspaceExpander.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/variables/WorkspaceExpander.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.ui.externaltools.internal.variable;
+package org.eclipse.debug.ui.variables;
import org.eclipse.core.resources.IResource;
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/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/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/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/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