Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2003-09-23 16:22:25 +0000
committerDarin Wright2003-09-23 16:22:25 +0000
commit10a3de6a27c1b6fa7783f24600f93a895c89e239 (patch)
tree184b077f7434921ad4a5c58821e81fc1c39af19a /org.eclipse.debug.ui
parent7cc48b10eee323f1dd284869c17c709a9c98edc2 (diff)
downloadeclipse.platform.debug-10a3de6a27c1b6fa7783f24600f93a895c89e239.tar.gz
eclipse.platform.debug-10a3de6a27c1b6fa7783f24600f93a895c89e239.tar.xz
eclipse.platform.debug-10a3de6a27c1b6fa7783f24600f93a895c89e239.zip
bug 43332 - Re-work launch variable API
Diffstat (limited to 'org.eclipse.debug.ui')
-rw-r--r--org.eclipse.debug.ui/doc/book.css106
-rw-r--r--org.eclipse.debug.ui/doc/org_eclipse_debug_ui.html1
-rw-r--r--org.eclipse.debug.ui/doc/org_eclipse_debug_ui_stringVariablePresentations.html52
-rw-r--r--org.eclipse.debug.ui/doc/schema.css30
-rw-r--r--org.eclipse.debug.ui/plugin.properties18
-rw-r--r--org.eclipse.debug.ui/plugin.xml62
-rw-r--r--org.eclipse.debug.ui/schema/stringVariablePresentations.exsd111
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java15
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/ContextVariableComponentManager.java128
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/FilePromptExpander.java36
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/FolderPromptExpander.java37
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/LaunchVariableMessages.java31
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/LaunchVariableMessages.properties48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/PromptExpanderBase.java104
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/ResourceComponent.java221
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/StringPromptExpander.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/SimpleLaunchVariablePreferencePage.java)170
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FilePrompt.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FilePromptExpander.java)2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringSubstitutionMessages.properties20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariableSelectionDialog.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java25
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/RefreshTab.java)63
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/AbstractVariableComponent.java119
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/ILaunchVariableComponentManager.java15
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/IVariableComponent.java91
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/IVariableComponentContainer.java40
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/IVariableConstants.java40
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/LaunchConfigurationVariableForm.java296
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/LaunchVariableContextManager.java139
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/LaunchVariableSelectionDialog.java140
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/package.html26
33 files changed, 513 insertions, 1743 deletions
diff --git a/org.eclipse.debug.ui/doc/book.css b/org.eclipse.debug.ui/doc/book.css
new file mode 100644
index 000000000..9278cd8a1
--- /dev/null
+++ b/org.eclipse.debug.ui/doc/book.css
@@ -0,0 +1,106 @@
+P.Code {
+ display: block;
+ text-align: left;
+ text-indent: 0.00pt;
+ margin-top: 0.000000pt;
+ margin-bottom: 0.000000pt;
+ margin-right: 0.000000pt;
+ margin-left: 15pt;
+ font-size: 10.000000pt;
+ font-weight: medium;
+ font-style: Regular;
+ color: #4444CC;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family: "Courier New";
+}
+H6.CaptionFigColumn {
+ display: block;
+ text-align: left;
+ text-indent: 0.000000pt;
+ margin-top: 3.000000pt;
+ margin-bottom: 11.000000pt;
+ margin-right: 0.000000pt;
+ margin-left: 0.000000pt;
+ font-size: 9.000000pt;
+ font-weight: medium;
+ font-style: Italic;
+ color: #000000;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family: "Arial";
+}
+P.Note {
+ display: block;
+ text-align: left;
+ text-indent: 0pt;
+ margin-top: 19.500000pt;
+ margin-bottom: 19.500000pt;
+ margin-right: 0.000000pt;
+ margin-left: 30pt;
+ font-size: 11.000000pt;
+ font-weight: medium;
+ font-style: Italic;
+ color: #000000;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family: "Arial";
+}
+EM.UILabel {
+ font-weight: Bold;
+ font-style: Regular;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+}
+EM.CodeName {
+ font-weight: Bold;
+ font-style: Regular;
+ text-decoration: none;
+ vertical-align: baseline;
+ text-transform: none;
+ font-family:"Courier New";
+}
+
+
+
+
+/* following font face declarations need to be removed for DBCS */
+
+body, h1, h2, h3, h4, h5, h6, p, table, td, caption, th, ul, ol, dl, li, dd, dt {font-family: Arial, Helvetica, sans-serif; color: #000000}
+pre { font-family: Courier, monospace}
+
+/* end font face declarations */
+
+/* following font size declarations should be OK for DBCS */
+body, h1, h2, h3, h4, h5, h6, p, table, td, caption, th, ul, ol, dl, li, dd, dt {font-size: 10pt; }
+pre { font-size: 10pt}
+
+/* end font size declarations */
+
+body { background: #FFFFFF}
+h1 { font-size: 18pt; margin-top: 5; margin-bottom: 1 }
+h2 { font-size: 14pt; margin-top: 25; margin-bottom: 3 }
+h3 { font-size: 11pt; margin-top: 20; margin-bottom: 3 }
+h4 { font-size: 10pt; margin-top: 20; margin-bottom: 3; font-style: italic }
+p { margin-top: 10px; margin-bottom: 10px }
+pre { margin-left: 6; font-size: 9pt }
+a:link { color: #0000FF }
+a:hover { color: #000080 }
+a:visited { text-decoration: underline }
+ul { margin-top: 0; margin-bottom: 10 }
+li { margin-top: 0; margin-bottom: 0 }
+li p { margin-top: 0; margin-bottom: 0 }
+ol { margin-top: 0; margin-bottom: 10 }
+dl { margin-top: 0; margin-bottom: 10 }
+dt { margin-top: 0; margin-bottom: 0; font-weight: bold }
+dd { margin-top: 0; margin-bottom: 0 }
+strong { font-weight: bold}
+em { font-style: italic}
+var { font-style: italic}
+div.revision { border-left-style: solid; border-left-width: thin;
+ border-left-color: #7B68EE; padding-left:5 }
+th { font-weight: bold }
diff --git a/org.eclipse.debug.ui/doc/org_eclipse_debug_ui.html b/org.eclipse.debug.ui/doc/org_eclipse_debug_ui.html
index 06a8b299e..c453656e7 100644
--- a/org.eclipse.debug.ui/doc/org_eclipse_debug_ui.html
+++ b/org.eclipse.debug.ui/doc/org_eclipse_debug_ui.html
@@ -30,6 +30,7 @@ stepping, terminating, etc. <br>
<li><a href="org_eclipse_debug_ui_launchConfigurationTabGroups.html">org.eclipse.debug.ui.launchConfigurationTabGroups</a></li>
<li><a href="org_eclipse_debug_ui_launchConfigurationTypeImages.html">org.eclipse.debug.ui.launchConfigurationTypeImages</a></li>
<li><a href="org_eclipse_debug_ui_launchShortcuts.html">org.eclipse.debug.ui.launchShortcuts</a></li>
+ <li><a href="org_eclipse_debug_ui_stringVariablePresentations.html">org.eclipse.debug.ui.stringVariablePresentations</a></li>
</ul>
<p><a href="hglegal.htm"><img src="ngibmcpy.gif" alt="Copyright IBM Corp. 2000, 2001. All Rights Reserved."
diff --git a/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_stringVariablePresentations.html b/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_stringVariablePresentations.html
new file mode 100644
index 000000000..c2a2610ea
--- /dev/null
+++ b/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_stringVariablePresentations.html
@@ -0,0 +1,52 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HEAD><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<link rel="stylesheet" type="text/css" href="book.css"/>
+<link rel="stylesheet" type="text/css" href="schema.css"/>
+</HEAD>
+<HTML>
+<BODY>
+<H1><CENTER>String Variable Presentations</CENTER></H1>
+<h6 class=CaptionFigColumn id=header>Identifier: </h6>org.eclipse.debug.ui.stringVariablePresentations<p>
+<h6 class=CaptionFigColumn id=header>Since: </h6>2.1<p>
+<h6 class=CaptionFigColumn id=header>Description: </h6>This extension point provides a mechanism for contributing a user interface/presentation for a string substitution variable (i.e. a context variable or value variable).<p><h6 class=CaptionFigColumn id=header>Configuration Markup:</h6></p>
+<p class=code id=dtd>&nbsp;&nbsp; &lt;!ELEMENT <a name="e.extension">extension</a> (<a href="#e.variablePresentation">variablePresentation</a>*)&gt;</p>
+<br><br><p class=code id=dtd>&nbsp;&nbsp; &lt;!ATTLIST extension</p>
+<br><p class=code id=dtd>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;point&nbsp;CDATA #REQUIRED</p>
+<br><p class=code id=dtd>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</p>
+<br><p class=code id=dtd>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name&nbsp;&nbsp;CDATA #IMPLIED</p>
+<br><p class=code id=dtd>&nbsp;&nbsp; &gt;</p>
+<ul>
+<li><b>point</b> - a fully qualified identifier of the target extension point</li>
+<li><b>id</b> - an optional identifier of the extension instance</li>
+<li><b>name</b> - an optional name of the extension instance</li>
+</ul>
+<p class=code id=dtd>&nbsp;&nbsp; &lt;!ELEMENT <a name="e.variablePresentation">variablePresentation</a> EMPTY&gt;</p>
+<br><br><p class=code id=dtd>&nbsp;&nbsp; &lt;!ATTLIST variablePresentation</p>
+<br><p class=code id=dtd>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;variableName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</p>
+<br><p class=code id=dtd>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;argumentSelector&nbsp;CDATA #REQUIRED</p>
+<br><p class=code id=dtd>&nbsp;&nbsp; &gt;</p>
+<ul>
+<li><b>variableName</b> - specifies the variable this presentation is for</li>
+<li><b>argumentSelector</b> - specifies a fully qualified name of a Java class that implements IArgumentSelector</li>
+</ul>
+<h6 class=CaptionFigColumn id=header>Examples: </h6>The following is an example of a variable presentation contribution:
+<pre>
+<p class=code id=tag>&lt;extension point=<p class=code id=cstring>&quot;org.eclipse.debug.ui.stringVariablePresentations&quot;</p><p class=code id=tag>&gt;</p>
+ <p class=code id=tag>&lt;variablePresentation
+ variableName=<p class=code id=cstring>&quot;example_variable&quot;</p><p class=code id=tag>
+ argumentSelector=<p class=code id=cstring>&quot;com.example.ExampleArgumentChooser&quot;</p><p class=code id=tag>&gt;</p>
+ <p class=code id=tag>&lt;/variablePresentation&gt;</p>
+<p class=code id=tag>&lt;/extension&gt;</p>
+</pre>
+In the above example, the contributed presentation will be used for the variable named "example_variable". An argument selector is specified to configure an argument applicable to the variable.<p>
+<h6 class=CaptionFigColumn id=header>API Information: </h6>Value of the attribute <b>argumentSelector</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.debug.ui.stringsubstitution.IArgumentSelector</b>.<p>
+<h6 class=CaptionFigColumn id=copyright-text>
+<p>
+<a href="hglegal.htm">
+ <img SRC="ngibmcpy.gif"
+ ALT="Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved."
+ BORDER=0 height=14 width=324></a>
+</p><p>
+</h6>
+</BODY>
+</HTML>
diff --git a/org.eclipse.debug.ui/doc/schema.css b/org.eclipse.debug.ui/doc/schema.css
new file mode 100644
index 000000000..f72a99344
--- /dev/null
+++ b/org.eclipse.debug.ui/doc/schema.css
@@ -0,0 +1,30 @@
+H6.CaptionFigColumn#header {
+ font-size:16px;
+ display:inline
+}
+
+H6.CaptionFigColumn#copyright-text {
+ font-size: smaller;
+ font-style: normal;
+ color: #336699;
+ display:inline
+}
+
+P.Code#dtd {
+ color: #800000;
+ display: inline;
+}
+
+P.Code#tag {
+ color: #000080;
+ display:inline;
+}
+
+P.Code#cstring {
+ color: #008000;
+ display:inline;
+}
+
+
+
+
diff --git a/org.eclipse.debug.ui/plugin.properties b/org.eclipse.debug.ui/plugin.properties
index b05f1b9cf..b8f7dff16 100644
--- a/org.eclipse.debug.ui/plugin.properties
+++ b/org.eclipse.debug.ui/plugin.properties
@@ -99,21 +99,21 @@ TerminateAction.tooltip=Terminate
TerminateAllAction.label=Termi&nate All
TerminateAndRemoveAction.label=Terminate and Remo&ve
VariablesView.name=Variables
-SimpleVariablePreferencePage.name=Launch Variables
+StringVariablePreferencePage.name=String Substitution
#string subtitution variables
-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
+string_prompt.description=The text value entered into a prompting dialog
+file_prompt.description=The name of a file chosen in a file selection dialog
+folder_prompt.description=The name of a directory chosen in a folder selection dialog
container_loc.description=Absolute file system path of the folder containing the selected resource
-container_path.description=Full path, relative to the workspace root, of the folder containing the selected resource
+container_path.description=Workspace relative path of the folder containing the selected resource
container_name.description=Name of the folder containing selected resource
project_loc.description=Absolute file system path of the selected resource's project
-project_path.description=Full path, relative to the workspace root, of the selected resource's project
+project_path.description=Workspace relative path of the selected resource's project
project_name.description=Name of the selected resource's project
-resource_loc.description=Absolute file system path of the selected resource
-resource_path.description=Full path, relative to the workspace root, of the selected resource
-resource_name.description=Name of the selected resource
+resource_loc.description=Absolute file system path of the selected resource. Optionally, a specific resource may be specified as an argument.
+resource_path.description=Workspace relative path of the selected resource. Optionally, a specific resource may be specified as an argument.
+resource_name.description=Name of the selected resource. Optionally, a specific resource may be specified as an argument.
workspace_loc.description=Absolute file system path of the workspace
providerName=Eclipse.org
diff --git a/org.eclipse.debug.ui/plugin.xml b/org.eclipse.debug.ui/plugin.xml
index accb1e137..402cf026e 100644
--- a/org.eclipse.debug.ui/plugin.xml
+++ b/org.eclipse.debug.ui/plugin.xml
@@ -106,10 +106,10 @@
id="org.eclipse.debug.ui.DebugActionGroupsPreferencePage">
</page>
<page
- name="%SimpleVariablePreferencePage.name"
+ name="%StringVariablePreferencePage.name"
category="org.eclipse.debug.ui.DebugPreferencePage"
- class="org.eclipse.debug.internal.ui.preferences.SimpleLaunchVariablePreferencePage"
- id="org.eclipse.debug.ui.SimpleVariablePreferencePage">
+ class="org.eclipse.debug.internal.ui.preferences.StringVariablePreferencePage"
+ id="org.eclipse.debug.ui.StringVariablePreferencePage">
</page>
</extension>
<extension
@@ -1270,45 +1270,6 @@
configuration="org.eclipse.ui.defaultAcceleratorConfiguration">
</keyBinding>
</extension>
-<!-- Context Variable Extensions -->
- <extension
- point="org.eclipse.debug.core.contextLaunchVariables">
- <variable
- name="string_prompt"
- expanderClass="org.eclipse.debug.internal.ui.launchVariables.StringPromptExpander"
- description="%string_prompt.description">
- </variable>
- <variable
- name="file_prompt"
- expanderClass="org.eclipse.debug.internal.ui.launchVariables.FilePromptExpander"
- description="%file_prompt.description">
- </variable>
- <variable
- name="folder_prompt"
- expanderClass="org.eclipse.debug.internal.ui.launchVariables.FolderPromptExpander"
- description="%folder_prompt.description">
- </variable>
- </extension>
-<!-- Variable Components -->
- <extension
- point="org.eclipse.debug.ui.launchVariableComponents">
- <component
- componentClass="org.eclipse.debug.internal.ui.launchVariables.ResourceComponent"
- variableName="resource_path">
- </component>
- <component
- componentClass="org.eclipse.debug.internal.ui.launchVariables.ResourceComponent"
- variableName="resource_loc">
- </component>
- <component
- componentClass="org.eclipse.debug.internal.ui.launchVariables.ResourceComponent"
- variableName="resource_name">
- </component>
- <component
- componentClass="org.eclipse.debug.internal.ui.launchVariables.ResourceComponent"
- variableName="resource">
- </component>
- </extension>
<extension
point="org.eclipse.ui.workbench.texteditor.markerAnnotationSpecification">
@@ -1398,6 +1359,23 @@
</variable>
</extension>
+<!-- String Variable Presentations -->
+ <extension
+ point="org.eclipse.debug.ui.stringVariablePresentations">
+ <variablePresentation
+ argumentSelector="org.eclipse.debug.internal.ui.stringsubstitution.ResourceSelector"
+ variableName="resource_path">
+ </variablePresentation>
+ <variablePresentation
+ argumentSelector="org.eclipse.debug.internal.ui.stringsubstitution.ResourceSelector"
+ variableName="resource_loc">
+ </variablePresentation>
+ <variablePresentation
+ argumentSelector="org.eclipse.debug.internal.ui.stringsubstitution.ResourceSelector"
+ variableName="resource_name">
+ </variablePresentation>
+ </extension>
+
<!-- Launch Config Comparators -->
<extension
point="org.eclipse.debug.core.launchConfigurationComparators">
diff --git a/org.eclipse.debug.ui/schema/stringVariablePresentations.exsd b/org.eclipse.debug.ui/schema/stringVariablePresentations.exsd
new file mode 100644
index 000000000..70b7a4f59
--- /dev/null
+++ b/org.eclipse.debug.ui/schema/stringVariablePresentations.exsd
@@ -0,0 +1,111 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.debug.ui">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.debug.ui" id="stringVariablePresentations" name="String Variable Presentations"/>
+ </appInfo>
+ <documentation>
+ This extension point provides a mechanism for contributing a user interface/presentation for a string substitution variable (i.e. a context variable or value variable).
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence>
+ <element ref="variablePresentation" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+ a fully qualified identifier of the target extension point
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+ an optional identifier of the extension instance
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+ an optional name of the extension instance
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="variablePresentation">
+ <complexType>
+ <attribute name="variableName" type="string" use="required">
+ <annotation>
+ <documentation>
+ specifies the variable this presentation is for
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="argumentSelector" type="string" use="required">
+ <annotation>
+ <documentation>
+ specifies a fully qualified name of a Java class that implements IArgumentSelector
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 2.1
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ The following is an example of a variable presentation contribution:
+&lt;pre&gt;
+&lt;extension point=&quot;org.eclipse.debug.ui.stringVariablePresentations&quot;&gt;
+ &lt;variablePresentation
+ variableName=&quot;example_variable&quot;
+ argumentSelector=&quot;com.example.ExampleArgumentChooser&quot;&gt;
+ &lt;/variablePresentation&gt;
+&lt;/extension&gt;
+&lt;/pre&gt;
+In the above example, the contributed presentation will be used for the variable named &quot;example_variable&quot;. An argument selector is specified to configure an argument applicable to the variable.
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ Value of the attribute &lt;b&gt;argumentSelector&lt;/b&gt; must be a fully qualified name of a Java class that implements the interface &lt;b&gt;org.eclipse.debug.ui.stringsubstitution.IArgumentSelector&lt;/b&gt;.
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ &lt;p&gt;
+&lt;a href=&quot;hglegal.htm&quot;&gt;
+ &lt;img SRC=&quot;ngibmcpy.gif&quot;
+ ALT=&quot;Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved.&quot;
+ BORDER=0 height=14 width=324&gt;&lt;/a&gt;
+&lt;/p&gt;
+ </documentation>
+ </annotation>
+
+</schema>
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 481de1248..6b1eb5c73 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
@@ -43,7 +43,6 @@ import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
import org.eclipse.debug.internal.ui.launchConfigurations.PerspectiveManager;
-import org.eclipse.debug.internal.ui.launchVariables.ContextVariableComponentManager;
import org.eclipse.debug.internal.ui.preferences.DebugActionGroupsManager;
import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
import org.eclipse.debug.internal.ui.stringsubstitution.SelectedResourceManager;
@@ -51,8 +50,6 @@ import org.eclipse.debug.internal.ui.views.console.ConsoleDocumentManager;
import org.eclipse.debug.internal.ui.views.variables.ObjectBrowserManager;
import org.eclipse.debug.ui.IDebugModelPresentation;
import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.launchVariables.ILaunchVariableComponentManager;
-import org.eclipse.debug.ui.launchVariables.LaunchVariableContextManager;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
@@ -123,8 +120,6 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener {
*/
private ObjectBrowserManager fObjectBrowserManager;
- private ContextVariableComponentManager fVariableComponentManager;
-
/**
* Returns whether the debug UI plug-in is in trace
* mode.
@@ -167,13 +162,6 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener {
return fObjectBrowserManager;
}
- public ILaunchVariableComponentManager getVariableComponentManager() {
- if (fVariableComponentManager == null) {
- fVariableComponentManager = new ContextVariableComponentManager();
- }
- return fVariableComponentManager;
- }
-
/**
* Returns the singleton instance of the debug plugin.
*/
@@ -326,8 +314,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener {
getStandardDisplay().asyncExec(
new Runnable() {
public void run() {
- //initialize the variable context manager
- LaunchVariableContextManager.getDefault();
+ //initialize the selected resource manager
SelectedResourceManager.getDefault();
}
});
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/ContextVariableComponentManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/ContextVariableComponentManager.java
deleted file mode 100644
index 6936dbc01..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/ContextVariableComponentManager.java
+++ /dev/null
@@ -1,128 +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.debug.internal.ui.launchVariables;
-
-import java.text.MessageFormat;
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.launchVariables.AbstractVariableComponent;
-import org.eclipse.debug.ui.launchVariables.ILaunchVariableComponentManager;
-import org.eclipse.debug.ui.launchVariables.IVariableComponent;
-import org.eclipse.debug.ui.launchVariables.IVariableComponentContainer;
-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;
-
-/**
- * Manager which returns the variable editing component associated with
- * a context variable. If the variable is not a context variable or no
- * component is associated with a variable, a default (empty) component is returned.
- */
-public class ContextVariableComponentManager implements ILaunchVariableComponentManager {
-
- private HashMap fVariableMap= new HashMap();
- private static final IVariableComponent defaultComponent = new DefaultVariableComponent(false);
-
- private static final String ELEMENT_COMPONENT= "component"; //$NON-NLS-1$
- private static final String ATTR_VARIABLE_NAME= "variableName"; //$NON-NLS-1$
- private static final String ATTR_COMPONENT_CLASS= "componentClass"; //$NON-NLS-1$
-
- public ContextVariableComponentManager() {
- loadComponentExtensions();
- }
-
- public IVariableComponent getComponent(String variableName) {
- Object object= fVariableMap.get(variableName);
- IVariableComponent component= defaultComponent;
- if (object instanceof IVariableComponent) {
- component= (IVariableComponent) object;
- } else if (object instanceof IConfigurationElement) {
- IConfigurationElement element= (IConfigurationElement) object;
- if (element.getAttribute(ATTR_COMPONENT_CLASS) != null) {
- try {
- component= (IVariableComponent) element.createExecutableExtension(ATTR_COMPONENT_CLASS);
- } catch (CoreException e) {
- component= new DefaultVariableComponent(true);
- DebugUIPlugin.log(DebugUIPlugin.newErrorStatus(MessageFormat.format("Failed to load variable component for {0}", new String[] {element.getAttribute(ATTR_VARIABLE_NAME)}), e)); //$NON-NLS-1$
- }
- }
- fVariableMap.put(variableName, component);
- }
- return component;
- }
-
- public void loadComponentExtensions() {
- IExtensionPoint point= DebugUIPlugin.getDefault().getDescriptor().getExtensionPoint(IDebugUIConstants.EXTENSION_POINT_LAUNCH_VARIABLE_COMPONENTS);
- IConfigurationElement elements[]= point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- IConfigurationElement element = elements[i];
- if (!element.getName().equals(ELEMENT_COMPONENT)) {
- DebugUIPlugin.logErrorMessage(MessageFormat.format("Invalid variable component extension found: {0}", new String[] {element.getDeclaringExtension().getLabel()})); //$NON-NLS-1$
- continue;
- }
- String variableName= element.getAttribute(ATTR_VARIABLE_NAME);
- if (variableName == null) {
- DebugUIPlugin.logErrorMessage(MessageFormat.format("Invalid variable component extension found: {0}", new String[] {element.getDeclaringExtension().getLabel()})); //$NON-NLS-1$
- continue;
- }
- if (element.getAttribute(ATTR_COMPONENT_CLASS) == null) {
- DebugUIPlugin.logErrorMessage(MessageFormat.format("Invalid variable component extension found. No component specified for {0}", new String[] {variableName})); //$NON-NLS-1$
- continue;
- }
- fVariableMap.put(variableName, element);
- }
- }
-
- /**
- * Default variable component implementation which does not
- * allow variable value editing visually.
- */
- private static class DefaultVariableComponent extends AbstractVariableComponent {
- private boolean showError = false;
- private Label message = null;
-
- public DefaultVariableComponent(boolean showError) {
- super();
- this.showError = showError;
- }
-
- /* (non-Javadoc)
- * Method declared on IVariableComponent.
- */
- public Control getControl() {
- return message;
- }
-
- /* (non-Javadoc)
- * Method declared on IVariableComponent.
- */
- public void createContents(Composite parent, String varTag, IVariableComponentContainer page) {
- container= page;
- if (showError) {
- message = new Label(parent, SWT.NONE);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- message.setLayoutData(data);
- message.setFont(parent.getFont());
- message.setText(LaunchVariableMessages.getString("DefaultVariableComponent.0")); //$NON-NLS-1$
- message.setForeground(JFaceColors.getErrorText(message.getDisplay()));
- }
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/FilePromptExpander.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/FilePromptExpander.java
deleted file mode 100644
index 1bdd608aa..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/FilePromptExpander.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 Matt Conway and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Matt Conway - initial implementation
- * IBM Corporation - integration and code cleanup
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchVariables;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.swt.widgets.FileDialog;
-
-/**
- * Prompts the user to choose a file and expands the selection
- */
-public class FilePromptExpander extends PromptExpanderBase {
- public FilePromptExpander() {
- super();
- }
-
- /**
- * Prompts the user to choose a file
- * @see PromptExpanderBase#prompt()
- */
- public void prompt() {
- FileDialog dialog = new FileDialog(DebugUIPlugin.getStandardDisplay().getActiveShell());
- dialog.setText(dialogMessage);
- dialog.setFileName(lastValue == null ? defaultValue : lastValue);
- dialogResultString = dialog.open();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/FolderPromptExpander.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/FolderPromptExpander.java
deleted file mode 100644
index 6dcf4f453..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/FolderPromptExpander.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 Matt Conway and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Matt Conway - initial implementation
- * IBM Corporation - integration and code cleanup
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchVariables;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.swt.widgets.DirectoryDialog;
-
-/**
- * Prompts the user to choose a folder and expands the selection
- */
-public class FolderPromptExpander extends PromptExpanderBase {
-
- public FolderPromptExpander() {
- super();
- }
-
- /**
- * Prompts the user to choose a folder.
- * @see PromptExpanderBase#prompt()
- */
- public void prompt() {
- DirectoryDialog dialog = new DirectoryDialog(DebugUIPlugin.getStandardDisplay().getActiveShell());
- dialog.setText(dialogMessage);
- dialog.setFilterPath(lastValue == null ? defaultValue : lastValue);
- dialogResultString = dialog.open();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/LaunchVariableMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/LaunchVariableMessages.java
deleted file mode 100644
index 422e68073..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/LaunchVariableMessages.java
+++ /dev/null
@@ -1,31 +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.debug.internal.ui.launchVariables;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class LaunchVariableMessages {
-
- private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.launchVariables.LaunchVariableMessages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private LaunchVariableMessages() {
- }
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/LaunchVariableMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/LaunchVariableMessages.properties
deleted file mode 100644
index 827835327..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/LaunchVariableMessages.properties
+++ /dev/null
@@ -1,48 +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
-###############################################################################
-
-RefreshTab.0=Recursively &include sub-folders
-RefreshTab.2=Unable to restore working set - no factory ID.
-RefreshTab.3=Unable to restore working set - cannot instantiate factory:
-RefreshTab.4=Unable to restore working set - cannot instantiate working set:
-RefreshTab.5=Unable to restore working set - element is not an IWorkingSet:
-RefreshTab.6=Refresh
-RefreshTab.7=Refresh resources...
-RefreshTab.8=Exception(s) occurred during refresh.
-RefreshTab.31=Refresh resources &upon completion.
-RefreshTab.32=The &entire workspace
-RefreshTab.33=The se&lected resource
-RefreshTab.34=The &project containing the selected resource
-RefreshTab.35=The f&older containing the selected resource
-RefreshTab.36=&Specific resources
-RefreshTab.37=Specify &Resources...
-RefreshTab.38=Refresh scope refers to non-existant resource {0}
-RefreshTab.39=Refresh scope invalid
-RefreshTab.40=workingSet
-RefreshTab.42=Must select resources to refresh.
-
-DefaultVariableComponent.0=Problem displaying UI component of selected variable.
-ResourceComponent.0=Use &selected resource
-ResourceComponent.1=Us&e specific resource:
-ResourceComponent.2=A specific resource must be selected from the list.
-WorkingSetComponent.4=A working set must be specified.
-PromptExpanderBase.0=Please input a value for {0}
-PromptExpanderBase.1=Please input a value
-StringPromptExpander.0=Variable input
-
-WorkingSetExpander.6=No working set specified.
-WorkingSetExpander.7=No working set could be constructed named {0}.
-VariableSelectionDialog.0=Select variable
-VariableSelectionDialog.1=&Context variables
-VariableSelectionDialog.2=&Simple variables
-VariableSelectionDialog.3=Choose a &variable:
-VariableSelectionDialog.4=Invalid selection
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/PromptExpanderBase.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/PromptExpanderBase.java
deleted file mode 100644
index 224863118..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/PromptExpanderBase.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 Matt Conway and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Matt Conway - initial implementation
- * IBM Corporation - integration and code cleanup
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchVariables;
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.variables.DefaultVariableExpander;
-import org.eclipse.debug.core.variables.ExpandVariableContext;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-
-/**
- * Base implementation for variable expanders that prompt the user
- * for their value.
- */
-abstract class PromptExpanderBase extends DefaultVariableExpander {
-
- /**
- * A hint that helps the user choose their input. If a prompt
- * hint is provider the user will be prompted:
- * Please input a value for <code>promptHint</code>
- */
- protected String promptHint = null;
- /**
- * The prompt displayed to the user.
- */
- protected String dialogMessage = null;
- /**
- * The default value selected when the prompt is displayed
- */
- protected String defaultValue = null;
- /**
- * The last value chosen by the user for this variable
- */
- protected String lastValue = null;
- /**
- * The result returned from the prompt dialog
- */
- protected String dialogResultString = null;
-
- /**
- * Prompts the user for input and returns a string representation of
- * the user's selection.
- */
- public String getText(String varTag, String varValue, ExpandVariableContext context) throws CoreException {
- String varText = null;
- setupDialog(varValue);
-
- DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
- public void run() {
- prompt();
- }
- });
- if (dialogResultString != null) {
- varText = dialogResultString;
- lastValue = dialogResultString;
- }
- return varText;
- }
-
- /**
- * Presents the user with the appropriate prompt for the variable to be expanded
- * and sets the <code>dialogResultString</code> based on the user's selection.
- */
- public abstract void prompt();
-
- /**
- * Initializes values displayed when the user is prompted. If
- * a prompt hint and default value are supplied in the given
- * variable value, these are extracted for presentation
- *
- * @param varValue the value of the variable from which the prompt
- * hint and default value will be extracted
- */
- protected void setupDialog(String varValue) {
- promptHint = null;
- defaultValue = null;
- dialogResultString = null;
- if (varValue != null) {
- int idx = varValue.indexOf(':');
- if (idx != -1) {
- promptHint = varValue.substring(0, idx);
- defaultValue = varValue.substring(idx + 1);
- } else {
- promptHint = varValue;
- }
- }
-
- if (promptHint != null) {
- dialogMessage = MessageFormat.format(LaunchVariableMessages.getString("PromptExpanderBase.0"), new String[] {promptHint}); //$NON-NLS-1$
- } else {
- dialogMessage = LaunchVariableMessages.getString("PromptExpanderBase.1"); //$NON-NLS-1$
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/ResourceComponent.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/ResourceComponent.java
deleted file mode 100644
index 63d278d72..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/ResourceComponent.java
+++ /dev/null
@@ -1,221 +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.debug.internal.ui.launchVariables;
-
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.debug.ui.launchVariables.AbstractVariableComponent;
-import org.eclipse.debug.ui.launchVariables.IVariableComponentContainer;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-/**
- * Visual component to edit the resource type variable
- * value.
- * @since 3.0
- */
-public class ResourceComponent extends AbstractVariableComponent {
- protected Button selectedResourceButton;
- protected Button specificResourceButton;
- protected TreeViewer resourceList;
- private IResource selectedResource;
- private boolean selectedResourceVariable= true;
-
- /**
- * Creates the component
- */
- public ResourceComponent() {
- super();
- }
-
- /**
- * @see IVariableComponent#createContents(Composite, String, IVariableComponentContainer)
- */
- public void createContents(Composite parent, String varTag, IVariableComponentContainer componentContainer) {
- super.createContents(parent, varTag, componentContainer); // Creates the main group and sets the page
-
- createSelectedResourceOption();
- createSpecificResourceOption();
- createResourceList();
- }
-
- /**
- * Creates the list of resources.
- */
- protected void createResourceList() {
- Tree tree = new Tree(mainGroup, SWT.SINGLE | SWT.BORDER);
- GridData data = new GridData(GridData.FILL_BOTH);
- data.heightHint = tree.getItemHeight() * 8;
- tree.setLayoutData(data);
- tree.setFont(mainGroup.getFont());
- tree.setEnabled(false);
-
- resourceList = new TreeViewer(tree);
- resourceList.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- selectedResource= (IResource) ((IStructuredSelection)event.getSelection()).getFirstElement();
- validate();
- }
- });
- resourceList.setContentProvider(new WorkbenchContentProvider());
- resourceList.setLabelProvider(new WorkbenchLabelProvider());
- resourceList.setInput(ResourcesPlugin.getWorkspace().getRoot());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.launchVariables.IVariableComponent#setEnabled(boolean)
- */
- public void setEnabled(boolean enabled) {
- mainGroup.setEnabled(enabled);
- resourceList.getTree().setEnabled(specificResourceButton.getSelection());
- }
-
- /**
- * Creates the option button for using the selected
- * resource.
- */
- private void createSelectedResourceOption() {
- selectedResourceButton = new Button(mainGroup, SWT.RADIO);
- selectedResourceButton.setText(LaunchVariableMessages.getString("ResourceComponent.0")); //$NON-NLS-1$
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- selectedResourceButton.setLayoutData(data);
- selectedResourceButton.setFont(mainGroup.getFont());
- selectedResourceButton.setSelection(true);
- }
-
- /**
- * Creates the option button for using a specific
- * resource.
- */
- private void createSpecificResourceOption() {
- specificResourceButton = new Button(mainGroup, SWT.RADIO);
- specificResourceButton.setText(LaunchVariableMessages.getString("ResourceComponent.1")); //$NON-NLS-1$
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- specificResourceButton.setLayoutData(data);
- specificResourceButton.setFont(mainGroup.getFont());
- specificResourceButton.setSelection(false);
-
- specificResourceButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateResourceListEnablement();
- getContainer().updateValidState();
- selectedResourceVariable= !specificResourceButton.getSelection();
- }
- });
- }
-
- /* (non-Javadoc)
- * Method declared on IVariableComponent.
- */
- public String getVariableValue() {
- if (selectedResourceVariable) {
- return null;
- }
-
- if (resourceList != null) {
- if (selectedResource != null) {
- return selectedResource.getFullPath().toString();
- }
- }
-
- return null;
- }
-
- /**
- * Updates the enablement of the resource list if needed
- */
- private void updateResourceListEnablement() {
- if (specificResourceButton != null && resourceList != null) {
- Tree tree= resourceList.getTree();
- tree.setEnabled(specificResourceButton.getSelection());
- if (tree.getItemCount() > 0) {
- tree.setSelection(new TreeItem[]{tree.getItems()[0]});
- selectedResource= (IResource)tree.getSelection()[0].getData();
- }
-
- validate();
- }
- }
-
- /* (non-Javadoc)
- * Method declared on IVariableComponent.
- */
- public void setVariableValue(String varValue) {
- if (varValue == null || varValue.length() == 0) {
- if (selectedResourceButton != null) {
- selectedResourceButton.setSelection(true);
- }
- if (specificResourceButton != null) {
- specificResourceButton.setSelection(false);
- }
- if (resourceList != null) {
- resourceList.getTree().setEnabled(false);
- }
- } else {
- if (selectedResourceButton != null) {
- selectedResourceButton.setSelection(false);
- }
- if (specificResourceButton != null) {
- specificResourceButton.setSelection(true);
- }
- if (resourceList != null) {
- resourceList.getTree().setEnabled(true);
- IResource member = ResourcesPlugin.getWorkspace().getRoot().findMember(varValue);
- if (member != null) {
- resourceList.setSelection(new StructuredSelection(member), true);
- } else {
- resourceList.setSelection(StructuredSelection.EMPTY);
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * Method declared on IVariableComponent.
- */
- public void validate() {
- getContainer().setErrorMessage(null);
- setIsValid(true);
- if (specificResourceButton != null && specificResourceButton.getSelection()) {
- validateResourceListSelection();
- }
- getContainer().updateValidState();
- }
-
- /**
- * Validates the resource selection list. If no resource is selected, the
- * component is updated with an error message and isValid is set
- * <code>false</code>
- */
- private void validateResourceListSelection() {
- if (resourceList == null) {
- return;
- }
- if (resourceList.getSelection().isEmpty()) {
- getContainer().setErrorMessage(LaunchVariableMessages.getString("ResourceComponent.2")); //$NON-NLS-1$
- setIsValid(false);
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/StringPromptExpander.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/StringPromptExpander.java
deleted file mode 100644
index bd6417fbf..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchVariables/StringPromptExpander.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 Matt Conway and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * Matt Conway - initial implementation
- * IBM Corporation - integration and code cleanup
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchVariables;
-
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.window.Window;
-
-/**
- * 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, LaunchVariableMessages.getString("StringPromptExpander.0"), dialogMessage, lastValue == null ? defaultValue : lastValue, null); //$NON-NLS-1$
- int dialogResult = dialog.open();
- if (dialogResult == Window.OK) {
- dialogResultString = dialog.getValue();
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties
index ed1eaa332..48c6d12e5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties
@@ -68,15 +68,15 @@ ProcessPropertyPage.Command_Line__1=Command Line:
SimpleVariablePreferencePage.3=Variable
SimpleVariablePreferencePage.4=Value
SimpleVariablePreferencePage.5=Description
-SimpleVariablePreferencePage.6=&Create and configure simple launch variables.
+SimpleVariablePreferencePage.6=&Create and configure string substitution variables.
SimpleVariablePreferencePage.7=&New...
SimpleVariablePreferencePage.8=&Edit...
SimpleVariablePreferencePage.9=&Remove
SimpleVariablePreferencePage.10=&Name:
SimpleVariablePreferencePage.11=&Value:
SimpleVariablePreferencePage.12=&Description:
-SimpleVariablePreferencePage.13=New Launch Variable
-SimpleVariablePreferencePage.14=Edit Launch Variable
+SimpleVariablePreferencePage.13=New String Substitution Variable
+SimpleVariablePreferencePage.14=Edit String Substitution Variable
SimpleVariablePreferencePage.15=Overwrite variable?
SimpleVariablePreferencePage.16=A variable named {0} already exists. Overwrite?
SimpleLaunchVariablePreferencePage.21=Remove Contributed Variables
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/SimpleLaunchVariablePreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java
index 8ffce216a..c394416bf 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/SimpleLaunchVariablePreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java
@@ -15,9 +15,11 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.variables.ILaunchVariableManager;
-import org.eclipse.debug.core.variables.ISimpleLaunchVariable;
+import org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager;
+import org.eclipse.debug.internal.core.stringsubstitution.IValueVariable;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.internal.ui.SWTUtil;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -62,10 +64,10 @@ import org.eclipse.ui.help.WorkbenchHelp;
* Preference page for creating and configuring simple
* launch variables.
*
- * @see org.eclipse.debug.core.variables.ISimpleLaunchVariable
+ * @see org.eclipse.debug.core.variables.IValueVariable
* @see org.eclipse.debug.core.variables.ISimpleVariableRegistry
*/
-public class SimpleLaunchVariablePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+public class StringVariablePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
private TableViewer variableTable;
protected Button envAddButton;
@@ -94,7 +96,7 @@ public class SimpleLaunchVariablePreferencePage extends PreferencePage implement
new ColumnWeightData(34)
};
- public SimpleLaunchVariablePreferencePage() {
+ public StringVariablePreferencePage() {
setDescription(DebugPreferencesMessages.getString("SimpleVariablePreferencePage.6")); //$NON-NLS-1$
}
@@ -152,6 +154,18 @@ public class SimpleLaunchVariablePreferencePage extends PreferencePage implement
variableTable.getControl().setLayoutData(gridData);
variableTable.setContentProvider(variableContentProvider);
variableTable.setColumnProperties(variableTableColumnProperties);
+ variableTable.setSorter(new ViewerSorter() {
+ public int compare(Viewer iViewer, Object e1, Object e2) {
+ if (e1 == null) {
+ return -1;
+ } else if (e2 == null) {
+ return 1;
+ } else {
+ return ((IValueVariable)e1).getName().compareToIgnoreCase(((IValueVariable)e2).getName());
+ }
+ }
+ });
+
variableTable.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
handleTableSelectionChanged(event);
@@ -232,9 +246,9 @@ public class SimpleLaunchVariablePreferencePage extends PreferencePage implement
}
String name= dialog.getValue(NAME_LABEL).trim();
if (name != null && name.length() > 0) {
- String value= dialog.getValue(VALUE_LABEL);
String description= dialog.getValue(DESCRIPTION_LABEL);
- ISimpleLaunchVariable variable= DebugPlugin.getDefault().getLaunchVariableManager().newSimpleVariable(name, value, description, false);
+ IValueVariable variable= getVariableManager().newValueVariable(name, description);
+ variable.setValue(dialog.getValue(VALUE_LABEL));
addVariable(variable);
}
}
@@ -246,30 +260,30 @@ public class SimpleLaunchVariablePreferencePage extends PreferencePage implement
* @param variable the variable to add
* @return whether the variable was added
*/
- public boolean addVariable(ISimpleLaunchVariable variable) {
+ public boolean addVariable(IValueVariable variable) {
String name= variable.getName();
- List editedVariables= variableContentProvider.getEditedVariables();
+ List editedVariables= variableContentProvider.getVariables();
Iterator iter= editedVariables.iterator();
while (iter.hasNext()) {
- ISimpleLaunchVariable currentVariable = (ISimpleLaunchVariable) iter.next();
+ IValueVariable currentVariable = (IValueVariable) iter.next();
String variableName = currentVariable.getName();
if (variableName.equals(name)) {
boolean overWrite= MessageDialog.openQuestion(getShell(), DebugPreferencesMessages.getString("SimpleVariablePreferencePage.15"), MessageFormat.format(DebugPreferencesMessages.getString("SimpleVariablePreferencePage.16"), new String[] {name})); //$NON-NLS-1$ //$NON-NLS-2$
if (!overWrite) {
return false;
}
- variableContentProvider.removeVariable(currentVariable);
+ variableContentProvider.removeVariables(new IValueVariable[]{currentVariable});
break;
}
}
- variableContentProvider.addVariable(variable);
+ variableContentProvider.addVariables(new IValueVariable[]{variable});
variableTable.refresh();
return true;
}
private void handleEditButtonPressed() {
IStructuredSelection selection= (IStructuredSelection) variableTable.getSelection();
- ISimpleLaunchVariable variable= (ISimpleLaunchVariable) selection.getFirstElement();
+ IValueVariable variable= (IValueVariable) selection.getFirstElement();
if (variable == null) {
return;
}
@@ -288,8 +302,8 @@ public class SimpleLaunchVariablePreferencePage extends PreferencePage implement
value= dialog.getValue(VALUE_LABEL);
description= dialog.getValue(DESCRIPTION_LABEL);
if (!name.equals(originalName)) {
- if (addVariable(DebugPlugin.getDefault().getLaunchVariableManager().newSimpleVariable(name, value, description, false))) {
- variableContentProvider.removeVariable(variable);
+ if (addVariable(getVariableManager().newValueVariable(name, description))) {
+ variableContentProvider.removeVariables(new IValueVariable[]{variable});
variableTable.refresh();
}
} else {
@@ -313,7 +327,7 @@ public class SimpleLaunchVariablePreferencePage extends PreferencePage implement
StringBuffer contributedVariablesToRemove= new StringBuffer();
Iterator iter= variablesToRemove.iterator();
while (iter.hasNext()) {
- ISimpleLaunchVariable variable = (ISimpleLaunchVariable) iter.next();
+ IValueVariable variable = (IValueVariable) iter.next();
if (variable.isContributed()) {
contributedVariablesToRemove.append('\t').append(variable.getName()).append('\n');
}
@@ -324,7 +338,7 @@ public class SimpleLaunchVariablePreferencePage extends PreferencePage implement
return;
}
}
- ISimpleLaunchVariable[] variables= (ISimpleLaunchVariable[]) variablesToRemove.toArray(new ISimpleLaunchVariable[0]);
+ IValueVariable[] variables= (IValueVariable[]) variablesToRemove.toArray(new IValueVariable[0]);
variableContentProvider.removeVariables(variables);
variableTable.refresh();
}
@@ -343,14 +357,6 @@ public class SimpleLaunchVariablePreferencePage extends PreferencePage implement
}
/**
- * Revert to the previously saved state.
- */
- public boolean performCancel() {
- variableContentProvider.discardChanges();
- return super.performCancel();
- }
-
- /**
* Clear the variables.
*/
protected void performDefaults() {
@@ -372,8 +378,8 @@ public class SimpleLaunchVariablePreferencePage extends PreferencePage implement
* launch variable manager
* @return the singleton instance of the simple variable registry.
*/
- private ILaunchVariableManager getVariableManager() {
- return DebugPlugin.getDefault().getLaunchVariableManager();
+ private IStringVariableManager getVariableManager() {
+ return DebugPlugin.getDefault().getStringVariableManager();
}
private class SimpleVariableContentProvider implements IStructuredContentProvider {
@@ -382,72 +388,78 @@ public class SimpleLaunchVariablePreferencePage extends PreferencePage implement
* The edited variables are saved to the launch manager when saveChanges()
* is called.
*/
- private List editedVariables= new ArrayList();
- private ILaunchVariableManager variableManager;
+ private List fVariables = new ArrayList();
public Object[] getElements(Object inputElement) {
- return editedVariables.toArray();
+ return fVariables.toArray();
}
+
+ /**
+ * Removes the given variables from the 'copied list'
+ *
+ * @param variables variables to remove
+ */
+ public void removeVariables(IValueVariable[] variables) {
+ for (int i = 0; i < variables.length; i++) {
+ fVariables.remove(variables[i]);
+ }
+ }
+
+ /**
+ * Adds the given variables to the 'copied list'
+ *
+ * @param variables variables to add
+ */
+ public void addVariables(IValueVariable[] variables) {
+ for (int i = 0; i < variables.length; i++) {
+ fVariables.add(variables[i]);
+ }
+ }
+
public void dispose() {
}
+
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (newInput == null || !(newInput instanceof ILaunchVariableManager)){
+ if (newInput == null || !(newInput instanceof IStringVariableManager)){
return;
}
- variableManager= (ILaunchVariableManager) newInput;
discardChanges();
- if (viewer instanceof TableViewer){
- ((TableViewer)viewer).setSorter(new ViewerSorter() {
- public int compare(Viewer iViewer, Object e1, Object e2) {
- if (e1 == null) {
- return -1;
- } else if (e2 == null) {
- return 1;
- } else {
- return ((ISimpleLaunchVariable)e1).getName().compareToIgnoreCase(((ISimpleLaunchVariable)e2).getName());
- }
- }
- });
- }
- }
- public void addVariable(ISimpleLaunchVariable variable) {
- editedVariables.add(variable);
}
- public void removeVariables(ISimpleLaunchVariable[] variables) {
- for (int i= 0; i < variables.length; i++) {
- removeVariable(variables[i]);
+
+ /**
+ * Saves the edited variable state to the variable manager.
+ */
+ public void saveChanges() {
+ IStringVariableManager manager = getVariableManager();
+ manager.removeVariables(manager.getValueVariables());
+ try {
+ manager.addVariables((IValueVariable[]) fVariables.toArray(new IValueVariable[0]));
+ } catch (CoreException e) {
+ DebugUIPlugin.errorDialog(getShell(), "Error", "Unable to save changes", e.getStatus());
}
}
- public void removeVariable(ISimpleLaunchVariable variable) {
- editedVariables.remove(variable);
- }
- public List getEditedVariables() {
- return editedVariables;
- }
+
/**
- * Discards the edited variable state and restores the variables from the
- * variable manager.
+ * Re-initializes to the variables currently stored in the manager.
*/
public void discardChanges() {
- if (variableManager == null) {
- return;
- }
- editedVariables.clear();
- ISimpleLaunchVariable[] simpleVariables= variableManager.getSimpleVariables();
- for (int i = 0; i < simpleVariables.length; i++) {
- ISimpleLaunchVariable variable= simpleVariables[i];
- editedVariables.add(variableManager.newSimpleVariable(variable.getName(), variable.getValue(), variable.getDescription(), variable.isContributed()));
- }
+ IStringVariableManager manager = getVariableManager();
+ IValueVariable[] variables = manager.getValueVariables();
+ for (int i = 0; i < variables.length; i++) {
+ IValueVariable variable = variables[i];
+ IValueVariable copy = manager.newValueVariable(variable.getName(), variable.getDescription());
+ copy.setValue(variable.getValue());
+ fVariables.add(copy);
+ }
}
+
/**
- * Saves the edited variable state to the variable manager.
+ * Returns the 'working set' of variables
+ *
+ * @return the working set of variables (not yet saved)
*/
- public void saveChanges() {
- if (variableManager == null) {
- return;
- }
- variableManager.removeSimpleVariables(variableManager.getSimpleVariables());
- variableManager.addSimpleVariables((ISimpleLaunchVariable[]) editedVariables.toArray(new ISimpleLaunchVariable[0]));
+ public List getVariables() {
+ return fVariables;
}
}
@@ -456,8 +468,8 @@ public class SimpleLaunchVariablePreferencePage extends PreferencePage implement
return null;
}
public String getColumnText(Object element, int columnIndex) {
- if (element instanceof ISimpleLaunchVariable) {
- ISimpleLaunchVariable variable= (ISimpleLaunchVariable) element;
+ if (element instanceof IValueVariable) {
+ IValueVariable variable= (IValueVariable) element;
switch (columnIndex) {
case 0 :
StringBuffer buffer= new StringBuffer(variable.getName());
@@ -485,8 +497,8 @@ public class SimpleLaunchVariablePreferencePage extends PreferencePage implement
return null;
}
public Color getBackground(Object element) {
- if (element instanceof ISimpleLaunchVariable) {
- if (((ISimpleLaunchVariable) element).isContributed()) {
+ if (element instanceof IValueVariable) {
+ if (((IValueVariable) element).isContributed()) {
Display display= Display.getCurrent();
return display.getSystemColor(SWT.COLOR_INFO_BACKGROUND);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FilePromptExpander.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FilePrompt.java
index 06e21da9e..c870f14e2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FilePromptExpander.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FilePrompt.java
@@ -17,7 +17,7 @@ import org.eclipse.swt.widgets.FileDialog;
/**
* Prompts the user to choose a file and expands the selection
*/
-public class FilePromptExpander extends PromptingResolver {
+public class FilePrompt extends PromptingResolver {
/**
* Prompts the user to choose a file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringSubstitutionMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringSubstitutionMessages.properties
index 4669ee01f..b45656cea 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringSubstitutionMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringSubstitutionMessages.properties
@@ -12,6 +12,26 @@
PromptExpanderBase.0=Please input a value for {0}
PromptExpanderBase.1=Please input a value
+RefreshTab.0=Recursively &include sub-folders
+RefreshTab.2=Unable to restore working set - no factory ID.
+RefreshTab.3=Unable to restore working set - cannot instantiate factory:
+RefreshTab.4=Unable to restore working set - cannot instantiate working set:
+RefreshTab.5=Unable to restore working set - element is not an IWorkingSet:
+RefreshTab.6=Refresh
+RefreshTab.7=Refresh resources...
+RefreshTab.8=Exception(s) occurred during refresh.
+RefreshTab.31=Refresh resources &upon completion.
+RefreshTab.32=The &entire workspace
+RefreshTab.33=The se&lected resource
+RefreshTab.34=The &project containing the selected resource
+RefreshTab.35=The f&older containing the selected resource
+RefreshTab.36=&Specific resources
+RefreshTab.37=Specify &Resources...
+RefreshTab.38=Refresh scope refers to non-existant resource {0}
+RefreshTab.39=Refresh scope invalid
+RefreshTab.40=workingSet
+RefreshTab.42=Must select resources to refresh.
+
ResourceResolver.6=Variable references non-existant resource : {0}
ResourceResolver.7=Variable references empty selection: {0}
ResourceResolver.8=Variable not recognized: {0}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariableSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariableSelectionDialog.java
index e463e89eb..d6fd138cc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariableSelectionDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariableSelectionDialog.java
@@ -114,12 +114,22 @@ public class StringVariableSelectionDialog extends ElementListSelectionDialog {
gd.horizontalSpan = 2;
desc.setLayoutData(gd);
- fArgumentText = new Text(container, SWT.BORDER);
+ Composite args = new Composite(container, SWT.NONE);
+ layout = new GridLayout(2, false);
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ args.setLayout(layout);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ args.setLayoutData(gd);
+ args.setFont(container.getFont());
+
+ fArgumentText = new Text(args, SWT.BORDER);
fArgumentText.setFont(container.getFont());
gd = new GridData(GridData.FILL_HORIZONTAL);
fArgumentText.setLayoutData(gd);
- fArgumentButton = new Button(container, SWT.PUSH);
+ fArgumentButton = new Button(args, SWT.PUSH);
fArgumentButton.setFont(parent.getFont());
fArgumentButton.setText(StringSubstitutionMessages.getString("StringVariableSelectionDialog.7")); //$NON-NLS-1$
gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java
index ae0ecc437..4624e4113 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java
@@ -14,6 +14,7 @@ package org.eclipse.debug.ui;
import java.lang.reflect.InvocationTargetException;
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.core.runtime.IConfigurationElement;
@@ -46,7 +47,7 @@ import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationMan
import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog;
import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog;
import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension;
-import org.eclipse.debug.ui.launchVariables.ILaunchVariableComponentManager;
+import org.eclipse.debug.internal.ui.stringsubstitution.SelectedResourceManager;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.IPreferenceStore;
@@ -136,16 +137,6 @@ public class DebugUITools {
}
/**
- * Returns the variable component manager for the debug UI plugin.
- *
- * @return variable component manager
- * @since 3.0
- */
- public static ILaunchVariableComponentManager getVariableComponentManager() {
- return DebugUIPlugin.getDefault().getVariableComponentManager();
- }
-
- /**
* Returns a new debug model presentation that delegates to
* appropriate debug models.
* <p>
@@ -233,6 +224,18 @@ public class DebugUITools {
}
return null;
}
+
+ /**
+ * Returns the currently selected resource in the active workbench window,
+ * or <code>null</code> if none. If an editor is active, the resource adapater
+ * assocaited with the editor is returned, if any.
+ *
+ * @return selected resource or <code>null</code>
+ * @since 3.0
+ */
+ public static IResource getSelectedResource() {
+ return SelectedResourceManager.getDefault().getSelectedResource();
+ }
/**
* Returns the process associated with the current debug context.
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
index 736e163a1..b3ad9846b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
@@ -20,7 +20,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.variables.LaunchVariableUtil;
+import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.internal.ui.DebugPluginImages;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
@@ -99,7 +99,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
ILaunchConfiguration config = (ILaunchConfiguration) inputElement;
Map m;
try {
- m = config.getAttribute(LaunchVariableUtil.ATTR_ENVIRONMENT_VARIABLES, (Map) null);
+ m = config.getAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, (Map) null);
} catch (CoreException e) {
DebugUIPlugin.log(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IStatus.ERROR, "Error reading configuration", e)); //$NON-NLS-1$
return elements;
@@ -426,7 +426,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
public void initializeFrom(ILaunchConfiguration configuration) {
boolean append= true;
try {
- append = configuration.getAttribute(LaunchVariableUtil.ATTR_APPEND_ENVIRONMENT_VARIABLES, true);
+ append = configuration.getAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, true);
} catch (CoreException e) {
DebugUIPlugin.log(e.getStatus());
}
@@ -454,11 +454,11 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
map.put(var.getName(), var.getValue());
}
if (map.size() == 0) {
- configuration.setAttribute(LaunchVariableUtil.ATTR_ENVIRONMENT_VARIABLES, (Map) null);
+ configuration.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, (Map) null);
} else {
- configuration.setAttribute(LaunchVariableUtil.ATTR_ENVIRONMENT_VARIABLES, map);
+ configuration.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, map);
}
- configuration.setAttribute(LaunchVariableUtil.ATTR_APPEND_ENVIRONMENT_VARIABLES, appendEnvironment.getSelection());
+ configuration.setAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, appendEnvironment.getSelection());
}
/* (non-Javadoc)
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/RefreshTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java
index 7e6a44872..cacb050c4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/RefreshTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.ui.launchVariables;
+package org.eclipse.debug.ui;
import java.io.IOException;
@@ -33,10 +33,8 @@ import org.eclipse.debug.internal.ui.DebugPluginImages;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.launchVariables.LaunchVariableMessages;
import org.eclipse.debug.internal.ui.stringsubstitution.SelectedResourceManager;
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.debug.internal.ui.stringsubstitution.StringSubstitutionMessages;
import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
@@ -100,6 +98,17 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
// Working set
private IWorkingSet fWorkingSet;
+
+ /**
+ * XML tag used to designate the root of the persisted IWorkingSet
+ */
+ private static final String TAG_LAUNCH_CONFIGURATION_WORKING_SET= "launchConfigurationWorkingSet"; //$NON-NLS-1$
+
+ /**
+ * XML tag used for setting / getting the factory ID of the persisted IWorkingSet
+ * Bug 37143
+ */
+ private static final String TAG_FACTORY_ID = "factoryID"; //$NON-NLS-1$
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
@@ -119,7 +128,7 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
fRefreshButton = new Button(mainComposite, SWT.CHECK);
fRefreshButton.setFont(mainComposite.getFont());
- fRefreshButton.setText(LaunchVariableMessages.getString("RefreshTab.31")); //$NON-NLS-1$
+ fRefreshButton.setText(StringSubstitutionMessages.getString("RefreshTab.31")); //$NON-NLS-1$
gd = new GridData(GridData.BEGINNING);
fRefreshButton.setLayoutData(gd);
fRefreshButton.addSelectionListener(new SelectionAdapter() {
@@ -139,27 +148,27 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
gd.horizontalSpan = 2;
fGroup.setLayoutData(gd);
- fWorkspaceButton = createRadioButton(fGroup, LaunchVariableMessages.getString("RefreshTab.32")); //$NON-NLS-1$
+ fWorkspaceButton = createRadioButton(fGroup, StringSubstitutionMessages.getString("RefreshTab.32")); //$NON-NLS-1$
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
fWorkspaceButton.setLayoutData(gd);
- fResourceButton = createRadioButton(fGroup, LaunchVariableMessages.getString("RefreshTab.33")); //$NON-NLS-1$
+ fResourceButton = createRadioButton(fGroup, StringSubstitutionMessages.getString("RefreshTab.33")); //$NON-NLS-1$
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
fResourceButton.setLayoutData(gd);
- fProjectButton = createRadioButton(fGroup, LaunchVariableMessages.getString("RefreshTab.34")); //$NON-NLS-1$
+ fProjectButton = createRadioButton(fGroup, StringSubstitutionMessages.getString("RefreshTab.34")); //$NON-NLS-1$
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
fProjectButton.setLayoutData(gd);
- fContainerButton = createRadioButton(fGroup, LaunchVariableMessages.getString("RefreshTab.35")); //$NON-NLS-1$
+ fContainerButton = createRadioButton(fGroup, StringSubstitutionMessages.getString("RefreshTab.35")); //$NON-NLS-1$
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
fContainerButton.setLayoutData(gd);
- fWorkingSetButton = createRadioButton(fGroup, LaunchVariableMessages.getString("RefreshTab.36")); //$NON-NLS-1$
+ fWorkingSetButton = createRadioButton(fGroup, StringSubstitutionMessages.getString("RefreshTab.36")); //$NON-NLS-1$
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 1;
fWorkingSetButton.setLayoutData(gd);
@@ -170,7 +179,7 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
}
});
- fSelectButton = createPushButton(fGroup, LaunchVariableMessages.getString("RefreshTab.37"), null); //$NON-NLS-1$
+ fSelectButton = createPushButton(fGroup, StringSubstitutionMessages.getString("RefreshTab.37"), null); //$NON-NLS-1$
gd = (GridData)fSelectButton.getLayoutData();
gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_END;
fSelectButton.addSelectionListener(new SelectionAdapter() {
@@ -190,7 +199,7 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
IWorkingSetManager workingSetManager= PlatformUI.getWorkbench().getWorkingSetManager();
if (fWorkingSet == null){
- fWorkingSet = workingSetManager.createWorkingSet(LaunchVariableMessages.getString("RefreshTab.40"), new IAdaptable[0]); //$NON-NLS-1$
+ fWorkingSet = workingSetManager.createWorkingSet(StringSubstitutionMessages.getString("RefreshTab.40"), new IAdaptable[0]); //$NON-NLS-1$
}
IWorkingSetEditWizard wizard= workingSetManager.createWorkingSetEditWizard(fWorkingSet);
WizardDialog dialog = new WizardDialog(DebugUIPlugin.getStandardDisplay().getActiveShell(), wizard);
@@ -211,7 +220,7 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
*/
private void createRecursiveComponent(Composite parent) {
fRecursiveButton = new Button(parent, SWT.CHECK);
- fRecursiveButton.setText(LaunchVariableMessages.getString("RefreshTab.0")); //$NON-NLS-1$
+ fRecursiveButton.setText(StringSubstitutionMessages.getString("RefreshTab.0")); //$NON-NLS-1$
GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
data.horizontalSpan = 2;
fRecursiveButton.setLayoutData(data);
@@ -271,7 +280,7 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
try {
IResource[] resources = getRefreshResources(scope, null);
IWorkingSetManager workingSetManager= PlatformUI.getWorkbench().getWorkingSetManager();
- fWorkingSet = workingSetManager.createWorkingSet(LaunchVariableMessages.getString("RefreshTab.40"), resources); //$NON-NLS-1$
+ fWorkingSet = workingSetManager.createWorkingSet(StringSubstitutionMessages.getString("RefreshTab.40"), resources); //$NON-NLS-1$
} catch (CoreException e) {
fWorkingSet = null;
}
@@ -353,7 +362,7 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/
public String getName() {
- return LaunchVariableMessages.getString("RefreshTab.6"); //$NON-NLS-1$
+ return StringSubstitutionMessages.getString("RefreshTab.6"); //$NON-NLS-1$
}
/**
@@ -385,7 +394,7 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
setErrorMessage(null);
setMessage(null);
if (fWorkingSetButton.getSelection() && fWorkingSet == null) {
- setErrorMessage(LaunchVariableMessages.getString("RefreshTab.42")); //$NON-NLS-1$
+ setErrorMessage(StringSubstitutionMessages.getString("RefreshTab.42")); //$NON-NLS-1$
return false;
}
return true;
@@ -419,10 +428,10 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
return;
}
- monitor.beginTask(LaunchVariableMessages.getString("RefreshTab.7"), //$NON-NLS-1$
+ monitor.beginTask(StringSubstitutionMessages.getString("RefreshTab.7"), //$NON-NLS-1$
resources.length);
- MultiStatus status = new MultiStatus(DebugUIPlugin.getUniqueIdentifier(), 0, LaunchVariableMessages.getString("RefreshTab.8"), null); //$NON-NLS-1$
+ MultiStatus status = new MultiStatus(DebugUIPlugin.getUniqueIdentifier(), 0, StringSubstitutionMessages.getString("RefreshTab.8"), null); //$NON-NLS-1$
for (int i = 0; i < resources.length; i++) {
if (monitor.isCanceled())
break;
@@ -457,14 +466,14 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
Path path = new Path(pathString);
IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
if (resource == null) {
- throw new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR, MessageFormat.format(LaunchVariableMessages.getString("RefreshTab.38"), new String[]{pathString}), null)); //$NON-NLS-1$
+ throw new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR, MessageFormat.format(StringSubstitutionMessages.getString("RefreshTab.38"), new String[]{pathString}), null)); //$NON-NLS-1$
} else {
return new IResource[]{resource};
}
} else if (scope.startsWith("${working_set:")) { //$NON-NLS-1$
IWorkingSet workingSet = getWorkingSet(scope);
if (workingSet == null) {
- throw new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR, LaunchVariableMessages.getString("RefreshTab.39"), null)); //$NON-NLS-1$
+ throw new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR, StringSubstitutionMessages.getString("RefreshTab.39"), null)); //$NON-NLS-1$
} else {
IAdaptable[] elements = workingSet.getElements();
IResource[] resources = new IResource[elements.length];
@@ -516,23 +525,23 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
return null;
}
- String factoryID = memento.getString(IVariableConstants.TAG_FACTORY_ID);
+ String factoryID = memento.getString(TAG_FACTORY_ID);
if (factoryID == null) {
- DebugUIPlugin.logErrorMessage(LaunchVariableMessages.getString("RefreshTab.2")); //$NON-NLS-1$
+ DebugUIPlugin.logErrorMessage(StringSubstitutionMessages.getString("RefreshTab.2")); //$NON-NLS-1$
return null;
}
IElementFactory factory = WorkbenchPlugin.getDefault().getElementFactory(factoryID);
if (factory == null) {
- DebugUIPlugin.logErrorMessage(LaunchVariableMessages.getString("RefreshTab.3") + factoryID); //$NON-NLS-1$
+ DebugUIPlugin.logErrorMessage(StringSubstitutionMessages.getString("RefreshTab.3") + factoryID); //$NON-NLS-1$
return null;
}
IAdaptable adaptable = factory.createElement(memento);
if (adaptable == null) {
- DebugUIPlugin.logErrorMessage(LaunchVariableMessages.getString("RefreshTab.4") + factoryID); //$NON-NLS-1$
+ DebugUIPlugin.logErrorMessage(StringSubstitutionMessages.getString("RefreshTab.4") + factoryID); //$NON-NLS-1$
}
if ((adaptable instanceof IWorkingSet) == false) {
- DebugUIPlugin.logErrorMessage(LaunchVariableMessages.getString("RefreshTab.5") + factoryID); //$NON-NLS-1$
+ DebugUIPlugin.logErrorMessage(StringSubstitutionMessages.getString("RefreshTab.5") + factoryID); //$NON-NLS-1$
return null;
}
@@ -575,7 +584,7 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
if (workingSet == null || workingSet.getElements().length == 0) {
return null;
}
- XMLMemento workingSetMemento = XMLMemento.createWriteRoot(IVariableConstants.TAG_LAUNCH_CONFIGURATION_WORKING_SET);
+ XMLMemento workingSetMemento = XMLMemento.createWriteRoot(TAG_LAUNCH_CONFIGURATION_WORKING_SET);
IPersistableElement persistable = null;
if (workingSet instanceof IPersistableElement) {
persistable = (IPersistableElement) workingSet;
@@ -583,7 +592,7 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
persistable = (IPersistableElement) ((IAdaptable) workingSet).getAdapter(IPersistableElement.class);
}
if (persistable != null) {
- workingSetMemento.putString(IVariableConstants.TAG_FACTORY_ID, persistable.getFactoryId());
+ workingSetMemento.putString(RefreshTab.TAG_FACTORY_ID, persistable.getFactoryId());
persistable.saveState(workingSetMemento);
StringWriter writer= new StringWriter();
try {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/AbstractVariableComponent.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/AbstractVariableComponent.java
deleted file mode 100644
index 4a3bb0951..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/AbstractVariableComponent.java
+++ /dev/null
@@ -1,119 +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.debug.ui.launchVariables;
-
-import org.eclipse.debug.core.variables.LaunchVariableUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-
-/**
- * The AbstractVariableComponent provides the base implementation of an
- * <code>IVariableComponent</code>.
- *
- * @since 3.0
- */
-public abstract class AbstractVariableComponent implements IVariableComponent {
-
- protected Group mainGroup;
- protected IVariableComponentContainer container;
- private boolean isValid = true;
-
- /**
- * @see IVariableComponent#getControl()
- */
- public Control getControl() {
- return mainGroup;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.launchVariables.IVariableComponent#setEnabled(boolean)
- */
- public void setEnabled(boolean enabled) {
- mainGroup.setEnabled(enabled);
- }
-
- /**
- * Returns this component's container, which can display messages
- * for this component.
- */
- protected IVariableComponentContainer getContainer() {
- return container;
- }
-
- /**
- * @see IVariableComponent#createContents(Composite, String, IVariableComponentContainer)
- */
- public void createContents(Composite parent, String varTag, IVariableComponentContainer componentContainer) {
- this.container= componentContainer;
-
- // main composite
- mainGroup = new Group(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- GridData gridData = new GridData(GridData.FILL_BOTH);
- mainGroup.setLayout(layout);
- mainGroup.setLayoutData(gridData);
- mainGroup.setFont(parent.getFont());
- mainGroup.setText(LaunchVariableUtil.newVariableExpression(varTag, null));
- }
-
- /**
- * @see IVariableComponent#getVariableValue()
- */
- public String getVariableValue() {
- return null;
- }
-
- /**
- * @see IVariableComponent#isValid()
- */
- public boolean isValid() {
- return isValid;
- }
-
- /**
- * Sets whether the component's values are all valid.
- * Updates the valid state of this component's container. No action
- * taken if new valid state same as current one.
- *
- * @param isValid <code>true</code> if all values valid,
- * <code>false</code> otherwise
- */
- protected void setIsValid(boolean isValid) {
- if (isValid() != isValid) {
- this.isValid= isValid;
- this.container.updateValidState();
- }
- }
-
- /**
- * @see IVariableComponent#setVariableValue(String)
- */
- public void setVariableValue(String varValue) {
- }
-
- /**
- * @see IVariableComponent#validate()
- */
- public void validate() {
- container.setErrorMessage(null);
- }
-
- /**
- * @see IVariableComponent#dispose()
- */
- public void dispose() {
- //by default do nothing
- }
-} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/ILaunchVariableComponentManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/ILaunchVariableComponentManager.java
deleted file mode 100644
index bab47c1a6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/ILaunchVariableComponentManager.java
+++ /dev/null
@@ -1,15 +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.debug.ui.launchVariables;
-
-public interface ILaunchVariableComponentManager {
- public IVariableComponent getComponent(String variableName);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/IVariableComponent.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/IVariableComponent.java
deleted file mode 100644
index a00011f95..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/IVariableComponent.java
+++ /dev/null
@@ -1,91 +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.debug.ui.launchVariables;
-
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * Represents the API for a client extending one of the
- * variable extension points to provide visual editing
- * of the variable.
- * <p>
- * Clients may implement this interface.
- * </p>
- */
-public interface IVariableComponent {
- /**
- * Returns the control to edit the variable
- * value, otherwise <code>null</code> if no editing
- * supported or if <code>createContents</code> has
- * not been called yet
- *
- * @return the main control for the variable component
- * or <code>null</code> if none
- */
- public Control getControl();
-
- /**
- * Enables the receiver if the argument is <code>true</code>,
- * and disables it otherwise. A disabled component has all controls
- * typically not selectable from the user interface and draws with an
- * inactive or "grayed" look.
- */
- public void setEnabled(boolean enabled);
-
- /**
- * Creates the control to edit the variable. Does nothing
- * if no editing supported.
- *
- * @param parent the composite to parent all controls to
- * @param varName the variable name to display as the name of this component
- * @param page the dialog page this visual component will be part of
- */
- public void createContents(Composite parent, String varName, IVariableComponentContainer page);
-
- /**
- * Returns the variable value as specified by
- * the user thru the visual component.
- *
- * @return the variable value as indicated by the visual component
- */
- public String getVariableValue();
-
- /**
- * Returns whether the variable's visual component has an
- * acceptable value.
- *
- * @return <code>true</code> if all value acceptable, or <code>false</code> otherwise
- */
- public boolean isValid();
-
- /**
- * Sets the visual component to represent the
- * given variable value.
- *
- * @param varValue the variable value the visual component should indicate
- */
- public void setVariableValue(String varValue);
-
- /**
- * Validates visual component current values entered by the
- * user and updates it's valid state if needed
- */
- public void validate();
-
- /**
- * Notifies this variable component that it has
- * been disposed. Marks the end of this component's lifecycle,
- * allowing this component to perform any cleanup required.
- */
- public void dispose();
-} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/IVariableComponentContainer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/IVariableComponentContainer.java
deleted file mode 100644
index 986820fcd..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/IVariableComponentContainer.java
+++ /dev/null
@@ -1,40 +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.debug.ui.launchVariables;
-
-
-import org.eclipse.jface.dialogs.IMessageProvider;
-
-/**
- * Represents the API for an <code>IVariableComponent</code> to
- * access the visual component that contains it.
- *
- * This interface is intended to be implemented by clients implementing
- * visual components that contain <code>IVariableComponent</code>s.
- * @see IVariableComponent
- */
-public interface IVariableComponentContainer extends IMessageProvider {
-
- /**
- * Sets the error message that corresponds to an IVariableComponent.
- *
- * @param errorMessage the message, or <code>null</code> to clear the
- * message
- */
- public void setErrorMessage(String errorMessage);
-
- /**
- * Informs this container that it should update it's valid
- * state. Typically called when the valid state of the
- * contained <code>IVariableComponent</code> changes.
- */
- public void updateValidState();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/IVariableConstants.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/IVariableConstants.java
deleted file mode 100644
index 179bef793..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/IVariableConstants.java
+++ /dev/null
@@ -1,40 +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.debug.ui.launchVariables;
-
-public interface IVariableConstants {
- /**
- * 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$
- /**
- * XML tag used to designate the root of the persisted IWorkingSet
- */
- public static final String TAG_LAUNCH_CONFIGURATION_WORKING_SET= "launchConfigurationWorkingSet"; //$NON-NLS-1$
- /**
- * XML tag used for setting / getting the factory ID of the persisted IWorkingSet
- * Bug 37143
- */
- public static final String TAG_FACTORY_ID = "factoryID"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/LaunchConfigurationVariableForm.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/LaunchConfigurationVariableForm.java
deleted file mode 100644
index 59845399e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/LaunchConfigurationVariableForm.java
+++ /dev/null
@@ -1,296 +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.debug.ui.launchVariables;
-
-
-import org.eclipse.debug.core.variables.ILaunchVariable;
-import org.eclipse.debug.core.variables.LaunchVariableUtil;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-
-/**
- * Visual grouping of controls that allows the user to
- * select a variable and configure it with extra
- * information.
- *
- * @since 3.0
- */
-public class LaunchConfigurationVariableForm {
- private static final int VISIBLE_ITEM_COUNT = 6;
-
- private String variableListLabelText;
- private ILaunchVariable[] variables;
- private IVariableComponent[] components;
- private IVariableComponentContainer dialogPage;
-
- private Label variableListLabel;
- private List variableList;
- private Composite variableComposite;
- private StackLayout variableLayout;
- private int activeComponentIndex = -1;
-
- /**
- * Creates the visual grouping
- *
- * @param variableListLabelText the label text to use for identifying the list of variables
- * @param variables the collection of variables to display to the user
- */
- public LaunchConfigurationVariableForm(String variableListLabelText, ILaunchVariable[] variables) {
- super();
- this.variableListLabelText = variableListLabelText;
- this.variables = variables;
- this.components = new IVariableComponent[variables.length];
- }
-
- public Composite createContents(Composite parent, IVariableComponentContainer page) {
- Font font = parent.getFont();
-
- dialogPage = page;
-
- Composite mainComposite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 1;
- GridData data = new GridData(GridData.FILL_BOTH);
- mainComposite.setLayout(layout);
- mainComposite.setLayoutData(data);
-
- variableListLabel = new Label(mainComposite, SWT.NONE);
- variableListLabel.setText(variableListLabelText);
- data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 1;
- variableListLabel.setLayoutData(data);
- variableListLabel.setFont(font);
-
- variableList = new List(mainComposite, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.heightHint = variableList.getItemHeight() * VISIBLE_ITEM_COUNT;
- variableList.setLayoutData(data);
- variableList.setFont(font);
-
- variableComposite = new Composite(mainComposite, SWT.NONE);
- variableLayout = new StackLayout();
- variableLayout.marginWidth = 0;
- variableLayout.marginHeight = 0;
- data = new GridData(GridData.FILL_BOTH);
- variableComposite.setLayout(variableLayout);
- variableComposite.setLayoutData(data);
- variableComposite.setFont(font);
-
- createVariableComponents();
-
- populateVariableList();
-
- variableList.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateVariableComposite(null, false);
- }
- });
-
- variableList.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent e) {
- cycleSelection(e);
- }
- });
-
- setEnabled(true);
- return mainComposite;
- }
-
- private void cycleSelection(KeyEvent e) {
- String selection= variableList.getSelection()[0];
- int startingIndex= variableList.getSelectionIndex();
- if (selection.charAt(2) > e.character) {
- startingIndex= 0;
- }
- String[] vars= variableList.getItems();
- for (int i = startingIndex; i < vars.length; i++) {
- //look for the first real char eg. after ${
- if (vars[i].charAt(2) == e.character) {
- if (variableList.getSelectionIndex() == i) {
- //this item already selected
- i++;
- if (i < vars.length && vars[i].charAt(2) == e.character) {
- //select the next item that starts with the same char
- variableList.select(i);
- variableList.showSelection();
- updateVariableComposite(null, false);
- return;
- } else {
- if (i-2 > 0 && vars[i-2].charAt(2) == e.character) {
- //more than one item that starts with this char
- //loop back to the beginning as we are at the last one
- i = 0;
- continue;
- }
- //the only entry matching this char is already selected
- variableList.showSelection();
- return;
- }
- }
- //select the matching variable
- variableList.select(i);
- variableList.showSelection();
- updateVariableComposite(null, false);
- return;
- }
- }
- }
-
- /**
- * Creates the visual component for each variable
- * and determine the initial size so the form
- * can be layout properly.
- */
- private void createVariableComponents() {
- ILaunchVariableComponentManager manager = DebugUIPlugin.getDefault().getVariableComponentManager();
- for (int i = 0; i < variables.length; i++) {
- ILaunchVariable var = variables[i];
- components[i] = manager.getComponent(var.getName());
- components[i].createContents(variableComposite, var.getName(), dialogPage);
- }
- }
-
- /**
- * Returns the formatted variable or <code>null</code> if
- * none selected.
- */
- public String getSelectedVariable() {
- if (activeComponentIndex != -1) {
- String varValue = components[activeComponentIndex].getVariableValue();
- return LaunchVariableUtil.newVariableExpression(variables[activeComponentIndex].getName(), varValue);
- }
-
- return null;
- }
-
- /**
- * Returns the variable list of this form.
- */
- public List getVariableList() {
- return variableList;
- }
-
- /**
- * Returns whether the current variable selection is
- * valid, including the selected variable value.
- */
- public boolean isValid() {
- if (activeComponentIndex != -1) {
- return components[activeComponentIndex].isValid();
- }
-
- return true;
- }
-
- private void populateVariableList() {
- String[] items = new String[variables.length];
- StringBuffer buffer = new StringBuffer(80);
- ILaunchVariable variable;
- for (int i = 0; i < variables.length; i++) {
- variable= variables[i];
- buffer.append(LaunchVariableUtil.newVariableExpression(variable.getName(), null));
- String description= variable.getDescription();
- if (description != null && description.length() != 0) {
- buffer.append(" - "); //$NON-NLS-1$
- buffer.append(description);
- }
- items[i] = buffer.toString();
- buffer.setLength(0);
- }
- variableList.setItems(items);
- }
-
- public void selectVariable(String varName, String varValue) {
- if (varName != null && varName.length() > 0) {
- for (int i = 0; i < variables.length; i++) {
- if (varName.equals(variables[i].getName())) {
- variableList.select(i);
- updateVariableComposite(varValue, true);
- return;
- }
- }
- }
-
- variableList.deselectAll();
- updateVariableComposite(varValue, false);
- }
-
- private void setComponentVisible(int index) {
- if (index == -1) {
- variableLayout.topControl = null;
- } else {
- variableLayout.topControl = components[index].getControl();
- }
- variableComposite.layout();
- }
-
- /**
- * Enables or disables the variable form controls.
- */
- public void setEnabled(boolean enabled) {
- variableListLabel.setEnabled(enabled);
- variableList.setEnabled(enabled);
- if (enabled && variableList.getSelection().length == 0) {
- if (variableList.getItemCount() > 0) {
- variableList.select(0);
- activeComponentIndex= 0;
- }
- }
- variableComposite.setVisible(enabled);
- setComponentVisible(activeComponentIndex);
- }
-
- private void updateVariableComposite(String value, boolean setValue) {
- if (variableList.getSelectionIndex() == activeComponentIndex) {
- return;
- }
- activeComponentIndex = variableList.getSelectionIndex();
- setComponentVisible(activeComponentIndex);
- if (activeComponentIndex != -1) {
- if (setValue) {
- components[activeComponentIndex].setVariableValue(value);
- }
- components[activeComponentIndex].validate();
- }
-
- dialogPage.updateValidState();
- }
-
- /**
- * Validates the current variable selection is and
- * its value are acceptable.
- */
- public void validate() {
- if (activeComponentIndex != -1) {
- components[activeComponentIndex].validate();
- }
- }
-
- public void dispose() {
- for (int i = 0; i < components.length; i++) {
- IVariableComponent varComponent = components[i];
- varComponent.dispose();
- }
- }
-} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/LaunchVariableContextManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/LaunchVariableContextManager.java
deleted file mode 100644
index ff852d6c5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/LaunchVariableContextManager.java
+++ /dev/null
@@ -1,139 +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.debug.ui.launchVariables;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.variables.*;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.ISelectionService;
-import org.eclipse.ui.IWindowListener;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Maintains the context used to expand variables. The context is based on
- * the selected resource.
- */
-public class LaunchVariableContextManager implements IWindowListener, ISelectionListener {
-
- // singleton
- private static LaunchVariableContextManager fgDefault;
-
- private IResource fSelectedResource = null;
-
- private LaunchVariableContextManager() {
- IWorkbench workbench = PlatformUI.getWorkbench();
- if (workbench != null) { //may be running headless
- workbench.addWindowListener(this);
- IWorkbenchWindow activeWindow = workbench.getActiveWorkbenchWindow();
- if (activeWindow != null) {
- windowActivated(activeWindow);
- }
- }
- }
-
- /**
- * Returns the singleton resource selection manager
- *
- * @return VariableContextManager
- */
- public static LaunchVariableContextManager getDefault() {
- if (fgDefault == null) {
- fgDefault = new LaunchVariableContextManager();
- }
- return fgDefault;
- }
-
- /**
- * @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowActivated(IWorkbenchWindow window) {
- fSelectedResource = null;
- ISelectionService service = window.getSelectionService();
- service.addSelectionListener(this);
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IWorkbenchPart part = page.getActivePart();
- if (part != null) {
- ISelection selection = service.getSelection();
- if (selection != null) {
- selectionChanged(part, selection);
- }
- }
- }
- }
-
- /**
- * @see org.eclipse.ui.IWindowListener#windowClosed(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowClosed(IWorkbenchWindow window) {
- window.getSelectionService().removeSelectionListener(this);
- }
-
- /**
- * @see org.eclipse.ui.IWindowListener#windowDeactivated(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowDeactivated(IWorkbenchWindow window) {
- window.getSelectionService().removeSelectionListener(this);
- }
-
- /**
- * @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowOpened(IWorkbenchWindow window) {
- }
-
- /**
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- IResource selectedResource = null;
- if (selection instanceof IStructuredSelection) {
- Object result = ((IStructuredSelection)selection).getFirstElement();
- if (result instanceof IResource) {
- selectedResource = (IResource) result;
- } else if (result instanceof IAdaptable) {
- selectedResource = (IResource)((IAdaptable) result).getAdapter(IResource.class);
- }
- }
-
- if (selectedResource == null) {
- // If the active part is an editor, get the file resource used as input.
- if (part instanceof IEditorPart) {
- IEditorPart editorPart = (IEditorPart) part;
- IEditorInput input = editorPart.getEditorInput();
- selectedResource = (IResource) input.getAdapter(IResource.class);
- }
- }
-
- if (selectedResource != null) {
- fSelectedResource = selectedResource;
- }
- }
-
- /**
- * Returns the active variable context. The context is that of the selected
- * resource, or a project being built.
- *
- * @return variable context
- */
- public ExpandVariableContext getVariableContext() {
- return new ExpandVariableContext(fSelectedResource);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/LaunchVariableSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/LaunchVariableSelectionDialog.java
deleted file mode 100644
index e00a34506..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/LaunchVariableSelectionDialog.java
+++ /dev/null
@@ -1,140 +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.debug.ui.launchVariables;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.variables.ILaunchVariable;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.launchVariables.LaunchVariableMessages;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.help.WorkbenchHelp;
-
-/**
- * Dialog that prompts the user to select a launch configuration variable.
- * @since 3.0
- */
-public class LaunchVariableSelectionDialog extends SelectionDialog {
- private LaunchConfigurationVariableForm form;
- private Composite formComposite;
- public LaunchVariableSelectionDialog(Shell parent) {
- super(parent);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- setTitle(LaunchVariableMessages.getString("VariableSelectionDialog.0")); //$NON-NLS-1$
- }
- /* (non-Javadoc)
- * Method declared in Window.
- */
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- WorkbenchHelp.setHelp(shell, IDebugHelpContextIds.VARIABLE_SELECTION_DIALOG);
- }
- protected Control createDialogArea(Composite parent) {
- // Create the dialog area
- Composite composite= (Composite)super.createDialogArea(parent);
- composite.setFont(parent.getFont());
- final Button contextVariables= createRadioButton(composite, LaunchVariableMessages.getString("VariableSelectionDialog.1")); //$NON-NLS-1$
- contextVariables.setSelection(true);
- contextVariables.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (contextVariables.getSelection()) {
- replaceVariableComposite(DebugPlugin.getDefault().getLaunchVariableManager().getContextVariables());
- }
- }
- });
- final Button simpleVariables= createRadioButton(composite, LaunchVariableMessages.getString("VariableSelectionDialog.2")); //$NON-NLS-1$
- simpleVariables.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (simpleVariables.getSelection()) {
- replaceVariableComposite(DebugPlugin.getDefault().getLaunchVariableManager().getSimpleVariables());
- }
- }
- });
- createVariableFormComposite(composite, DebugPlugin.getDefault().getLaunchVariableManager().getContextVariables());
- return composite;
- }
-
- /**
- * Replaces the variable form with a form containing the given variables.
- */
- private void replaceVariableComposite(ILaunchVariable[] variables) {
- if (formComposite != null) {
- formComposite.dispose();
- }
- createVariableFormComposite((Composite) getDialogArea(), variables);
- ((Composite) getDialogArea()).layout(true);
- getDialogArea().redraw();
- }
-
- protected Button createRadioButton(Composite parent, String label) {
- Button button= new Button(parent, SWT.RADIO);
- button.setText(label);
- button.setFont(parent.getFont());
- button.setLayoutData(new GridData());
- return button;
- }
-
- protected void createVariableFormComposite(Composite parent, ILaunchVariable[] variables) {
- formComposite= new Composite(parent, SWT.NONE);
- formComposite.setLayout(new GridLayout());
- formComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
- formComposite.setFont(parent.getFont());
- form= new LaunchConfigurationVariableForm(LaunchVariableMessages.getString("VariableSelectionDialog.3"), variables); //$NON-NLS-1$
- form.createContents(formComposite, new IVariableComponentContainer() {
-
- public void setErrorMessage(String errorMessage) {
- LaunchVariableSelectionDialog.this.setMessage(errorMessage);
- }
-
- public void updateValidState() {
- }
-
- public String getMessage() {
- if (!form.isValid()) {
- return LaunchVariableMessages.getString("VariableSelectionDialog.4"); //$NON-NLS-1$
- }
- return null;
- }
-
- public int getMessageType() {
- if (!form.isValid()) {
- return IMessageProvider.ERROR;
- }
- return 0;
- }
- });
- form.getVariableList().addListener(SWT.MouseDoubleClick, new Listener() {
- public void handleEvent(Event event) {
- okPressed();
- }
- });
- }
-
- /**
- * Returns this dialog's variable selection form, which allows
- * the user to choose and configure a variable.
- * @return this dialog's <code>LaunchConfigurationVariableForm</code>
- */
- public LaunchConfigurationVariableForm getForm() {
- return form;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/package.html b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/package.html
deleted file mode 100644
index 46827ead8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/launchVariables/package.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Debug Launch Variables</title>
-</head>
-
-<body link="#0000FF" vlink="#800080">
-
-<p align="left">Provides a set of interfaces and classes for choosing and configuring launch variables.</p>
-
-<h2 align="left">Package Specification</h2>
-
-<p>This package provides a set interfaces and classses for choosing a variable,
- providing visual components for configuring variables, and tracking selection for
- the variable expansion context.</p>
-<h3>Variable Components</h3>
-<p>Context launch varible providers may specify a component for configuring
- the arguments to a variable by defining an <b>IVariableComponent</b>
- extension (using the <b>org.eclipse.debug.ui.launchVariableComponents</b>)
- extension point). A variable component is defined for a context launch variable.
- When the user selects the specified variable in the <b>VariableSelectionDialog</b>,
- the component is rendered allowing the user to configure the variable's argument.</p>
-</body>
-</html>

Back to the top