Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 157059 | Differences between
and this patch

Collapse All | Expand All

(-)core/org/eclipse/debug/internal/core/ConfigurationElementConstants.java (+119 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2006 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.debug.internal.core;
12
13
/**
14
 * This class provides a repository for the names of <code>IConfigurationElement</code> child node ids.
15
 * @since 3.3
16
 * <p>
17
 * <strong>EXPERIMENTAL</strong>. This class has been added as
18
 * part of a work in progress. There is no guarantee that this API will
19
 * remain unchanged during the 3.3 release cycle. Please do not use this API
20
 * without consulting with the Platform/Debug team.
21
 * </p>
22
 */
23
public class ConfigurationElementConstants {
24
25
	/**
26
	 * The id node name for a configuration element
27
	 */
28
	public static final String ID = "id"; //$NON-NLS-1$
29
	
30
	/**
31
	 * the name node name for a configuration element
32
	 */
33
	public static final String NAME = "name"; //$NON-NLS-1$
34
	
35
	/**
36
	 * the category node name for a configuration element
37
	 */
38
	public static final String CATEGORY = "category"; //$NON-NLS-1$
39
	
40
	/**
41
	 * the launchMode node name for a configuration element
42
	 */
43
	public static final String LAUNCH_MODE = "launchMode"; //$NON-NLS-1$
44
	
45
	/**
46
	 * the description node name for a configuration element
47
	 */
48
	public static final String DESCRIPTION = "description"; //$NON-NLS-1$
49
	
50
	/**
51
	 * the helpContextId node name for a configuration element
52
	 */
53
	public static final String HELP_CONTEXT_ID = "helpContextId"; //$NON-NLS-1$
54
	
55
	/**
56
	 * the icon node name for a configuration element
57
	 */
58
	public static final String ICON = "icon"; //$NON-NLS-1$
59
	
60
	/**
61
	 * the public node name for a configuration element
62
	 */
63
	public static final String PUBLIC = "public"; //$NON-NLS-1$
64
	
65
	/**
66
	 * the perspective node name for a configuration element
67
	 */
68
	public static final String PERSPECTIVE = "perspective"; //$NON-NLS-1$
69
	
70
	/**
71
	 * the modes node name for a configuration element
72
	 */
73
	public static final String MODES = "modes"; //$NON-NLS-1$
74
	
75
	/**
76
	 * the mode node name for a configuration element
77
	 */
78
	public static final String MODE = "mode"; //$NON-NLS-1$
79
	
80
	/**
81
	 * the type node name for a configuration element
82
	 */
83
	public static final String TYPE = "type"; //$NON-NLS-1$
84
	
85
	/**
86
	 * the option node name for a configuration element
87
	 */
88
	public static final String OPTIONS = "options"; //$NON-NLS-1$
89
	
90
	/**
91
	 * the delegate node name for a configuration element
92
	 */
93
	public static final String DELEGATE = "delegate"; //$NON-NLS-1$
94
	
95
	/**
96
	 * the group node name for a configuration element
97
	 */
98
	public static final String GROUP = "group"; //$NON-NLS-1$
99
	
100
	/**
101
	 * the class node name for a configuration element
102
	 */
103
	public static final String CLASS = "class"; //$NON-NLS-1$
104
	
105
	/**
106
	 * the sourcePathComputerId node name for a configuration element
107
	 */
108
	public static final String SOURCE_PATH_COMPUTER = "sourcePathComputerId"; //$NON-NLS-1$
109
	
110
	/**
111
	 * the sourceLocatorId node name for a configuration element
112
	 */
113
	public static final String SOURCE_LOCATOR = "sourceLocatorId"; //$NON-NLS-1$
114
	
115
	/**
116
	 * the migrationDelegate node name for a configuration element
117
	 */
118
	public static final String MIGRATION_DELEGATE = "migrationDelegate";  //$NON-NLS-1$
119
}
(-)core/org/eclipse/debug/core/ILaunchDelegate.java (+97 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2006 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.debug.core;
12
13
import java.util.Set;
14
15
import org.eclipse.core.runtime.CoreException;
16
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
17
18
/**
19
 * This interface describes a launch delegate
20
 * Clients can contribute launch delegate through the <code>launchDelegates</code> extension point
21
 * 
22
 * Example contribution of the local java launch delegate
23
 * <pre>
24
 * <launchDelegate
25
            delegate="org.eclipse.jdt.launching.JavaLaunchDelegate"
26
            id="org.eclipse.jdt.launching.JavaLaunchDelegate">
27
         <appliesTo
28
               type="org.eclipse.jdt.launching.localJavaApplication">
29
            <option
30
                  option="debug">
31
            </option>
32
         </appliesTo>
33
      </launchDelegate>
34
 * </pre>
35
 * 
36
 * Clients are NOT intended to implement this interface
37
 * @since 3.3
38
 */
39
public interface ILaunchDelegate {
40
41
	/**
42
	 * @return returns the unique id of the delegate
43
	 */
44
	public String getIdentifier();
45
	
46
	/**
47
	 * @return the launch delegate
48
	 */
49
	public ILaunchConfigurationDelegate getDelegate() throws CoreException;
50
	
51
	/**
52
	 * One delegate definition can now be associated with more than on launch configuration type.
53
	 * In this case we need to return them all. In the deprecated case when one delegate is associated
54
	 * with one type, we only need return the one (a set of only one element)
55
	 * @return the set of associated launch configuration type ids (String) or the empty set, never <code>null</code>
56
	 */
57
	public String getLaunchConfigurationType();
58
	
59
	/**
60
	 * @return the associated source locator id or <code>null</code> if not provided
61
	 */
62
	public String getSourceLocatorId();
63
	
64
	/**
65
	 * @return the associated source path computer id or <code>null</code> if not provided
66
	 */
67
	public String getSourcePathComputerId();
68
	
69
	/**
70
	 * @return the options associated with this delegate. If no options are specified an empty set is
71
	 * returned, never <code>null</code>.
72
	 */
73
	public Set getOptions();
74
	
75
	/**
76
	 * This method is provided as a backward compatibility measure to allow access to modes, if mode-based
77
	 * launching is still being used.
78
	 * 
79
	 * @return a set of modes for this delegate or the empty set if none are found, never <code>null</code>.
80
	 */
81
	public Set getModes();
82
	
83
	/**
84
	 * used to determine if the delegate applies to the specified launch configuration type via its id only (no expression evaluation is done)
85
	 * @param configtypeId the id of the <code>ILaunchConfigurationType</code>.
86
	 * @return true if the delegate applies to the associated config type, false otherwise
87
	 */
88
	public boolean appliesTo(String configtypeId);
89
	
90
	/**
91
	 * used to determine if the delegate applies to the specified launch configuration type via its id and mode (no expression evaluation is done)
92
	 * @param configtypeId the id of the <code>ILaunchConfigurationType</code>.
93
	 * @param mode the mode
94
	 * @return true if the delegate applies to the associated config type, false otherwise
95
	 */
96
	public boolean appliesTo(String configtypeId, String mode);
97
}
(-)core/org/eclipse/debug/internal/core/LaunchDelegate.java (+154 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2006 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.debug.internal.core;
12
13
import java.util.HashSet;
14
import java.util.Set;
15
16
import org.eclipse.core.runtime.CoreException;
17
import org.eclipse.core.runtime.IConfigurationElement;
18
import org.eclipse.core.runtime.IStatus;
19
import org.eclipse.core.runtime.Status;
20
import org.eclipse.debug.core.DebugPlugin;
21
import org.eclipse.debug.core.ILaunchDelegate;
22
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
23
24
import com.ibm.icu.text.MessageFormat;
25
26
/**
27
 * Proxy to a launch delegate extension
28
 * 
29
 * @since 3.3
30
 */
31
public class LaunchDelegate implements ILaunchDelegate {
32
	
33
	/**
34
	 * The configuration element for this delegate
35
	 */
36
	private IConfigurationElement fElement = null;
37
	
38
	/**
39
	 * The cached delegate. Remains null until asked for, then persisted
40
	 */
41
	private ILaunchConfigurationDelegate fDelegate = null;
42
	
43
	//lists of cached entries
44
	private HashSet fModes = null;
45
	private HashSet fOptions = null;
46
	private String fType = null;
47
	
48
	/**
49
	 * Constructor
50
	 * @param element the configuration element to associate with this launch delegate
51
	 */
52
	public LaunchDelegate(IConfigurationElement element) {
53
		fElement = element;
54
	}
55
	
56
	/* (non-Javadoc)
57
	 * @see org.eclipse.debug.core.ILaunchDelegate#getDelegate()
58
	 */
59
	public ILaunchConfigurationDelegate getDelegate() throws CoreException {
60
		if(fDelegate == null) {
61
			Object obj = fElement.createExecutableExtension(ConfigurationElementConstants.DELEGATE);
62
			if(obj instanceof ILaunchConfigurationDelegate) {
63
				return (ILaunchConfigurationDelegate)obj;
64
			}
65
			throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_Launch_delegate_for__0__does_not_implement_required_interface_ILaunchConfigurationDelegate__1, new String[]{getIdentifier()}), null));
66
		}
67
		return fDelegate;
68
	}
69
70
	/* (non-Javadoc)
71
	 * @see org.eclipse.debug.core.ILaunchDelegate#getIdentifier()
72
	 */
73
	public String getIdentifier() {
74
		return fElement.getAttribute(ConfigurationElementConstants.ID);
75
	}
76
77
	/* (non-Javadoc)
78
	 * @see org.eclipse.debug.core.ILaunchDelegate#getLaunchConfigurationType()
79
	 */
80
	public String getLaunchConfigurationType() {
81
		if(fType == null) {
82
			//fall back to single association if no appliesTo
83
			fType = fElement.getAttribute(ConfigurationElementConstants.TYPE);
84
			if(fType == null) {
85
				//the case when we have passed a launch configuration type to the launch delegate
86
				fType = fElement.getAttribute(ConfigurationElementConstants.ID);
87
			}
88
		}
89
		return fType;
90
	}
91
92
	/* (non-Javadoc)
93
	 * @see org.eclipse.debug.core.ILaunchDelegate#getOptions()
94
	 */
95
	public Set getOptions() {
96
		if(fOptions == null) {
97
			fOptions = new HashSet();
98
			String option = fElement.getAttribute(ConfigurationElementConstants.OPTIONS);
99
			if(option != null) {
100
				String[] options = option.split(","); //$NON-NLS-1$
101
				for(int i = 0; i < options.length; i++) {
102
					fOptions.add(options[i]);
103
				}
104
			}
105
		}
106
		return fOptions;
107
	}
108
	
109
	/* (non-Javadoc)
110
	 * @see org.eclipse.debug.core.ILaunchDelegate#getModes()
111
	 */
112
	public Set getModes() {
113
		if (fModes == null) {
114
			fModes = new HashSet();
115
			String modes = fElement.getAttribute(ConfigurationElementConstants.MODES); 
116
			if (modes != null) {
117
				String[] strings = modes.split(","); //$NON-NLS-1$
118
				for (int i = 0; i < strings.length; i++) {
119
					fModes.add(strings[i].trim());
120
				}
121
			}
122
		}
123
		return fModes;
124
	}
125
	
126
	/* (non-Javadoc)
127
	 * @see org.eclipse.debug.core.ILaunchDelegate#getSourceLocatorId()
128
	 */
129
	public String getSourceLocatorId() {
130
		return fElement.getAttribute(ConfigurationElementConstants.SOURCE_LOCATOR);
131
	}
132
133
	/* (non-Javadoc)
134
	 * @see org.eclipse.debug.core.ILaunchDelegate#getSourcePathComputerId()
135
	 */
136
	public String getSourcePathComputerId() {
137
		return fElement.getAttribute(ConfigurationElementConstants.SOURCE_PATH_COMPUTER);
138
	}
139
140
	/* (non-Javadoc)
141
	 * @see org.eclipse.debug.core.ILaunchDelegate#appliesTo(java.lang.String)
142
	 */
143
	public boolean appliesTo(String configtypeId) {
144
		return getLaunchConfigurationType().equals(configtypeId);
145
	}
146
	
147
	/* (non-Javadoc)
148
	 * @see org.eclipse.debug.core.ILaunchDelegate#appliesTo(java.lang.String, java.lang.String)
149
	 */
150
	public boolean appliesTo(String configtypeId, String mode) {
151
		return getLaunchConfigurationType().equals(configtypeId) & getModes().contains(mode);
152
	}
153
154
}
(-)plugin.xml (-12 / +33 lines)
Lines 27-57 Link Here
27
   <extension
27
   <extension
28
         point="org.eclipse.debug.core.launchConfigurationTypes">
28
         point="org.eclipse.debug.core.launchConfigurationTypes">
29
      <launchConfigurationType
29
      <launchConfigurationType
30
            delegate="org.eclipse.jdt.launching.JavaLaunchDelegate"
31
            id="org.eclipse.jdt.launching.localJavaApplication"
30
            id="org.eclipse.jdt.launching.localJavaApplication"
32
            migrationDelegate="org.eclipse.jdt.internal.launching.JavaMigrationDelegate"
31
            migrationDelegate="org.eclipse.jdt.internal.launching.JavaMigrationDelegate"
33
            modes="run, debug"
34
            name="%localJavaApplication"
32
            name="%localJavaApplication"
35
            sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"
33
            >
36
            sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer">
37
      </launchConfigurationType>
34
      </launchConfigurationType>
38
      <launchConfigurationType
35
      <launchConfigurationType
39
            delegate="org.eclipse.jdt.internal.launching.JavaRemoteApplicationLaunchConfigurationDelegate"
40
            id="org.eclipse.jdt.launching.remoteJavaApplication"
36
            id="org.eclipse.jdt.launching.remoteJavaApplication"
41
            migrationDelegate="org.eclipse.jdt.internal.launching.JavaMigrationDelegate"
37
            migrationDelegate="org.eclipse.jdt.internal.launching.JavaMigrationDelegate"
42
            modes="debug"
43
            name="%remoteJavaApplication"
38
            name="%remoteJavaApplication"
44
            sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"
39
            >
45
            sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer">
46
      </launchConfigurationType>
40
      </launchConfigurationType>
47
      <launchConfigurationType
41
      <launchConfigurationType
48
            delegate="org.eclipse.jdt.internal.launching.JavaAppletLaunchConfigurationDelegate"
49
            id="org.eclipse.jdt.launching.javaApplet"
42
            id="org.eclipse.jdt.launching.javaApplet"
50
            migrationDelegate="org.eclipse.jdt.internal.launching.JavaMigrationDelegate"
43
            migrationDelegate="org.eclipse.jdt.internal.launching.JavaMigrationDelegate"
51
            modes="run, debug"
52
            name="%appletLabel"
44
            name="%appletLabel"
53
            sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"
45
            >
54
            sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer">
55
      </launchConfigurationType>
46
      </launchConfigurationType>
56
   </extension>
47
   </extension>
57
   <extension
48
   <extension
Lines 189-193 Link Here
189
      	 name= "%jreContainerMarkerProblemName">
180
      	 name= "%jreContainerMarkerProblemName">
190
      <super type="org.eclipse.core.resources.problemmarker"/>
181
      <super type="org.eclipse.core.resources.problemmarker"/>
191
      <persistent value="true"/>
182
      <persistent value="true"/>
183
   </extension>
184
   <extension
185
         point="org.eclipse.debug.core.launchDelegates">
186
      <launchDelegate
187
            delegate="org.eclipse.jdt.launching.JavaLaunchDelegate"
188
            id="org.eclipse.jdt.launching.localJavaApplicationDelegate"
189
            modes="run, debug"
190
            name="%localJavaApplication"
191
            sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"
192
            sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer"
193
            type="org.eclipse.jdt.launching.localJavaApplication">
194
      </launchDelegate>
195
      <launchDelegate
196
            delegate="org.eclipse.jdt.internal.launching.JavaRemoteApplicationLaunchConfigurationDelegate"
197
            id="org.eclipse.jdt.launching.remoteJavaApplicationDelegate"
198
            modes="debug"
199
            name="%remoteJavaApplication"
200
            sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"
201
            sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer"
202
            type="org.eclipse.jdt.launching.remoteJavaApplication">
203
      </launchDelegate>
204
      <launchDelegate
205
            delegate="org.eclipse.jdt.internal.launching.JavaAppletLaunchConfigurationDelegate"
206
            id="org.eclipse.jdt.launching.javaAppletDelegate"
207
            modes="run, debug"
208
            name="%appletLabel"
209
            sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"
210
            sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer"
211
            type="org.eclipse.jdt.launching.javaApplet">
212
      </launchDelegate>
192
   </extension>   
213
   </extension>   
193
</plugin>
214
</plugin>
(-)plugin.properties (+2 lines)
Lines 43-48 Link Here
43
DebugLaunchGroup.title=Select or configure an application to debug
43
DebugLaunchGroup.title=Select or configure an application to debug
44
DebugModelPresentationExtensionName=Debug Model Presentation
44
DebugModelPresentationExtensionName=Debug Model Presentation
45
45
46
LaunchConfigurationTabsExtension.name=Launch Configuration Tabs
47
46
DebugPerspective.name=Debug
48
DebugPerspective.name=Debug
47
DebugPerspective.description=This Debug perspective is designed to support application debugging.  It incorporates views for displaying the debug stack, variables and breakpoint management.
49
DebugPerspective.description=This Debug perspective is designed to support application debugging.  It incorporates views for displaying the debug stack, variables and breakpoint management.
48
50
(-)plugin.xml (+1 lines)
Lines 18-23 Link Here
18
   <extension-point id="memoryRenderings" name="%memoryRenderingsExtensionPointName" schema="schema/memoryRenderings.exsd"/>
18
   <extension-point id="memoryRenderings" name="%memoryRenderingsExtensionPointName" schema="schema/memoryRenderings.exsd"/>
19
   <extension-point id="breakpointOrganizers" name="%BreakpointOrganizersName" schema="schema/breakpointOrganizers.exsd"/>
19
   <extension-point id="breakpointOrganizers" name="%BreakpointOrganizersName" schema="schema/breakpointOrganizers.exsd"/>
20
   <extension-point id="variableValueEditors" name="%VariableValueEditorsName" schema="schema/variableValueEditors.exsd"/>
20
   <extension-point id="variableValueEditors" name="%VariableValueEditorsName" schema="schema/variableValueEditors.exsd"/>
21
   <extension-point id="launchConfigurationTabs" name="%LaunchConfigurationTabsExtension.name" schema="schema/launchConfigurationTabs.exsd"/>
21
22
22
<!-- Extensions -->
23
<!-- Extensions -->
23
   <extension
24
   <extension
(-)schema/launchConfigurationTypeImages.exsd (-31 / +24 lines)
Lines 2-14 Link Here
2
<!-- Schema file written by PDE -->
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.eclipse.debug.ui">
3
<schema targetNamespace="org.eclipse.debug.ui">
4
<annotation>
4
<annotation>
5
   <appInfo>
5
      <appInfo>
6
      <meta.schema plugin="org.eclipse.debug.ui" id="launchConfigurationTypeImages" name="Launch Configuration Type Images"/>
6
         <meta.schema plugin="org.eclipse.debug.ui" id="launchConfigurationTypeImages" name="Launch Configuration Type Images"/>
7
   </appInfo>
7
      </appInfo>
8
   <documentation>
8
      <documentation>
9
      This extension point provides a way to associate an image with a launch configuration type.
9
         This extension point provides a way to associate an image with a launch configuration type when the image resides in a different plug-in than the launch configruation type extension.
10
   </documentation>
10
      </documentation>
11
</annotation>
11
   </annotation>
12
12
13
   <element name="extension">
13
   <element name="extension">
14
      <complexType>
14
      <complexType>
Lines 22-45 Link Here
22
               </documentation>
22
               </documentation>
23
            </annotation>
23
            </annotation>
24
         </attribute>
24
         </attribute>
25
         <attribute name="id" type="string">
26
            <annotation>
27
               <documentation>
28
                  an optional identifier of the extension instance
29
               </documentation>
30
            </annotation>
31
         </attribute>
32
         <attribute name="name" type="string">
33
            <annotation>
34
               <documentation>
35
                 an optional name of the extension instance
36
               </documentation>
37
            </annotation>
38
         </attribute>
39
      </complexType>
25
      </complexType>
40
   </element>
26
   </element>
41
27
42
   <element name="launchConfigurationTypeImage">
28
   <element name="launchConfigurationTypeImage">
29
      <annotation>
30
         <documentation>
31
            &lt;p&gt;In 3.3, if possible, the image for a launch configuration type should be moved to the launch configuration type extension contribution&lt;/p&gt;
32
         </documentation>
33
      </annotation>
43
      <complexType>
34
      <complexType>
44
         <attribute name="id" type="string" use="required">
35
         <attribute name="id" type="string" use="required">
45
            <annotation>
36
            <annotation>
Lines 51-57 Link Here
51
         <attribute name="configTypeID" type="string" use="required">
42
         <attribute name="configTypeID" type="string" use="required">
52
            <annotation>
43
            <annotation>
53
               <documentation>
44
               <documentation>
54
                  specifies the fully qualified ID of a launch configuration type.(in 2.1, this attribute can also be specified using the "type" attribute, to be consistent with the launchConfigurationTabGroups extension point).
45
                  specifies the fully qualified ID of a launch configuration type.(in 2.1, this attribute can also be specified using the &quot;type&quot; attribute, to be consistent with the launchConfigurationTabGroups extension point).
55
               </documentation>
46
               </documentation>
56
            </annotation>
47
            </annotation>
57
         </attribute>
48
         </attribute>
Lines 59-64 Link Here
59
            <annotation>
50
            <annotation>
60
               <documentation>
51
               <documentation>
61
                  specifies the plugin-relative path of an image file.
52
                  specifies the plugin-relative path of an image file.
53
54
&lt;br&gt;Since 3.3 an image can be specified in the launch configuration type definition.
62
               </documentation>
55
               </documentation>
63
               <appInfo>
56
               <appInfo>
64
                  <meta.attribute kind="resource"/>
57
                  <meta.attribute kind="resource"/>
Lines 77-100 Link Here
77
70
78
&lt;p&gt;
71
&lt;p&gt;
79
&lt;pre&gt;
72
&lt;pre&gt;
80
	&lt;extension point="org.eclipse.debug.ui.launchConfigurationTypeImages"&gt;
73
 &lt;extension point=&quot;org.eclipse.debug.ui.launchConfigurationTypeImages&quot;&gt;
81
		&lt;launchConfigurationTypeImage
74
  &lt;launchConfigurationTypeImage
82
			  id="com.example.FirstLaunchConfigurationTypeImage"
75
     id=&quot;com.example.FirstLaunchConfigurationTypeImage&quot;
83
			  configTypeID="com.example.FirstLaunchConfigurationType"
76
     configTypeID=&quot;com.example.FirstLaunchConfigurationType&quot;
84
			  icon="icons/FirstLaunchConfigurationType.gif"&gt;
77
     icon=&quot;icons/FirstLaunchConfigurationType.gif&quot;&gt;
85
		&lt;/launchConfigurationTypeImage&gt;
78
  &lt;/launchConfigurationTypeImage&gt;
86
	&lt;/extension&gt;
79
 &lt;/extension&gt;
87
&lt;/pre&gt;
80
&lt;/pre&gt;
88
&lt;/p&gt;
81
&lt;/p&gt;
89
      </documentation>
82
      </documentation>
90
   </annotation>
83
   </annotation>
91
   
84
92
   <annotation>
85
   <annotation>
93
      <appInfo>
86
      <appInfo>
94
         <meta.section type="copyright"/>
87
         <meta.section type="copyright"/>
95
      </appInfo>
88
      </appInfo>
96
      <documentation>
89
      <documentation>
97
Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
90
         Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
98
All rights reserved. This program and the accompanying materials are made 
91
All rights reserved. This program and the accompanying materials are made 
99
available under the terms of the Eclipse Public License v1.0 which 
92
available under the terms of the Eclipse Public License v1.0 which 
100
accompanies this distribution, and is available at 
93
accompanies this distribution, and is available at 
(-)ui/org/eclipse/debug/internal/ui/DebugPluginImages.java (-13 / +35 lines)
Lines 14-25 Link Here
14
14
15
15
16
import java.net.URL;
16
import java.net.URL;
17
import java.util.HashSet;
18
import java.util.Set;
17
19
18
import org.eclipse.core.runtime.FileLocator;
20
import org.eclipse.core.runtime.FileLocator;
19
import org.eclipse.core.runtime.IConfigurationElement;
21
import org.eclipse.core.runtime.IConfigurationElement;
20
import org.eclipse.core.runtime.IExtensionPoint;
22
import org.eclipse.core.runtime.IExtensionPoint;
21
import org.eclipse.core.runtime.Path;
23
import org.eclipse.core.runtime.Path;
22
import org.eclipse.core.runtime.Platform;
24
import org.eclipse.core.runtime.Platform;
25
import org.eclipse.debug.core.DebugPlugin;
26
import org.eclipse.debug.core.ILaunchConfigurationType;
27
import org.eclipse.debug.internal.core.ConfigurationElementConstants;
23
import org.eclipse.debug.ui.IDebugUIConstants;
28
import org.eclipse.debug.ui.IDebugUIConstants;
24
import org.eclipse.jface.resource.ImageDescriptor;
29
import org.eclipse.jface.resource.ImageDescriptor;
25
import org.eclipse.jface.resource.ImageRegistry;
30
import org.eclipse.jface.resource.ImageRegistry;
Lines 230-249 Link Here
230
		declareRegistryImage(IInternalDebugUIConstants.IMG_EDIT_SRC_DIR_WIZ, WIZBAN + "editdir_wiz.png"); //$NON-NLS-1$
235
		declareRegistryImage(IInternalDebugUIConstants.IMG_EDIT_SRC_DIR_WIZ, WIZBAN + "editdir_wiz.png"); //$NON-NLS-1$
231
		
236
		
232
		// launch configuration types
237
		// launch configuration types
233
		IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPE_IMAGES);
238
		//try to get the images from the config types themselves, cache those that could not be found
234
		IConfigurationElement[] configElements= extensionPoint.getConfigurationElements();
239
		ILaunchConfigurationType[] types = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes();
235
		for (int i = 0; i < configElements.length; i++) {
240
		String path = null;
236
			IConfigurationElement configElement = configElements[i];
241
		Set missing = new HashSet();
237
			ImageDescriptor descriptor = DebugUIPlugin.getImageDescriptor(configElement, ATTR_LAUNCH_CONFIG_TYPE_ICON);
242
		ImageDescriptor descriptor = null;
238
			if (descriptor == null) {
243
		for (int i = 0; i < types.length; i++) {
239
				descriptor = ImageDescriptor.getMissingImageDescriptor();
244
			path = types[i].getImageDescriptorPath();
245
			if(path == null) {
246
				missing.add(types[i].getIdentifier());
247
			}
248
			else {
249
				descriptor = DebugUIPlugin.getImageDescriptor(types[i].getContributorName(), path);
250
				imageRegistry.put(types[i].getIdentifier(), (descriptor == null ? ImageDescriptor.getMissingImageDescriptor() : descriptor));
251
			}
252
		}
253
		if(missing.size() > 0) {
254
			//if we are missing some images try to find them in the deprecated extension point
255
			IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPE_IMAGES);
256
			IConfigurationElement[] configElements = extensionPoint.getConfigurationElements();
257
			String configTypeID = null;
258
			for (int i = 0; i < configElements.length; i++) {
259
				configTypeID = configElements[i].getAttribute(ATTR_LAUNCH_CONFIG_TYPE_ID);
260
				if (configTypeID == null) {
261
					// bug 12652
262
					configTypeID = configElements[i].getAttribute(ConfigurationElementConstants.TYPE);
263
				}
264
				if(missing.contains(configTypeID)) {
265
					descriptor = DebugUIPlugin.getImageDescriptor(configElements[i], ATTR_LAUNCH_CONFIG_TYPE_ICON);		
266
					imageRegistry.put(configTypeID, (descriptor == null ? ImageDescriptor.getMissingImageDescriptor() : descriptor));
267
				}
240
			}
268
			}
241
			String configTypeID = configElement.getAttribute(ATTR_LAUNCH_CONFIG_TYPE_ID);
242
			if (configTypeID == null) {
243
				// bug 12652
244
				configTypeID = configElement.getAttribute("type"); //$NON-NLS-1$
245
			}			
246
			imageRegistry.put(configTypeID, descriptor);				
247
		}
269
		}
248
	}
270
	}
249
271
(-)ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java (+20 lines)
Lines 1037-1042 Link Here
1037
    }
1037
    }
1038
    
1038
    
1039
    /**
1039
    /**
1040
     * Returns an image descriptor for the icon referenced by the given path
1041
     * and contributor name, or <code>null</code> if none.
1042
     * 
1043
     * @param name the name of the contributor
1044
     * @param path the path of the icon (from the configuration element)
1045
     * @return image descriptor or <code>null</code>
1046
     * @since 3.3
1047
     */
1048
    public static ImageDescriptor getImageDescriptor(String name, String path) {
1049
		Bundle bundle = Platform.getBundle(name);
1050
		if (path != null) {
1051
			URL iconURL = FileLocator.find(bundle , new Path(path), null);
1052
			if (iconURL != null) {
1053
				return ImageDescriptor.createFromURL(iconURL);
1054
			}
1055
		}    	
1056
		return null;
1057
    }
1058
    
1059
    /**
1040
	 * Performs extra filtering for launch configurations based on the prefs set on the 
1060
	 * Performs extra filtering for launch configurations based on the prefs set on the 
1041
	 * Launch Configurations page
1061
	 * Launch Configurations page
1042
	 * @param config the config to filter
1062
	 * @param config the config to filter
(-)ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java (-11 / +26 lines)
Lines 18-23 Link Here
18
18
19
import org.eclipse.core.runtime.CoreException;
19
import org.eclipse.core.runtime.CoreException;
20
import org.eclipse.core.runtime.IConfigurationElement;
20
import org.eclipse.core.runtime.IConfigurationElement;
21
import org.eclipse.debug.internal.core.ConfigurationElementConstants;
21
import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
22
import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
22
23
23
24
Lines 84-98 Link Here
84
	 */
85
	 */
85
	protected Set getModes() {
86
	protected Set getModes() {
86
		if (fModes == null) {
87
		if (fModes == null) {
87
			IConfigurationElement[] modes= getConfigurationElement().getChildren("launchMode"); //$NON-NLS-1$
88
			IConfigurationElement[] modes= getConfigurationElement().getChildren(ConfigurationElementConstants.LAUNCH_MODE);
88
			if (modes.length > 0) {
89
			if (modes.length > 0) {
89
				fModes = new HashSet(modes.length);
90
				fModes = new HashSet(modes.length);
90
				fPerspectives = new Hashtable(modes.length);
91
				fPerspectives = new Hashtable(modes.length);
92
				IConfigurationElement element = null;
93
				String perspective = null;
94
				String mode = null;
91
				for (int i = 0; i < modes.length; i++) {
95
				for (int i = 0; i < modes.length; i++) {
92
					IConfigurationElement element = modes[i];
96
					element = modes[i];
93
					String mode = element.getAttribute("mode"); //$NON-NLS-1$
97
					mode = element.getAttribute(ConfigurationElementConstants.MODE);
94
					fModes.add(mode);
98
					fModes.add(mode);
95
					String perspective = element.getAttribute("perspective"); //$NON-NLS-1$
99
					perspective = element.getAttribute(ConfigurationElementConstants.PERSPECTIVE);
96
					if (perspective != null) {
100
					if (perspective != null) {
97
						fPerspectives.put(mode, perspective);
101
						fPerspectives.put(mode, perspective);
98
					}
102
					}
Lines 127-133 Link Here
127
	 *  tab group is associated with
131
	 *  tab group is associated with
128
	 */	
132
	 */	
129
	protected String getTypeIdentifier() {
133
	protected String getTypeIdentifier() {
130
		return getConfigurationElement().getAttribute("type"); //$NON-NLS-1$
134
		return getConfigurationElement().getAttribute(ConfigurationElementConstants.TYPE);
131
	}
135
	}
132
	
136
	
133
	/**
137
	/**
Lines 139-145 Link Here
139
	 * @since 2.1
143
	 * @since 2.1
140
	 */	
144
	 */	
141
	protected String getHelpContextId() {
145
	protected String getHelpContextId() {
142
		return getConfigurationElement().getAttribute("helpContextId"); //$NON-NLS-1$		
146
		return getConfigurationElement().getAttribute(ConfigurationElementConstants.HELP_CONTEXT_ID);		
147
	}
148
	
149
	/**
150
	 * Returns the identifier of the tab group
151
	 * @return the id of the tab group
152
	 * 
153
	 * @since 3.3
154
	 */
155
	protected String getIdentifier() {
156
		return getConfigurationElement().getAttribute(ConfigurationElementConstants.ID); 
143
	}
157
	}
144
	
158
	
145
	/**
159
	/**
Lines 150-156 Link Here
150
	 * 	the tab group
164
	 * 	the tab group
151
	 */
165
	 */
152
	public ILaunchConfigurationTabGroup newTabGroup() throws CoreException {
166
	public ILaunchConfigurationTabGroup newTabGroup() throws CoreException {
153
		return (ILaunchConfigurationTabGroup)getConfigurationElement().createExecutableExtension("class"); //$NON-NLS-1$
167
		return (ILaunchConfigurationTabGroup)getConfigurationElement().createExecutableExtension(ConfigurationElementConstants.CLASS); 
154
	}
168
	}
155
169
156
	/**
170
	/**
Lines 163-179 Link Here
163
	public String getDescription(String mode) {
177
	public String getDescription(String mode) {
164
		String description = null;
178
		String description = null;
165
		
179
		
166
		IConfigurationElement[] children = fConfig.getChildren("launchMode"); //$NON-NLS-1$
180
		IConfigurationElement[] children = fConfig.getChildren(ConfigurationElementConstants.LAUNCH_MODE);
167
		if (children!= null && children.length != 0) {
181
		if (children!= null && children.length != 0) {
182
			IConfigurationElement child = null;
168
			for (int i=0; i<children.length; i++) {
183
			for (int i=0; i<children.length; i++) {
169
				IConfigurationElement child = children[i];
184
				child = children[i];
170
				if (child.getAttribute("mode").equals(mode)) { //$NON-NLS-1$
185
				if (child.getAttribute("mode").equals(mode)) { //$NON-NLS-1$
171
					description = child.getAttribute("description"); //$NON-NLS-1$
186
					description = child.getAttribute(ConfigurationElementConstants.DESCRIPTION);
172
				}
187
				}
173
			}
188
			}
174
		} 
189
		} 
175
		if (description == null){
190
		if (description == null){
176
			description = fConfig.getAttribute("description"); //$NON-NLS-1$
191
			description = fConfig.getAttribute(ConfigurationElementConstants.DESCRIPTION);
177
		}
192
		}
178
		
193
		
179
		if (description == null)
194
		if (description == null)
(-)ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java (-1 / +1 lines)
Lines 68-74 Link Here
68
	public void updateButtons() {
68
	public void updateButtons() {
69
		// Launch button
69
		// Launch button
70
		getTabViewer().refresh();
70
		getTabViewer().refresh();
71
		getButton(ID_LAUNCH_BUTTON).setEnabled(getTabViewer().canLaunch());
71
		getButton(ID_LAUNCH_BUTTON).setEnabled(getTabViewer().canLaunch() & getTabViewer().canLaunchWithOptions());
72
		
72
		
73
	}
73
	}
74
		
74
		
(-)ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java (+47 lines)
Lines 11-16 Link Here
11
package org.eclipse.debug.internal.ui.launchConfigurations;
11
package org.eclipse.debug.internal.ui.launchConfigurations;
12
12
13
13
14
import java.util.List;
15
14
import org.eclipse.core.resources.IResource;
16
import org.eclipse.core.resources.IResource;
15
import org.eclipse.core.resources.ResourcesPlugin;
17
import org.eclipse.core.resources.ResourcesPlugin;
16
import org.eclipse.core.runtime.CoreException;
18
import org.eclipse.core.runtime.CoreException;
Lines 958-966 Link Here
958
				return false;
960
				return false;
959
			}
961
			}
960
		}
962
		}
963
		
961
		return true;
964
		return true;
962
	}	
965
	}	
963
	
966
	
967
	
968
	/**
969
	 * <p>
970
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
971
	 * part of a work in progress. There is no guarantee that this API will
972
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
973
	 * without consulting with the Platform/Debug team.
974
	 * </p>
975
	 * @return
976
	 */
977
	public boolean canLaunchWithOptions() {
978
		if(fInitializingTabs) {
979
			return false;
980
		}
981
		//check if selected options exist and that the selected combination can be launched
982
		try {
983
			ILaunchConfigurationWorkingCopy wc = getWorkingCopy();
984
			if(wc != null) {
985
				List options = wc.getOptions();
986
				if(options.size() > 0) {
987
					return DebugPlugin.getDefault().getLaunchManager().getLaunchDelegates(fTabType.getIdentifier(), getLaunchConfigurationDialog().getMode(), (String[]) options.toArray(new String[options.size()])).length > 0;
988
				}
989
			}
990
		} 
991
		catch (CoreException e) {
992
			e.printStackTrace();
993
		}
994
		return true;
995
	}
996
	
964
	/**
997
	/**
965
	 * Returns the current error message or <code>null</code> if none.
998
	 * Returns the current error message or <code>null</code> if none.
966
	 */
999
	 */
Lines 988-993 Link Here
988
			return message;
1021
			return message;
989
		}
1022
		}
990
		
1023
		
1024
	//EXPERIMENTAL
991
		ILaunchConfigurationTab[] allTabs = getTabs();
1025
		ILaunchConfigurationTab[] allTabs = getTabs();
992
		for (int i = 0; i < allTabs.length; i++) {
1026
		for (int i = 0; i < allTabs.length; i++) {
993
			ILaunchConfigurationTab tab = allTabs[i];
1027
			ILaunchConfigurationTab tab = allTabs[i];
Lines 1004-1009 Link Here
1004
				return temp.toString();
1038
				return temp.toString();
1005
			}
1039
			}
1006
		}
1040
		}
1041
		if(!canLaunchWithOptions()) {
1042
			try {
1043
				Object o = getInput();
1044
				String name = null;
1045
				if(o instanceof ILaunchConfiguration) {
1046
					ILaunchConfiguration lc = (ILaunchConfiguration) o;
1047
					name = LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_9+lc.getName();
1048
				}
1049
				return (name == null ? LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_10 : name) + LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_11+getLaunchConfigurationDialog().getMode()+LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_12+getWorkingCopy().getOptions().toString();
1050
			} catch (CoreException e) {
1051
				e.printStackTrace();
1052
			}
1053
		}
1007
		return null;
1054
		return null;
1008
	}	
1055
	}	
1009
	
1056
	
(-)ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties (+4 lines)
Lines 46-57 Link Here
46
LaunchConfigurationDialog_An_exception_occurred_while_retrieving_launch_configurations_20=An exception occurred while retrieving launch configurations
46
LaunchConfigurationDialog_An_exception_occurred_while_retrieving_launch_configurations_20=An exception occurred while retrieving launch configurations
47
LaunchConfigurationTabGroupViewer_0={0} is an invalid character in launch configuration name {1}
47
LaunchConfigurationTabGroupViewer_0={0} is an invalid character in launch configuration name {1}
48
LaunchConfigurationTabGroupViewer_1=Configure launch settings from this dialog:
48
LaunchConfigurationTabGroupViewer_1=Configure launch settings from this dialog:
49
LaunchConfigurationTabGroupViewer_10=The selected configuration
50
LaunchConfigurationTabGroupViewer_11=\ cannot be launched with the set of options: 
51
LaunchConfigurationTabGroupViewer_12=\ and 
49
LaunchConfigurationTabGroupViewer_2=- Press the 'New' button to create a configuration of the selected type.
52
LaunchConfigurationTabGroupViewer_2=- Press the 'New' button to create a configuration of the selected type.
50
LaunchConfigurationTabGroupViewer_3=- Edit or view an existing configuration by selecting it.
53
LaunchConfigurationTabGroupViewer_3=- Edit or view an existing configuration by selecting it.
51
LaunchConfigurationTabGroupViewer_4=- Press the 'Delete' button to remove the selected configuration.
54
LaunchConfigurationTabGroupViewer_4=- Press the 'Delete' button to remove the selected configuration.
52
LaunchConfigurationTabGroupViewer_6=- Press the 'Duplicate' button to copy the selected configuration.
55
LaunchConfigurationTabGroupViewer_6=- Press the 'Duplicate' button to copy the selected configuration.
53
LaunchConfigurationTabGroupViewer_5=Configure launch perspective settings from the <a>Perspectives</a> preference page.
56
LaunchConfigurationTabGroupViewer_5=Configure launch perspective settings from the <a>Perspectives</a> preference page.
54
LaunchConfigurationTabGroupViewer_8=- Press the 'Filter' button to configure filtering options.
57
LaunchConfigurationTabGroupViewer_8=- Press the 'Filter' button to configure filtering options.
58
LaunchConfigurationTabGroupViewer_9=Configuration 
55
LaunchConfigurationDialog_Create__manage__and_run_launch_configurations_8=Create, manage, and run configurations
59
LaunchConfigurationDialog_Create__manage__and_run_launch_configurations_8=Create, manage, and run configurations
56
LaunchConfigurationDialog_Dele_te_14=De&lete
60
LaunchConfigurationDialog_Dele_te_14=De&lete
57
LaunchConfigurationDialog_Discard_changes__38=Discard changes?
61
LaunchConfigurationDialog_Discard_changes__38=Discard changes?
(-)ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java (-36 / +97 lines)
Lines 11-16 Link Here
11
package org.eclipse.debug.internal.ui.launchConfigurations;
11
package org.eclipse.debug.internal.ui.launchConfigurations;
12
12
13
 
13
 
14
import java.util.ArrayList;
14
import java.util.Hashtable;
15
import java.util.Hashtable;
15
import java.util.Iterator;
16
import java.util.Iterator;
16
import java.util.Map;
17
import java.util.Map;
Lines 22-31 Link Here
22
import org.eclipse.core.runtime.IStatus;
23
import org.eclipse.core.runtime.IStatus;
23
import org.eclipse.core.runtime.Platform;
24
import org.eclipse.core.runtime.Platform;
24
import org.eclipse.core.runtime.Status;
25
import org.eclipse.core.runtime.Status;
25
import org.eclipse.debug.core.DebugPlugin;
26
import org.eclipse.debug.core.ILaunchConfigurationType;
26
import org.eclipse.debug.core.ILaunchConfigurationType;
27
import org.eclipse.debug.internal.core.ConfigurationElementConstants;
27
import org.eclipse.debug.internal.ui.DebugUIPlugin;
28
import org.eclipse.debug.internal.ui.DebugUIPlugin;
29
import org.eclipse.debug.internal.ui.LaunchConfigurationTabExtension;
28
import org.eclipse.debug.ui.IDebugUIConstants;
30
import org.eclipse.debug.ui.IDebugUIConstants;
31
import org.eclipse.debug.ui.ILaunchConfigurationTab;
29
import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
32
import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
30
33
31
import com.ibm.icu.text.MessageFormat;
34
import com.ibm.icu.text.MessageFormat;
Lines 49-54 Link Here
49
	 * used to represent the default tab group (i.e. unspecified mode).
52
	 * used to represent the default tab group (i.e. unspecified mode).
50
	 */
53
	 */
51
	private Hashtable fTabGroupExtensions;	
54
	private Hashtable fTabGroupExtensions;	
55
	
56
	/**
57
	 * contributed tabs are stored by the tab group id that they contribute to.
58
	 * each entry is a futher <code>Hashtable</code> consisting of the corrseponding
59
	 * <code>LaunchConfigurationTabExtension</code> objects for each contributed tab stored by their 
60
	 * id
61
	 * 
62
	 * @since 3.3
63
	 */
64
	private Hashtable fContributedTabs;
52
			
65
			
53
	/**
66
	/**
54
	 * Constructs the singleton launch configuration presentation
67
	 * Constructs the singleton launch configuration presentation
Lines 57-62 Link Here
57
	private LaunchConfigurationPresentationManager() {
70
	private LaunchConfigurationPresentationManager() {
58
		fgDefault = this;
71
		fgDefault = this;
59
		initializeTabGroupExtensions();
72
		initializeTabGroupExtensions();
73
		initializeContributedTabExtensions();
60
	}
74
	}
61
75
62
	/**
76
	/**
Lines 75-126 Link Here
75
	 */
89
	 */
76
	private void initializeTabGroupExtensions() {
90
	private void initializeTabGroupExtensions() {
77
		fTabGroupExtensions = new Hashtable();
91
		fTabGroupExtensions = new Hashtable();
78
		IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_LAUNCH_CONFIGURATION_TAB_GROUPS);
92
		IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_LAUNCH_CONFIGURATION_TAB_GROUPS);
79
		IConfigurationElement[] groups = extensionPoint.getConfigurationElements();
93
		IConfigurationElement[] groups = extensionPoint.getConfigurationElements();
94
		LaunchConfigurationTabGroupExtension group = null;
95
		String typeId = null;
96
		Map map = null;
97
		Set modes = null;
80
		for (int i = 0; i < groups.length; i++) {
98
		for (int i = 0; i < groups.length; i++) {
81
			LaunchConfigurationTabGroupExtension group = new LaunchConfigurationTabGroupExtension(groups[i]);
99
			group = new LaunchConfigurationTabGroupExtension(groups[i]);
82
			String typeId = group.getTypeIdentifier();
100
			typeId = group.getTypeIdentifier();
83
			if (typeId == null) {
101
			map = (Map)fTabGroupExtensions.get(typeId);
84
				IStatus status = new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.STATUS_INVALID_EXTENSION_DEFINITION,
102
			if (map == null) {
85
					 MessageFormat.format("Launch configuration tab group extension {0} does not specify launch configuration type.", (new String[] {groups[i].getAttribute("id")})), null);  //$NON-NLS-1$ //$NON-NLS-2$
103
				map = new Hashtable();
86
					DebugUIPlugin.log(status);
104
				fTabGroupExtensions.put(typeId, map);
87
			} else {
88
				// verify it references a valid launch configuration type
89
				ILaunchConfigurationType lct = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(typeId);
90
				if (lct == null) {
91
					IStatus status = new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.STATUS_INVALID_EXTENSION_DEFINITION,
92
					 MessageFormat.format("Launch configuration tab group extension {0} refers to non-existent launch configuration type {1}.", (new String[] {groups[i].getAttribute("id"), typeId})), null);  //$NON-NLS-1$ //$NON-NLS-2$
93
					DebugUIPlugin.log(status);
94
				}
95
			}
105
			}
96
			if (typeId != null) {
106
			modes = group.getModes();
97
				// get the map for the config type
107
			if (modes == null) {
98
				Map map = (Map)fTabGroupExtensions.get(typeId);
108
				// default tabs - store with "*"
99
				if (map == null) {
109
				map.put("*", group); //$NON-NLS-1$
100
					map = new Hashtable();
110
			} else {
101
					fTabGroupExtensions.put(typeId, map);
111
				// store per mode
102
				}
112
				Iterator iterator = modes.iterator();
103
				Set modes = group.getModes();
113
				while (iterator.hasNext()) {
104
				if (modes == null) {
114
					map.put(iterator.next(), group);
105
					// default tabs - store with "*"
106
					map.put("*", group); //$NON-NLS-1$
107
				} else {
108
					// store per mode
109
					Iterator iterator = modes.iterator();
110
					while (iterator.hasNext()) {
111
						map.put(iterator.next(), group);
112
					}
113
				}
115
				}
114
			}
116
			}
115
		}
117
		}
116
	}	
118
	}	
117
	
119
	
118
	/**
120
	/**
121
	 * This method is used to collect all of the contributed tabs defined by the <code>launchConfigurationTabs</code>
122
	 * extension point
123
	 * <p>
124
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
125
	 * part of a work in progress. There is no guarantee that this API will
126
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
127
	 * without consulting with the Platform/Debug team.
128
	 * </p>
129
	 * @since 3.3
130
	 */
131
	private void initializeContributedTabExtensions() {
132
		fContributedTabs = new Hashtable();
133
		IExtensionPoint epoint = Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_CONTRIBUTED_LAUNCH_TABS);
134
		IConfigurationElement[] elements = epoint.getConfigurationElements();
135
		LaunchConfigurationTabExtension tab = null;
136
		Hashtable element = null;
137
		for(int i = 0; i < elements.length; i++) {
138
			tab = new LaunchConfigurationTabExtension(elements[i]);
139
			element = (Hashtable) fContributedTabs.get(tab.getTabGroupId());
140
			if(element == null) {
141
				element = new Hashtable();
142
				element.put(tab.getIdentifier(), tab);
143
				fContributedTabs.put(tab.getTabGroupId(), element);
144
			}
145
			element.put(tab.getIdentifier(), tab);
146
		}
147
	}
148
	
149
	/**
119
	 * Returns the tab group for the given launch configuration type and mode.
150
	 * Returns the tab group for the given launch configuration type and mode.
120
	 * 
151
	 * 
121
	 * @param type launch configuration type
152
	 * @param type launch configuration type
122
	 * @param mode launch mode
153
	 * @param mode launch mode
123
	 * @return the tab group for the given type of launch configuration
154
	 * @return the tab group for the given type of launch configuration, or <code>null</code> if none
124
	 * @exception CoreException if an exception occurs creating the group
155
	 * @exception CoreException if an exception occurs creating the group
125
	 */
156
	 */
126
	public ILaunchConfigurationTabGroup getTabGroup(ILaunchConfigurationType type, String mode) throws CoreException {
157
	public ILaunchConfigurationTabGroup getTabGroup(ILaunchConfigurationType type, String mode) throws CoreException {
Lines 130-136 Link Here
130
			 MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationPresentationManager_No_tab_group_defined_for_launch_configuration_type__0__3, (new String[] {type.getIdentifier()})), null);  
161
			 MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationPresentationManager_No_tab_group_defined_for_launch_configuration_type__0__3, (new String[] {type.getIdentifier()})), null);  
131
			 throw new CoreException(status);
162
			 throw new CoreException(status);
132
		} 
163
		} 
133
		return ext.newTabGroup();		
164
		return new LaunchConfigurationTabGroupWrapper(ext.newTabGroup(), ext.getIdentifier());		
165
	}
166
	
167
	/**
168
	 * Returns the listing of <code>ILaunchConfigurationTab</code>s for the specified <code>ILaunchConfigurationTabGroup</code>.
169
	 * If no tabs are found for the specified id an empty array is returned, never <code>null</code>
170
	 * @param groupid
171
	 * @return the <code>ILaunchConfigurationTab</code>s for the specified <code>ILaunchConfigurationTabGroup</code> id,
172
	 * or an empty array if none are found
173
	 * 
174
	 * <p>
175
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
176
	 * part of a work in progress. There is no guarantee that this API will
177
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
178
	 * without consulting with the Platform/Debug team.
179
	 * </p>
180
	 * @since 3.3
181
	 */
182
	public ILaunchConfigurationTab[] createContributedTabs(String groupid) {
183
		Hashtable tabs = (Hashtable) fContributedTabs.get(groupid);
184
		ArrayList list = new ArrayList();
185
		if(tabs != null) {
186
			LaunchConfigurationTabExtension ext = null;
187
			for(Iterator iter = tabs.keySet().iterator(); iter.hasNext();) {
188
				ext = (LaunchConfigurationTabExtension) tabs.get(iter.next());
189
				if(ext != null) {
190
					list.add(ext.getTab());
191
				}
192
			}
193
		}
194
		return (ILaunchConfigurationTab[]) list.toArray(new ILaunchConfigurationTab[list.size()]);
134
	}
195
	}
135
	
196
	
136
	/**
197
	/**
Lines 187-193 Link Here
187
	 */
248
	 */
188
	public String getDescription(ILaunchConfigurationType configType, String mode) {
249
	public String getDescription(ILaunchConfigurationType configType, String mode) {
189
		LaunchConfigurationPresentationManager manager = LaunchConfigurationPresentationManager.getDefault();
250
		LaunchConfigurationPresentationManager manager = LaunchConfigurationPresentationManager.getDefault();
190
		LaunchConfigurationTabGroupExtension extension = manager.getExtension(configType.getAttribute("id"), mode); //$NON-NLS-1$
251
		LaunchConfigurationTabGroupExtension extension = manager.getExtension(configType.getAttribute(ConfigurationElementConstants.ID), mode);
191
		return (extension != null ? extension.getDescription(mode) : null);
252
		return (extension != null ? extension.getDescription(mode) : null);
192
	}	
253
	}	
193
	
254
	
(-)ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java (-2 / +2 lines)
Lines 519-525 Link Here
519
				IStructuredSelection selection = (IStructuredSelection)fLaunchConfigurationView.getViewer().getSelection();
519
				IStructuredSelection selection = (IStructuredSelection)fLaunchConfigurationView.getViewer().getSelection();
520
				Object target = selection.getFirstElement();
520
				Object target = selection.getFirstElement();
521
				if (target instanceof ILaunchConfiguration) {
521
				if (target instanceof ILaunchConfiguration) {
522
					if (getTabViewer().canLaunch()) {
522
					if (getTabViewer().canLaunch() & getTabViewer().canLaunchWithOptions()) {
523
						handleLaunchPressed();
523
						handleLaunchPressed();
524
					}
524
					}
525
				} else {
525
				} else {
Lines 1421-1427 Link Here
1421
		getDeleteAction().setEnabled(getDeleteAction().isEnabled());
1421
		getDeleteAction().setEnabled(getDeleteAction().isEnabled());
1422
		getDuplicateAction().setEnabled(getDuplicateAction().isEnabled());
1422
		getDuplicateAction().setEnabled(getDuplicateAction().isEnabled());
1423
		getTabViewer().refresh();
1423
		getTabViewer().refresh();
1424
		getButton(ID_LAUNCH_BUTTON).setEnabled(getTabViewer().canLaunch());
1424
		getButton(ID_LAUNCH_BUTTON).setEnabled(getTabViewer().canLaunch() & getTabViewer().canLaunchWithOptions());
1425
	}
1425
	}
1426
1426
1427
	/* (non-Javadoc)
1427
	/* (non-Javadoc)
(-)ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java (+8 lines)
Lines 88-93 Link Here
88
	public static String LaunchConfigurationsDialog_Warning_2;
88
	public static String LaunchConfigurationsDialog_Warning_2;
89
	public static String LaunchConfigurationsDialog_Information_3;
89
	public static String LaunchConfigurationsDialog_Information_3;
90
	public static String LaunchConfigurationPresentationManager_No_tab_group_defined_for_launch_configuration_type__0__3;
90
	public static String LaunchConfigurationPresentationManager_No_tab_group_defined_for_launch_configuration_type__0__3;
91
92
	public static String LaunchConfigurationTabGroupViewer_10;
93
94
	public static String LaunchConfigurationTabGroupViewer_11;
95
96
	public static String LaunchConfigurationTabGroupViewer_12;
97
98
	public static String LaunchConfigurationTabGroupViewer_9;
91
	public static String PerspectiveManager_Error_1;
99
	public static String PerspectiveManager_Error_1;
92
	public static String PerspectiveManager_Unable_to_switch_perpsectives_as_specified_by_launch___0__4;
100
	public static String PerspectiveManager_Unable_to_switch_perpsectives_as_specified_by_launch___0__4;
93
	public static String PerspectiveManager_Unable_to_switch_to_perspective___0__2;
101
	public static String PerspectiveManager_Unable_to_switch_to_perspective___0__2;
(-)ui/org/eclipse/debug/ui/IDebugUIConstants.java (+15 lines)
Lines 927-932 Link Here
927
	public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_TAB_GROUPS= "launchConfigurationTabGroups";	 //$NON-NLS-1$	
927
	public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_TAB_GROUPS= "launchConfigurationTabGroups";	 //$NON-NLS-1$	
928
928
929
	/**
929
	/**
930
	 * Launch configuration tabs extension point identifier
931
	 * (value <code>"launchConfigurationTabs"</code>).
932
	 * 
933
	 * <p>
934
	 * <strong>EXPERIMENTAL</strong>. This constant has been added as
935
	 * part of a work in progress. There is no guarantee that this API will
936
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
937
	 * without consulting with the Platform/Debug team.
938
	 * </p>
939
	 * 
940
	 * @since 3.3
941
	 */
942
	public static final String EXTENSION_POINT_CONTRIBUTED_LAUNCH_TABS = "launchConfigurationTabs"; //$NON-NLS-1$
943
	
944
	/**
930
	 * Launch shortcuts extension point identifier
945
	 * Launch shortcuts extension point identifier
931
	 * (value <code>"launchShortcuts"</code>).
946
	 * (value <code>"launchShortcuts"</code>).
932
	 * 
947
	 * 
(-)schema/launchConfigurationTabs.exsd (+137 lines)
Added Link Here
1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.eclipse.debug.ui">
4
<annotation>
5
      <appInfo>
6
         <meta.schema plugin="org.eclipse.debug.ui" id="launchConfigurationTabs" name="Launch Configuration Tabs"/>
7
      </appInfo>
8
      <documentation>
9
         This extension point is used to allow developers to contribute launch configuration tabs (one or more) to an existing launch configuration tab group.
10
11
12
&lt;p&gt;&lt;strong&gt;EXPERIMENTAL&lt;/strong&gt;. This method has been added as
13
part of a work in progress. There is no guarantee that this API will
14
remain unchanged during the 3.3 release cycle. Please do not use this API
15
without consulting with the Platform/Debug team.&lt;/p&gt;
16
      </documentation>
17
   </annotation>
18
19
   <element name="extension">
20
      <complexType>
21
         <sequence minOccurs="1" maxOccurs="unbounded">
22
            <element ref="tab"/>
23
         </sequence>
24
         <attribute name="point" type="string" use="required">
25
            <annotation>
26
               <documentation>
27
                  
28
               </documentation>
29
            </annotation>
30
         </attribute>
31
      </complexType>
32
   </element>
33
34
   <element name="tab">
35
      <annotation>
36
         <documentation>
37
            describes an individual launch configuration tab contribution
38
         </documentation>
39
      </annotation>
40
      <complexType>
41
         <attribute name="id" type="string" use="required">
42
            <annotation>
43
               <documentation>
44
                  the unique id of this contributed tab
45
               </documentation>
46
            </annotation>
47
         </attribute>
48
         <attribute name="group" type="string" use="required">
49
            <annotation>
50
               <documentation>
51
                  the string id of the &lt;code&gt;ILaunchConfigurationTabGroup&lt;/code&gt; that this tab should be contributed to
52
               </documentation>
53
            </annotation>
54
         </attribute>
55
         <attribute name="name" type="string" use="required">
56
            <annotation>
57
               <documentation>
58
                  a human readable name for this tab. the prvided name does not have to be the name that you wish to appear on the tab itself. But it should sufficiently describe your tab.
59
               </documentation>
60
            </annotation>
61
         </attribute>
62
         <attribute name="class" type="string" use="required">
63
            <annotation>
64
               <documentation>
65
                  the implementation of your tab
66
               </documentation>
67
               <appInfo>
68
                  <meta.attribute kind="java" basedOn="org.eclipse.debug.ui.ILaunchConfigurationTab"/>
69
               </appInfo>
70
            </annotation>
71
         </attribute>
72
      </complexType>
73
   </element>
74
75
   <annotation>
76
      <appInfo>
77
         <meta.section type="since"/>
78
      </appInfo>
79
      <documentation>
80
         Eclipse 3.3 M3
81
      </documentation>
82
   </annotation>
83
84
   <annotation>
85
      <appInfo>
86
         <meta.section type="examples"/>
87
      </appInfo>
88
      <documentation>
89
         The following example adds the tab &quot;FooTab&quot; to the local java application launch tab group.
90
91
&lt;p&gt;
92
&lt;pre&gt;
93
&lt;extension point=&quot;org.eclipse.debug.ui.launchConfigurationTabs&quot;&gt;
94
    &lt;tab
95
      	class=&quot;org.eclipse.jdt.debug.ui.launchConfigurations.FooTab&quot;
96
        group=&quot;org.eclipse.jdt.debug.ui.launchConfigurationTabGroup.localJavaApplication&quot;
97
        id=&quot;org.eclipse.jdt.debug.ui.fooTab&quot;
98
        name=&quot;Foo Tab&quot;&gt;
99
    &lt;/tab&gt;
100
 &lt;/extension&gt;	
101
&lt;/pre&gt;
102
&lt;/p&gt;
103
      </documentation>
104
   </annotation>
105
106
   <annotation>
107
      <appInfo>
108
         <meta.section type="apiInfo"/>
109
      </appInfo>
110
      <documentation>
111
         [Enter API information here.]
112
      </documentation>
113
   </annotation>
114
115
   <annotation>
116
      <appInfo>
117
         <meta.section type="implementation"/>
118
      </appInfo>
119
      <documentation>
120
         [Enter information about supplied implementation of this extension point.]
121
      </documentation>
122
   </annotation>
123
124
   <annotation>
125
      <appInfo>
126
         <meta.section type="copyright"/>
127
      </appInfo>
128
      <documentation>
129
         Copyright (c) 2006 IBM Corporation and others.&lt;br&gt;
130
All rights reserved. This program and the accompanying materials are made 
131
available under the terms of the Eclipse Public License v1.0 which 
132
accompanies this distribution, and is available at 
133
&lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
134
      </documentation>
135
   </annotation>
136
137
</schema>
(-)ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java (+128 lines)
Added Link Here
1
package org.eclipse.debug.internal.ui.launchConfigurations;
2
3
import org.eclipse.debug.core.ILaunch;
4
import org.eclipse.debug.core.ILaunchConfiguration;
5
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
6
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
7
import org.eclipse.debug.ui.ILaunchConfigurationTab;
8
import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
9
10
/**
11
 * This class is used to wrap a contributed <code>ILaunchConfigurationTabGroup</code> with any contributed tabs
12
 * for that group (from a <code>launchConfigurationTabs</code> extension point).
13
 * 
14
 * <p>
15
 * <strong>EXPERIMENTAL</strong>. This class has been added as
16
 * part of a work in progress. There is no guarantee that this API will
17
 * remain unchanged during the 3.3 release cycle. Please do not use this API
18
 * without consulting with the Platform/Debug team.
19
 * </p>
20
 * @since 3.3
21
 */
22
public class LaunchConfigurationTabGroupWrapper implements ILaunchConfigurationTabGroup {
23
	
24
	private ILaunchConfigurationTabGroup fGroup = null;
25
	private String fGroupId = null;
26
	private ILaunchConfigurationTab[] fContributedTabs = null;
27
	
28
	/**
29
	 * Constructor
30
	 * @param group the existing group to wrapper
31
	 */
32
	public LaunchConfigurationTabGroupWrapper(ILaunchConfigurationTabGroup group, String groupId) {
33
		fGroup = group;
34
		fGroupId = groupId;
35
	}
36
	
37
	/**
38
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String)
39
	 */
40
	public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
41
		if(fGroup != null) {
42
			fGroup.createTabs(dialog, mode);
43
		}
44
	}
45
46
	/**
47
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#dispose()
48
	 */
49
	public void dispose() {
50
		if(fGroup != null) {
51
			fGroup.dispose();
52
		}
53
		if(fContributedTabs != null) {
54
			for(int i = 0; i < fContributedTabs.length; i++) {
55
				fContributedTabs[i].dispose();
56
			}
57
		}
58
	}
59
60
	/**
61
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#getTabs()
62
	 */
63
	public ILaunchConfigurationTab[] getTabs() {
64
		if(fContributedTabs == null) {
65
			fContributedTabs = LaunchConfigurationPresentationManager.getDefault().createContributedTabs(fGroupId);
66
		}
67
		ILaunchConfigurationTab[] grouptabs = fGroup.getTabs();
68
		ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[grouptabs.length + fContributedTabs.length];
69
		System.arraycopy(grouptabs, 0, tabs, 0, grouptabs.length);
70
		System.arraycopy(fContributedTabs, 0, tabs, grouptabs.length, fContributedTabs.length);
71
		return tabs;
72
	}
73
74
	/**
75
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
76
	 */
77
	public void initializeFrom(ILaunchConfiguration configuration) {
78
		if(fGroup != null) {
79
			fGroup.initializeFrom(configuration);
80
		}
81
		if(fContributedTabs == null) {
82
			getTabs();
83
		}
84
		for(int i = 0; i < fContributedTabs.length; i++) {
85
			fContributedTabs[i].initializeFrom(configuration);
86
		}
87
	}
88
89
	/**
90
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#launched(org.eclipse.debug.core.ILaunch)
91
	 */
92
	public void launched(ILaunch launch) {
93
		if(fGroup != null) {
94
			fGroup.launched(launch);
95
		}
96
	}
97
98
	/**
99
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
100
	 */
101
	public void performApply(ILaunchConfigurationWorkingCopy configuration) {
102
		if(fGroup != null) {
103
			fGroup.performApply(configuration);
104
			if(fContributedTabs == null) {
105
				getTabs();
106
			}
107
			for(int i = 0; i < fContributedTabs.length; i++) {
108
				fContributedTabs[i].performApply(configuration);
109
			}
110
		}
111
	}
112
113
	/**
114
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
115
	 */
116
	public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
117
		if(fGroup != null) {
118
			fGroup.setDefaults(configuration);
119
			if(fContributedTabs == null) { 
120
				getTabs();
121
			}
122
			for(int i = 0; i < fContributedTabs.length; i++) {
123
				fContributedTabs[i].setDefaults(configuration);
124
			}
125
		}
126
	}
127
128
}
(-)ui/org/eclipse/debug/ui/ILaunchConfigurationTabExtension.java (+50 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2006 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.debug.ui;
12
13
/**
14
 * Describes a contributed launch configuration tab 
15
 * 
16
 * <p>
17
 * <strong>EXPERIMENTAL</strong>. This method has been added as
18
 * part of a work in progress. There is no guarantee that this API will
19
 * remain unchanged during the 3.3 release cycle. Please do not use this API
20
 * without consulting with the Platform/Debug team.
21
 * </p>
22
 * @since 3.3
23
 */
24
public interface ILaunchConfigurationTabExtension {
25
	
26
	/**
27
	 * Returns the human readable name for the tab, not to be confused with the name that appears on the tab itself
28
	 * @return the name of the tab
29
	 */
30
	public String getName();
31
	
32
	/**
33
	 * Returns the unique id ofthe tab
34
	 * @return the unique id of the tab
35
	 */
36
	public String getIdentifier();
37
	
38
	/**
39
	 * Returns the unique id of the <code>ILaunchConfigurationTabGroup</code> that this tab contributes to
40
	 * @return the id of the <code>ILaunchConfigurationTabGroup</code> this tab conributes to
41
	 */
42
	public String getTabGroupId();
43
	
44
	/**
45
	 * Returns the instantiated class of this tab
46
	 * @return the instantiated class of this tab
47
	 */
48
	public ILaunchConfigurationTab getTab();
49
50
}
(-)ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java (+79 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2006 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.debug.internal.ui;
12
13
import org.eclipse.core.runtime.CoreException;
14
import org.eclipse.core.runtime.IConfigurationElement;
15
import org.eclipse.debug.internal.core.ConfigurationElementConstants;
16
import org.eclipse.debug.ui.ILaunchConfigurationTabExtension;
17
import org.eclipse.debug.ui.ILaunchConfigurationTab;
18
19
/**
20
 * Provides a proxy to a launchConfigurationTabs extension point
21
 * 
22
 * <p>
23
 * <strong>EXPERIMENTAL</strong>. This method has been added as
24
 * part of a work in progress. There is no guarantee that this API will
25
 * remain unchanged during the 3.3 release cycle. Please do not use this API
26
 * without consulting with the Platform/Debug team.
27
 * </p>
28
 * @since 3.3
29
 */
30
public class LaunchConfigurationTabExtension implements ILaunchConfigurationTabExtension {
31
32
	/**
33
	 * The configuration element backing this proxy
34
	 */
35
	IConfigurationElement fElement = null;
36
	
37
	/**
38
	 * Constructor
39
	 * @param element the <code>IConfigurationElement</code> for this proxy
40
	 */
41
	public LaunchConfigurationTabExtension(IConfigurationElement element) {
42
		fElement = element;
43
	}
44
	
45
	/* (non-Javadoc)
46
	 * @see org.eclipse.debug.ui.IContributedLaunchConfigurationTab#getIdentifier()
47
	 */
48
	public String getIdentifier() {
49
		return fElement.getAttribute(ConfigurationElementConstants.ID);
50
	}
51
52
	/* (non-Javadoc)
53
	 * @see org.eclipse.debug.ui.IContributedLaunchConfigurationTab#getName()
54
	 */
55
	public String getName() {
56
		return fElement.getAttribute(ConfigurationElementConstants.NAME);
57
	}
58
59
	/* (non-Javadoc)
60
	 * @see org.eclipse.debug.ui.IContributedLaunchConfigurationTab#getTab()
61
	 */
62
	public ILaunchConfigurationTab getTab() {
63
		try {
64
			Object object = fElement.createExecutableExtension(ConfigurationElementConstants.CLASS);
65
			if(object instanceof ILaunchConfigurationTab) {
66
				return (ILaunchConfigurationTab) object;
67
			}
68
		} catch (CoreException e) {DebugUIPlugin.log(e);}
69
		return null;
70
	}
71
72
	/* (non-Javadoc)
73
	 * @see org.eclipse.debug.ui.IContributedLaunchConfigurationTab#getTabGroupId()
74
	 */
75
	public String getTabGroupId() {
76
		return fElement.getAttribute(ConfigurationElementConstants.GROUP);
77
	}
78
79
}

Return to bug 157059