Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.debug.ui/doc/org_eclipse_debug_ui_launchConfigurationTabGroups.html15
-rw-r--r--org.eclipse.debug.ui/schema/launchConfigurationTabGroups.exsd24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java45
3 files changed, 71 insertions, 13 deletions
diff --git a/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_launchConfigurationTabGroups.html b/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_launchConfigurationTabGroups.html
index 0a545d214..0497145a7 100644
--- a/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_launchConfigurationTabGroups.html
+++ b/org.eclipse.debug.ui/doc/org_eclipse_debug_ui_launchConfigurationTabGroups.html
@@ -25,13 +25,12 @@ dialog for a type of launch configuration.<p><b><i>Configuration Markup:</i></b>
<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><samp><font color="#800000">&nbsp;&nbsp; &lt;!ELEMENT <a name="e.launchConfigurationTabGroup">launchConfigurationTabGroup</a> EMPTY&gt;</font></samp>
+<p><samp><font color="#800000">&nbsp;&nbsp; &lt;!ELEMENT <a name="e.launchConfigurationTabGroup">launchConfigurationTabGroup</a> (<a href="#e.launchMode">launchMode</a>*)&gt;</font></samp>
<br><br><samp><font color="#800000">&nbsp;&nbsp; &lt;!ATTLIST launchConfigurationTabGroup</samp>
<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</samp>
<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</samp>
<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</samp>
<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;helpContextId&nbsp;CDATA #IMPLIED</samp>
-<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;modes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</samp>
<br><samp>&nbsp;&nbsp; &gt;</font></samp>
<ul>
<li><b>id</b> - specifies a unique identifier for this launch configuration tab group.</li>
@@ -39,7 +38,17 @@ dialog for a type of launch configuration.<p><b><i>Configuration Markup:</i></b>
launch configuration type extension).</li>
<li><b>class</b> - specifies a fully qualified name of a Java class that implements <samp>ILaunchConfigurationTabGroup</samp>.</li>
<li><b>helpContextId</b> - an optional identifier that specifies the help context to associate with this tab group's launch configuration type</li>
-<li><b>modes</b> - a comma seperated list of launch modes specifying the launch modes this tab group is applicable to. When unspecified, this tab group is the default set of tabs for this tab group's launch confiugration type.</li>
+</ul>
+<p><samp><font color="#800000">&nbsp;&nbsp; &lt;!ELEMENT <a name="e.launchMode">launchMode</a> EMPTY&gt;</font></samp>
+<p>&nbsp;&nbsp; A launch mode element specifies a launch mode this tab group is specific to. A tab grounp can be associated with one or more launch modes. For backwards compatibility (previous to 3.0), a launch mode does not neet to be specified. When unspecified, a tab group is registered as the default tab group for the associated launch confiugration type (i.e. applicable to all supported launch modes for which a specific tab group has not been contributed).</p>
+<p></p>
+<samp><font color="#800000">&nbsp;&nbsp; &lt;!ATTLIST launchMode</samp>
+<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mode&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</samp>
+<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;perspective&nbsp;CDATA #IMPLIED</samp>
+<br><samp>&nbsp;&nbsp; &gt;</font></samp>
+<ul>
+<li><b>mode</b> - identifier for a launch mode this tab group is specific to.</li>
+<li><b>perspective</b> - the default perspective identifier associated with this launch configuration type and launch mode. This allows an extension to cause a perspective switch (or open) when a corresponding launch is registered with the debug plug-in. When unspecified, it indicates that by default, no perspective switch should occurr.</li>
</ul>
<b><i>Examples: </i></b>The following is an example of a launch configuration tab group extension point:
diff --git a/org.eclipse.debug.ui/schema/launchConfigurationTabGroups.exsd b/org.eclipse.debug.ui/schema/launchConfigurationTabGroups.exsd
index 9778ac988..ae45cb39a 100644
--- a/org.eclipse.debug.ui/schema/launchConfigurationTabGroups.exsd
+++ b/org.eclipse.debug.ui/schema/launchConfigurationTabGroups.exsd
@@ -42,6 +42,9 @@ dialog for a type of launch configuration.
<element name="launchConfigurationTabGroup">
<complexType>
+ <sequence>
+ <element ref="launchMode" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
<attribute name="id" type="string" use="required">
<annotation>
<documentation>
@@ -74,10 +77,27 @@ launch configuration type extension).
</documentation>
</annotation>
</attribute>
- <attribute name="modes" type="string">
+ </complexType>
+ </element>
+
+ <element name="launchMode">
+ <annotation>
+ <documentation>
+ A launch mode element specifies a launch mode this tab group is specific to. A tab grounp can be associated with one or more launch modes. For backwards compatibility (previous to 3.0), a launch mode does not neet to be specified. When unspecified, a tab group is registered as the default tab group for the associated launch confiugration type (i.e. applicable to all supported launch modes for which a specific tab group has not been contributed).
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="mode" type="string" use="required">
+ <annotation>
+ <documentation>
+ identifier for a launch mode this tab group is specific to.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="perspective" type="string">
<annotation>
<documentation>
- a comma seperated list of launch modes specifying the launch modes this tab group is applicable to. When unspecified, this tab group is the default set of tabs for this tab group&apos;s launch confiugration type.
+ the default perspective identifier associated with this launch configuration type and launch mode. This allows an extension to cause a perspective switch (or open) when a corresponding launch is registered with the debug plug-in. When unspecified, it indicates that by default, no perspective switch should occurr.
</documentation>
</annotation>
</attribute>
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java
index cdcfc2eae..ba1ab8038 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java
@@ -12,8 +12,9 @@ package org.eclipse.debug.internal.ui.launchConfigurations;
import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.Map;
import java.util.Set;
-import java.util.StringTokenizer;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -39,6 +40,11 @@ public class LaunchConfigurationTabGroupExtension {
private Set fModes;
/**
+ * Perspectives for each mode
+ */
+ private Map fPerspectives;
+
+ /**
* Constructs a launch configuration tab extension based
* on the given configuration element
*
@@ -89,17 +95,40 @@ public class LaunchConfigurationTabGroupExtension {
*/
protected Set getModes() {
if (fModes == null) {
- String modes= getConfigurationElement().getAttribute("modes"); //$NON-NLS-1$
- if (modes != null) {
- StringTokenizer tokenizer= new StringTokenizer(modes, ","); //$NON-NLS-1$
- fModes = new HashSet(tokenizer.countTokens());
- while (tokenizer.hasMoreTokens()) {
- fModes.add(tokenizer.nextToken().trim());
+ IConfigurationElement[] modes= getConfigurationElement().getChildren("launchMode"); //$NON-NLS-1$
+ if (modes.length > 0) {
+ fModes = new HashSet(modes.length);
+ fPerspectives = new Hashtable(modes.length);
+ for (int i = 0; i < modes.length; i++) {
+ IConfigurationElement element = modes[i];
+ String mode = element.getAttribute("mode"); //$NON-NLS-1$
+ fModes.add(mode);
+ String perspective = element.getAttribute("perspective"); //$NON-NLS-1$
+ if (perspective != null) {
+ fPerspectives.put(mode, perspective);
+ }
}
}
}
return fModes;
- }
+ }
+
+ /**
+ * Returns the default perspective associated with the given launch
+ * mode, or <code>null</code> if none.
+ *
+ * @param mode launch mode
+ * @return perspective identifier, or <code>null</code>
+ */
+ protected String getPerspective(String mode) {
+ // ensure modes are initialized
+ getModes();
+ String id = null;
+ if (fPerspectives != null) {
+ id = (String)fPerspectives.get(mode);
+ }
+ return id;
+ }
/**
* Returns the identifier of the type of launch configuration this

Back to the top