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

(-)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.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
(-)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
(-)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/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/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/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/actions/breakpoints/ToggleBreakpointObjectActionDelegate.java (-6 / +3 lines)
Lines 27-38 Link Here
27
/**
27
/**
28
 * A toggle breakpoint action that can be contributed to an object. The action
28
 * A toggle breakpoint action that can be contributed to an object. The action
29
 * will perform a toggle breakpoint operation for a selected object.
29
 * will perform a toggle breakpoint operation for a selected object.
30
 * <p>
30
 * 
31
 * EXPERIMENTAL
31
 * <p>Clients may subclass this class.</p>
32
 * </p>
32
 * 
33
 * <p>
34
 * Clients may subclass this class.
35
 * </p>
36
 * @since 3.0
33
 * @since 3.0
37
 */
34
 */
38
public abstract class ToggleBreakpointObjectActionDelegate implements IObjectActionDelegate, IActionDelegate2 {
35
public abstract class ToggleBreakpointObjectActionDelegate implements IObjectActionDelegate, IActionDelegate2 {
(-)ui/org/eclipse/debug/ui/IDebugUIConstants.java (+14 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
	 * Contributed Launch Configuration Tab extension point indentifier
931
	 * 
932
	 * <p>
933
	 * <strong>EXPERIMENTAL</strong>. This constant has been added as
934
	 * part of a work in progress. There is no guarantee that this API will
935
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
936
	 * without consulting with the Platform/Debug team.
937
	 * </p>
938
	 * 
939
	 * @since 3.3
940
	 */
941
	public static final String EXTENSION_POINT_CONTRIBUTED_LAUNCH_TABS = "launchConfigurationTabs"; //$NON-NLS-1$
942
	
943
	/**
930
	 * Launch shortcuts extension point identifier
944
	 * Launch shortcuts extension point identifier
931
	 * (value <code>"launchShortcuts"</code>).
945
	 * (value <code>"launchShortcuts"</code>).
932
	 * 
946
	 * 
(-)schema/launchConfigurationTypeImages.exsd (-31 / +39 lines)
Lines 2-16 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.
10
   </documentation>
10
11
</annotation>
11
&lt;p&gt;
12
&lt;strong&gt;EXPERIMENTAL&lt;/strong&gt;. This extension point has been deprecated 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.
16
&lt;/p&gt;
17
      </documentation>
18
   </annotation>
12
19
13
   <element name="extension">
20
   <element name="extension">
21
      <annotation>
22
         <appInfo>
23
            <meta.element deprecated="true"/>
24
         </appInfo>
25
         <documentation>
26
            &lt;p&gt;In 3.3, the image for a launch configuration type should be provided via the icon attribute in the &lt;code&gt;launchConfigurationTypes&lt;/code&gt; extension point.&lt;/p&gt;
27
         </documentation>
28
      </annotation>
14
      <complexType>
29
      <complexType>
15
         <sequence>
30
         <sequence>
16
            <element ref="launchConfigurationTypeImage" minOccurs="0" maxOccurs="unbounded"/>
31
            <element ref="launchConfigurationTypeImage" minOccurs="0" maxOccurs="unbounded"/>
Lines 22-45 Link Here
22
               </documentation>
37
               </documentation>
23
            </annotation>
38
            </annotation>
24
         </attribute>
39
         </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>
40
      </complexType>
40
   </element>
41
   </element>
41
42
42
   <element name="launchConfigurationTypeImage">
43
   <element name="launchConfigurationTypeImage">
44
      <annotation>
45
         <documentation>
46
            &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;
47
         </documentation>
48
      </annotation>
43
      <complexType>
49
      <complexType>
44
         <attribute name="id" type="string" use="required">
50
         <attribute name="id" type="string" use="required">
45
            <annotation>
51
            <annotation>
Lines 51-57 Link Here
51
         <attribute name="configTypeID" type="string" use="required">
57
         <attribute name="configTypeID" type="string" use="required">
52
            <annotation>
58
            <annotation>
53
               <documentation>
59
               <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).
60
                  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>
61
               </documentation>
56
            </annotation>
62
            </annotation>
57
         </attribute>
63
         </attribute>
Lines 59-64 Link Here
59
            <annotation>
65
            <annotation>
60
               <documentation>
66
               <documentation>
61
                  specifies the plugin-relative path of an image file.
67
                  specifies the plugin-relative path of an image file.
68
69
&lt;br&gt;&lt;b&gt;To supply an image to the specified launch configuration type, it should be done in the launch configuration type definition.&lt;/b&gt;
62
               </documentation>
70
               </documentation>
63
               <appInfo>
71
               <appInfo>
64
                  <meta.attribute kind="resource"/>
72
                  <meta.attribute kind="resource"/>
Lines 77-100 Link Here
77
85
78
&lt;p&gt;
86
&lt;p&gt;
79
&lt;pre&gt;
87
&lt;pre&gt;
80
	&lt;extension point="org.eclipse.debug.ui.launchConfigurationTypeImages"&gt;
88
 &lt;extension point=&quot;org.eclipse.debug.ui.launchConfigurationTypeImages&quot;&gt;
81
		&lt;launchConfigurationTypeImage
89
  &lt;launchConfigurationTypeImage
82
			  id="com.example.FirstLaunchConfigurationTypeImage"
90
     id=&quot;com.example.FirstLaunchConfigurationTypeImage&quot;
83
			  configTypeID="com.example.FirstLaunchConfigurationType"
91
     configTypeID=&quot;com.example.FirstLaunchConfigurationType&quot;
84
			  icon="icons/FirstLaunchConfigurationType.gif"&gt;
92
     icon=&quot;icons/FirstLaunchConfigurationType.gif&quot;&gt;
85
		&lt;/launchConfigurationTypeImage&gt;
93
  &lt;/launchConfigurationTypeImage&gt;
86
	&lt;/extension&gt;
94
 &lt;/extension&gt;
87
&lt;/pre&gt;
95
&lt;/pre&gt;
88
&lt;/p&gt;
96
&lt;/p&gt;
89
      </documentation>
97
      </documentation>
90
   </annotation>
98
   </annotation>
91
   
99
92
   <annotation>
100
   <annotation>
93
      <appInfo>
101
      <appInfo>
94
         <meta.section type="copyright"/>
102
         <meta.section type="copyright"/>
95
      </appInfo>
103
      </appInfo>
96
      <documentation>
104
      <documentation>
97
Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
105
         Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
98
All rights reserved. This program and the accompanying materials are made 
106
All rights reserved. This program and the accompanying materials are made 
99
available under the terms of the Eclipse Public License v1.0 which 
107
available under the terms of the Eclipse Public License v1.0 which 
100
accompanies this distribution, and is available at 
108
accompanies this distribution, and is available at 
(-)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
}
(-)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
}
(-)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>
(-)core/org/eclipse/debug/core/ILaunchManager.java (-2 / +34 lines)
Lines 16-21 Link Here
16
import org.eclipse.core.resources.IFile;
16
import org.eclipse.core.resources.IFile;
17
import org.eclipse.core.runtime.CoreException;
17
import org.eclipse.core.runtime.CoreException;
18
import org.eclipse.debug.core.model.IDebugTarget;
18
import org.eclipse.debug.core.model.IDebugTarget;
19
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
19
import org.eclipse.debug.core.model.IPersistableSourceLocator;
20
import org.eclipse.debug.core.model.IPersistableSourceLocator;
20
import org.eclipse.debug.core.model.IProcess;
21
import org.eclipse.debug.core.model.IProcess;
21
import org.eclipse.debug.core.sourcelookup.ISourceContainerType;
22
import org.eclipse.debug.core.sourcelookup.ISourceContainerType;
Lines 229-235 Link Here
229
	 * @param optionId the unique id of the launch option
230
	 * @param optionId the unique id of the launch option
230
	 * @return the lauch option associated with ther specified id or <code>null</code> if not found
231
	 * @return the lauch option associated with ther specified id or <code>null</code> if not found
231
	 * <p>
232
	 * <p>
232
	 * <strong>EXPERIMENTAL</strong>. This ,method has been added as
233
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
233
	 * part of a work in progress. There is no guarantee that this API will
234
	 * part of a work in progress. There is no guarantee that this API will
234
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
235
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
235
	 * without consulting with the Platform/Debug team.
236
	 * without consulting with the Platform/Debug team.
Lines 242-248 Link Here
242
	 * Returns all registered launch options
243
	 * Returns all registered launch options
243
	 * @return all registered launch options
244
	 * @return all registered launch options
244
	 * <p>
245
	 * <p>
245
	 * <strong>EXPERIMENTAL</strong>. This ,method has been added as
246
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
246
	 * part of a work in progress. There is no guarantee that this API will
247
	 * part of a work in progress. There is no guarantee that this API will
247
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
248
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
248
	 * without consulting with the Platform/Debug team.
249
	 * without consulting with the Platform/Debug team.
Lines 252-257 Link Here
252
	public ILaunchOption[] getLaunchOptions();
253
	public ILaunchOption[] getLaunchOptions();
253
	
254
	
254
	/**
255
	/**
256
	 * Returns all of the launch delegates. The rturned listing of delegates cannot be directly used to launch,
257
	 * instead the method <code>IlaunchDelegate.getDelegate</code> must be used to acquire an executable form of
258
	 * the delegate, allowing us to maintain lazy loading of the delegates themselves.
259
	 * @return all of the launch delegates
260
	 * @since 3.3
261
	 * <p>
262
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
263
	 * part of a work in progress. There is no guarantee that this API will
264
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
265
	 * without consulting with the Platform/Debug team.
266
	 * </p>
267
	 */
268
	public ILaunchDelegate[] getLaunchDelegates();
269
	
270
	/** Returns the launch delegate that applies to the specified options
271
	 * @param typeid the <code>ILaunchConfigurationType</code> id
272
	 * @param the mode id
273
	 * @param options the array of options to find the delegate for
274
	 * @return the delegates that applie to the specified launch options for the specified mode and type id
275
	 * 
276
	 * <p>
277
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
278
	 * part of a work in progress. There is no guarantee that this API will
279
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
280
	 * without consulting with the Platform/Debug team.
281
	 * </p>
282
	 * @since 3.3
283
	 */
284
	public ILaunchConfigurationDelegate[] getLaunchDelegates(String typeid, String mode, String[] options);
285
	
286
	/**
255
	 * Returns a collection of launch configurations that required migration to be
287
	 * Returns a collection of launch configurations that required migration to be
256
	 * compatible with current tooling.
288
	 * compatible with current tooling.
257
	 * 
289
	 * 
(-)core/org/eclipse/debug/core/ILaunchConfiguration.java (+14 lines)
Lines 304-309 Link Here
304
	public String getName();		
304
	public String getName();		
305
	
305
	
306
	/**
306
	/**
307
	 * 
308
	 * @return returns the options that this configuration supports
309
	 * 
310
	 * <p>
311
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
312
	 * part of a work in progress. There is no guarantee that this API will
313
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
314
	 * without consulting with the Platform/Debug team.
315
	 * </p>
316
	 * @since 3.3
317
	 */
318
	public String[] getOptions() throws CoreException;
319
	
320
	/**
307
	 * Returns the type of this launch configuration. This is a
321
	 * Returns the type of this launch configuration. This is a
308
	 * handle-only method.
322
	 * handle-only method.
309
	 * 
323
	 * 
(-)core/org/eclipse/debug/core/ILaunchConfigurationType.java (+58 lines)
Lines 126-135 Link Here
126
	 * @exception CoreException if unable to instantiate the
126
	 * @exception CoreException if unable to instantiate the
127
	 *  delegate
127
	 *  delegate
128
	 * @since 3.0
128
	 * @since 3.0
129
	 * @deprecated we have introduced launch options in 3.3M3 and delegates can be acquired using the new 
130
	 * <code>getDelegate(String mode, String[] options)</code> version. If no options are desired or cared about passing <code>null</code>
131
	 * works as though options are not considered at all. 
132
	 * 
133
	 * <p>
134
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
135
	 * part of a work in progress. There is no guarantee that this API will
136
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
137
	 * without consulting with the Platform/Debug team.
138
	 * </p>
129
	 */	
139
	 */	
130
	public ILaunchConfigurationDelegate getDelegate(String mode) throws CoreException;
140
	public ILaunchConfigurationDelegate getDelegate(String mode) throws CoreException;
131
	
141
	
132
	/**
142
	/**
143
	 * Returns the launch delegate for the specifed mode with the given options
144
	 * @param mode the mode to get the delegate for
145
	 * @param options the options that the delegate must support
146
	 * @return the <code>ILaunchConfigurationDelegate</code> for the given mode and options, or <code>null</code> if the is not one
147
	 * @throws CoreException
148
	 * @since 3.3
149
	 * 
150
	 * <p>
151
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
152
	 * part of a work in progress. There is no guarantee that this API will
153
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
154
	 * without consulting with the Platform/Debug team.
155
	 * </p>
156
	 */
157
	public ILaunchConfigurationDelegate getDelegate(String mode, String[] options) throws CoreException;
158
	
159
	/**
133
	 * Returns the unique identifier for this type of launch configuration
160
	 * Returns the unique identifier for this type of launch configuration
134
	 * 
161
	 * 
135
	 * @return the unique identifier for this type of launch configuration
162
	 * @return the unique identifier for this type of launch configuration
Lines 222-227 Link Here
222
	 *  <code>DEBUG_MODE</code>.
249
	 *  <code>DEBUG_MODE</code>.
223
	 * @return whether this kind of launch configuration supports the
250
	 * @return whether this kind of launch configuration supports the
224
	 *  specified mode
251
	 *  specified mode
252
	 *  
225
	 */
253
	 */
226
	public boolean supportsMode(String mode);
254
	public boolean supportsMode(String mode);
255
	
256
	/**
257
	 * Returns the simple name of the plugin that contributed this launch configuration type
258
	 * @return the name of the contributor
259
	 * @since 3.3
260
	 * 
261
	 * <p>
262
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
263
	 * part of a work in progress. There is no guarantee that this API will
264
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
265
	 * without consulting with the Platform/Debug team.
266
	 * </p>
267
	 */
268
	public String getContributorName();
269
	
270
	/**
271
	 * Returns the path of the image descriptor for this launch configuration type, which in turn 
272
	 * is used in <code>DebugPluginImages</code> to load the image registry with config images.
273
	 * NOTE: the path could be only a fragment, and might require qualification via the bundle of the contributor.
274
	 * @return the id of the image for this config type
275
	 * @since 3.3
276
	 * 
277
	 * <p>
278
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
279
	 * part of a work in progress. There is no guarantee that this API will
280
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
281
	 * without consulting with the Platform/Debug team.
282
	 * </p>
283
	 */
284
	public String getImageDescriptorPath();
227
}
285
}
(-)core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java (+14 lines)
Lines 172-175 Link Here
172
	 * @since 3.2
172
	 * @since 3.2
173
	 */
173
	 */
174
	public void setMappedResources(IResource[] resources);
174
	public void setMappedResources(IResource[] resources);
175
	
176
	/**
177
	 * This method is used to set the options for the associated <code>ILaunchConfiguraiton</code>.
178
	 * @param options the array of options to set
179
	 * 
180
	 * <p>
181
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
182
	 * part of a work in progress. There is no guarantee that this API will
183
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
184
	 * without consulting with the Platform/Debug team.
185
	 * </p>
186
	 * @since 3.3
187
	 */
188
	public void setOptions(String[] options);
175
}
189
}
(-)core/org/eclipse/debug/internal/core/LaunchConfigurationType.java (-151 / +118 lines)
Lines 11-24 Link Here
11
package org.eclipse.debug.internal.core;
11
package org.eclipse.debug.internal.core;
12
12
13
 
13
 
14
import com.ibm.icu.text.MessageFormat;
15
import java.util.HashSet;
14
import java.util.HashSet;
16
import java.util.Hashtable;
15
import java.util.Hashtable;
17
import java.util.Iterator;
18
import java.util.List;
19
import java.util.Map;
16
import java.util.Map;
20
import java.util.Set;
17
import java.util.Set;
21
import java.util.StringTokenizer;
18
22
import org.eclipse.core.resources.IContainer;
19
import org.eclipse.core.resources.IContainer;
23
import org.eclipse.core.runtime.CoreException;
20
import org.eclipse.core.runtime.CoreException;
24
import org.eclipse.core.runtime.IConfigurationElement;
21
import org.eclipse.core.runtime.IConfigurationElement;
Lines 30-39 Link Here
30
import org.eclipse.debug.core.ILaunchConfigurationMigrationDelegate;
27
import org.eclipse.debug.core.ILaunchConfigurationMigrationDelegate;
31
import org.eclipse.debug.core.ILaunchConfigurationType;
28
import org.eclipse.debug.core.ILaunchConfigurationType;
32
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
29
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
30
import org.eclipse.debug.core.ILaunchDelegate;
33
import org.eclipse.debug.core.ILaunchManager;
31
import org.eclipse.debug.core.ILaunchManager;
34
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
32
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
35
import org.eclipse.debug.core.sourcelookup.ISourcePathComputer;
33
import org.eclipse.debug.core.sourcelookup.ISourcePathComputer;
36
34
35
import com.ibm.icu.text.MessageFormat;
36
37
/**
37
/**
38
 * A launch configuration type wrappers a configuration
38
 * A launch configuration type wrappers a configuration
39
 * element for a <code>launchConfigurationType</code>
39
 * element for a <code>launchConfigurationType</code>
Lines 41-68 Link Here
41
 */
41
 */
42
public class LaunchConfigurationType extends PlatformObject implements ILaunchConfigurationType {
42
public class LaunchConfigurationType extends PlatformObject implements ILaunchConfigurationType {
43
	
43
	
44
	private static String MIGRATION_DELEGATE = "migrationDelegate";  //$NON-NLS-1$
45
	
46
	/**
44
	/**
47
	 * The configuration element of the extension.
45
	 * The configuration element of the extension.
48
	 */
46
	 */
49
	private IConfigurationElement fElement;
47
	private IConfigurationElement fElement;
50
	
48
	
51
	/**
49
	/**
52
	 * Base modes this type supports.
50
	 *  a listing of modes contributed to this launch configuration type
51
	 *  @since 3.3
52
	 *  
53
	 *  <p>
54
	 * <strong>EXPERIMENTAL</strong>. This field has been added as
55
	 * part of a work in progress. There is no guarantee that this API will
56
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
57
	 * without consulting with the Platform/Debug team.
58
	 * </p>
59
	 */
60
	private Set fModes = null;
61
	
62
	/**
63
	 * the default source path computer for this config type
64
	 * @since 3.3
65
	 * 
66
	 * <p>
67
	 * <strong>EXPERIMENTAL</strong>. This field has been added as
68
	 * part of a work in progress. There is no guarantee that this API will
69
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
70
	 * without consulting with the Platform/Debug team.
71
	 * </p>
53
	 */
72
	 */
54
	private Set fBaseModes;
73
	private ISourcePathComputer fSourcePathComputer = null;
55
	
74
	
56
	/**
75
	/**
57
	 * Modes that delegates have been contributed for
76
	 * The source locator id for this config type
58
	 */
77
	 */
59
	private Set fContributedModes;
78
	private String fSourceLocator = null;
60
	
79
	
61
	/**
80
	/**
62
	 * The delegates for launch configurations of this type.
81
	 * The delegates for launch configurations of this type.
63
	 * Delegates are instantiated lazily as required. There may
82
	 * Delegates are instantiated lazily as required. There may
64
	 * be different delegates for different modes (since 3.0).
83
	 * be different delegates for different modes (since 3.0).
65
	 * Map of mode -> delegate
84
	 * Map of mode to delegate
66
	 */
85
	 */
67
	private Map fDelegates;
86
	private Map fDelegates;
68
	
87
	
Lines 73-155 Link Here
73
	 * @param element configuration element
92
	 * @param element configuration element
74
	 */
93
	 */
75
	protected LaunchConfigurationType(IConfigurationElement element) {
94
	protected LaunchConfigurationType(IConfigurationElement element) {
76
		setConfigurationElement(element);
95
		fElement = element;
77
	}
96
	}
78
	
97
	
79
	/* (non-Javadoc)
98
	/* (non-Javadoc)
80
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#getAttribute(java.lang.String)
99
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#getAttribute(java.lang.String)
81
	 */
100
	 */
82
	public String getAttribute(String attributeName) {
101
	public String getAttribute(String attributeName) {
83
		return getConfigurationElement().getAttribute(attributeName);
102
		return fElement.getAttribute(attributeName);
84
	}
103
	}
85
	
86
	/**
87
	 * Returns the set of modes specified in the configuration data.
88
	 * 
89
	 * @return the set of modes specified in the configuration data
90
	 */
91
	protected Set getBaseModes() {
92
		if (fBaseModes == null) {
93
			String modes= getConfigurationElement().getAttribute("modes"); //$NON-NLS-1$
94
			if (modes == null) {
95
				return new HashSet(0);
96
			}
97
			StringTokenizer tokenizer= new StringTokenizer(modes, ","); //$NON-NLS-1$
98
			fBaseModes = new HashSet(tokenizer.countTokens());
99
			while (tokenizer.hasMoreTokens()) {
100
				fBaseModes.add(tokenizer.nextToken().trim());
101
			}
102
		}
103
		return fBaseModes;
104
	}	
105
104
106
	/* (non-Javadoc)
105
	/* (non-Javadoc)
107
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#getCategory()
106
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#getCategory()
108
	 */
107
	 */
109
	public String getCategory() {
108
	public String getCategory() {
110
		return getConfigurationElement().getAttribute("category"); //$NON-NLS-1$
109
		return fElement.getAttribute(ConfigurationElementConstants.CATEGORY);
111
	}
112
113
	/**
114
	 * Returns this type's configuration element.
115
	 * 
116
	 * @return this type's configuration element
117
	 */
118
	protected IConfigurationElement getConfigurationElement() {
119
		return fElement;
120
	}
121
	
122
	/**
123
	 * Returns the set of modes delegates have been contributed for
124
	 * 
125
	 * @return the set of modes delegates have been contributed for
126
	 */
127
	protected Set getContributedModes() {
128
		if (fContributedModes == null) {
129
			fContributedModes = new HashSet(0);
130
			// add modes for contributed delegates
131
			List delegates = ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getContributedDelegates();
132
			Iterator iterator = delegates.iterator();
133
			while (iterator.hasNext()) {
134
				ContributedDelegate delegate = (ContributedDelegate)iterator.next();
135
				if (delegate.getLaunchConfigurationType().equals(getIdentifier())) {
136
					fContributedModes.addAll(delegate.getModes());
137
				}
138
			}
139
		}
140
		return fContributedModes;
141
	}
110
	}
142
	
111
	
143
	/**
112
	/**
144
	 * Returns the launch configuration delegate for launch
145
	 * configurations of this type. The first time this method
146
	 * is called, the delegate is instantiated.
147
	 * 
148
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#getDelegate()
113
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#getDelegate()
149
	 * @return launch configuration delegate
150
	 * @exception CoreException if unable to instantiate the
151
	 *  delegate
152
	 * @deprecated use <code>getDelegate(String)</code> to specify mode
153
	 */
114
	 */
154
	public ILaunchConfigurationDelegate getDelegate() throws CoreException {
115
	public ILaunchConfigurationDelegate getDelegate() throws CoreException {
155
		return getDelegate(ILaunchManager.RUN_MODE);
116
		return getDelegate(ILaunchManager.RUN_MODE);
Lines 159-220 Link Here
159
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#getDelegate(java.lang.String)
120
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#getDelegate(java.lang.String)
160
	 */
121
	 */
161
	public ILaunchConfigurationDelegate getDelegate(String mode) throws CoreException {
122
	public ILaunchConfigurationDelegate getDelegate(String mode) throws CoreException {
123
		return getDelegate(mode, null); 
124
	}
125
	
126
	/**
127
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#getDelegate(java.lang.String, java.lang.String[])
128
	 */
129
	public ILaunchConfigurationDelegate getDelegate(String mode, String[] options) throws CoreException {
162
		if (!supportsMode(mode)) {
130
		if (!supportsMode(mode)) {
163
			throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_9, new String[] {mode, getIdentifier()}), null));  
131
			throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_9, new String[] {mode, getIdentifier()}), null));  
164
		}
132
		}
165
		if (fDelegates == null) {
133
		if (fDelegates == null) {
166
			// initialize delegate table with base modes
134
			// initialize delegate table with base modes
167
			fDelegates = new Hashtable(3);
135
			fDelegates = new Hashtable();
168
		}
136
		}
169
		ILaunchConfigurationDelegate delegate = (ILaunchConfigurationDelegate)fDelegates.get(mode);
137
		ILaunchConfigurationDelegate delegate = (ILaunchConfigurationDelegate)fDelegates.get(mode);
170
		if (delegate == null) {
138
		if (delegate == null) {
171
			Set modes = getBaseModes();
139
			if(fModes.contains(mode)) {
172
			if (modes.contains(mode)) {
140
				ILaunchConfigurationDelegate[] delegates = DebugPlugin.getDefault().getLaunchManager().getLaunchDelegates(getIdentifier(), mode, options);
173
				Object object = getConfigurationElement().createExecutableExtension("delegate"); //$NON-NLS-1$
141
				if(delegates.length > 0) {
174
				if (object instanceof ILaunchConfigurationDelegate) {
142
					return delegates[0];
175
					Iterator iter = modes.iterator();
176
					while (iter.hasNext()) {
177
						fDelegates.put(iter.next(), object);
178
					}
179
					return (ILaunchConfigurationDelegate)object;
180
				} 
181
				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[]{getName()}), null)); 
182
			} 
183
			// contributed modes
184
			List contributed = ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getContributedDelegates();
185
			Iterator iterator = contributed.iterator();
186
			while (iterator.hasNext()) {
187
				ContributedDelegate contributedDelegate = (ContributedDelegate)iterator.next();
188
				if (getIdentifier().equals(contributedDelegate.getLaunchConfigurationType())) {
189
					modes = contributedDelegate.getModes();
190
					if (modes.contains(mode)) {
191
						delegate = contributedDelegate.getDelegate();
192
						Iterator modesIterator = modes.iterator();
193
						while (modesIterator.hasNext()) {
194
							fDelegates.put(modesIterator.next(), delegate); 
195
						}
196
						return delegate;
197
					}
198
				}
143
				}
199
			}
144
			}
200
		} else {
145
		} 
146
		else {
201
			return delegate;
147
			return delegate;
202
		}
148
		}
203
		throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_10, new String[] {getIdentifier(), mode}), null)); 
149
		throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_10, new String[] {getIdentifier(), mode}), null));
204
	}
150
	}
205
151
206
	/* (non-Javadoc)
152
	/* (non-Javadoc)
207
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#getIdentifier()
153
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#getIdentifier()
208
	 */
154
	 */
209
	public String getIdentifier() {
155
	public String getIdentifier() {
210
		return getConfigurationElement().getAttribute("id"); //$NON-NLS-1$
156
		return fElement.getAttribute(ConfigurationElementConstants.ID);
211
	}
157
	}
212
158
213
	/* (non-Javadoc)
159
	/* (non-Javadoc)
214
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#getName()
160
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#getName()
215
	 */
161
	 */
216
	public String getName() {
162
	public String getName() {
217
		return getConfigurationElement().getAttribute("name"); //$NON-NLS-1$
163
		return fElement.getAttribute(ConfigurationElementConstants.NAME);
218
	}
164
	}
219
165
220
	/* (non-Javadoc)
166
	/* (non-Javadoc)
Lines 228-277 Link Here
228
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#getSourceLocatorId()
174
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#getSourceLocatorId()
229
	 */
175
	 */
230
	public String getSourceLocatorId() {
176
	public String getSourceLocatorId() {
231
		String id = getAttribute("sourceLocatorId"); //$NON-NLS-1$
177
		if(fSourceLocator == null) {
232
		if (id == null) {
178
			//try the type itself
233
			// check for specification by mode specific delegate
179
			fSourceLocator = getAttribute(ConfigurationElementConstants.SOURCE_LOCATOR);
234
			List delegates = ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getContributedDelegates();
180
			if(fSourceLocator == null) {
235
			Iterator iterator = delegates.iterator();
181
				//try from launch manager
236
			while (iterator.hasNext() && id == null) {
182
				ILaunchDelegate[] delegates = ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getLaunchDelegates();
237
				ContributedDelegate delegate = (ContributedDelegate)iterator.next();
183
				for(int i = 0; i < delegates.length; i++) {
238
				if (delegate.getLaunchConfigurationType().equals(getIdentifier())) {
184
					if(delegates[i].appliesTo(getIdentifier())) {
239
					id = delegate.getSourceLocaterId();
185
						fSourceLocator = delegates[i].getSourceLocatorId();
186
						if(fSourceLocator != null) {
187
							return fSourceLocator;
188
						}
189
					}
240
				}
190
				}
241
			}
191
			}
242
		}
192
		}
243
		return id;
193
		return fSourceLocator;
244
	}	
194
	}	
245
195
246
	/* (non-Javadoc)
196
	/* (non-Javadoc)
247
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#getSourcePathComputer()
197
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#getSourcePathComputer()
248
	 */
198
	 */
249
	public ISourcePathComputer getSourcePathComputer() {
199
	public ISourcePathComputer getSourcePathComputer() {
250
		String id = getConfigurationElement().getAttribute("sourcePathComputerId"); //$NON-NLS-1$
200
		if(fSourcePathComputer == null) {
251
		if (id == null) {
201
			//get the id
252
			// check for specification by mode specific delegate
202
			String id = fElement.getAttribute(ConfigurationElementConstants.SOURCE_PATH_COMPUTER);
253
			List delegates = ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getContributedDelegates();
203
			LaunchManager lmgr = (LaunchManager)DebugPlugin.getDefault().getLaunchManager();
254
			Iterator iterator = delegates.iterator();
204
			if(id == null) {
255
			while (iterator.hasNext() && id == null) {
205
				//try from the launch manager
256
				ContributedDelegate delegate = (ContributedDelegate)iterator.next();
206
				ILaunchDelegate[] delegates = lmgr.getLaunchDelegates();
257
				if (delegate.getLaunchConfigurationType().equals(getIdentifier())) {
207
				for(int i = 0; i < delegates.length; i++) {
258
					id = delegate.getSourcePathComputerId();
208
					if(delegates[i].appliesTo(getIdentifier())) {
209
						id = delegates[i].getSourcePathComputerId();
210
						if(id != null) {
211
							break;
212
						}
213
					}
259
				}
214
				}
260
			}
215
			}
216
			if(id != null) {
217
				fSourcePathComputer = lmgr.getSourcePathComputer(id);
218
			}
261
		}
219
		}
262
		if (id != null && id.length() > 0) {
220
		return fSourcePathComputer;
263
			return DebugPlugin.getDefault().getLaunchManager().getSourcePathComputer(id);
264
		}
265
		return null;
266
	}
221
	}
267
222
268
	/* (non-Javadoc)
223
	/**
269
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#getSupportedModes()
224
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#getSupportedModes()
270
	 */
225
	 */
271
	public Set getSupportedModes() {
226
	public Set getSupportedModes() {
272
		HashSet modes = new HashSet(getBaseModes());
227
		if(fModes == null) {
273
		modes.addAll(getContributedModes());
228
			fModes = new HashSet();
274
		return modes;
229
			ILaunchDelegate[] delegates = DebugPlugin.getDefault().getLaunchManager().getLaunchDelegates();
230
			for(int i= 0; i < delegates.length; i++) {
231
				if(delegates[i].appliesTo(getIdentifier())) {
232
					fModes.addAll(delegates[i].getModes());
233
				}
234
			}
235
		}
236
		return fModes;
275
	}
237
	}
276
238
277
	/**
239
	/**
Lines 283-296 Link Here
283
	 * @since 3.2
245
	 * @since 3.2
284
	 */
246
	 */
285
	public boolean isMigrationCandidate(ILaunchConfiguration candidate) throws CoreException {
247
	public boolean isMigrationCandidate(ILaunchConfiguration candidate) throws CoreException {
286
		if(getAttribute(MIGRATION_DELEGATE) != null) {
248
		if(getAttribute(ConfigurationElementConstants.MIGRATION_DELEGATE) != null) {
287
			if(fDelegates == null) {
249
			if(fDelegates == null) {
288
				fDelegates = new Hashtable();
250
				fDelegates = new Hashtable();
289
			}
251
			}
290
			Object delegate = fDelegates.get(MIGRATION_DELEGATE);
252
			Object delegate = fDelegates.get(ConfigurationElementConstants.MIGRATION_DELEGATE);
291
			if(delegate == null) {
253
			if(delegate == null) {
292
				delegate = getConfigurationElement().createExecutableExtension(MIGRATION_DELEGATE);
254
				delegate = fElement.createExecutableExtension(ConfigurationElementConstants.MIGRATION_DELEGATE);
293
				fDelegates.put(MIGRATION_DELEGATE, delegate);
255
				fDelegates.put(ConfigurationElementConstants.MIGRATION_DELEGATE, delegate);
294
			}
256
			}
295
			if(delegate instanceof ILaunchConfigurationMigrationDelegate) {
257
			if(delegate instanceof ILaunchConfigurationMigrationDelegate) {
296
				return ((ILaunchConfigurationMigrationDelegate)delegate).isCandidate(candidate);
258
				return ((ILaunchConfigurationMigrationDelegate)delegate).isCandidate(candidate);
Lines 303-309 Link Here
303
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#isPublic()
265
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#isPublic()
304
	 */
266
	 */
305
	public boolean isPublic() {
267
	public boolean isPublic() {
306
		String publicString = getConfigurationElement().getAttribute("public"); //$NON-NLS-1$
268
		String publicString = fElement.getAttribute(ConfigurationElementConstants.PUBLIC);
307
		if (publicString != null) {
269
		if (publicString != null) {
308
			if (publicString.equalsIgnoreCase("false")) { //$NON-NLS-1$
270
			if (publicString.equalsIgnoreCase("false")) { //$NON-NLS-1$
309
				return false;
271
				return false;
Lines 320-333 Link Here
320
	 * @since 3.2
282
	 * @since 3.2
321
	 */
283
	 */
322
	public void migrate(ILaunchConfiguration candidate) throws CoreException {
284
	public void migrate(ILaunchConfiguration candidate) throws CoreException {
323
		if(getAttribute(MIGRATION_DELEGATE) != null) { 
285
		if(getAttribute(ConfigurationElementConstants.MIGRATION_DELEGATE) != null) { 
324
			if(fDelegates == null) {
286
			if(fDelegates == null) {
325
				fDelegates = new Hashtable();
287
				fDelegates = new Hashtable();
326
			}
288
			}
327
			Object delegate = fDelegates.get(MIGRATION_DELEGATE);
289
			Object delegate = fDelegates.get(ConfigurationElementConstants.MIGRATION_DELEGATE);
328
			if(delegate == null) {
290
			if(delegate == null) {
329
				delegate = getConfigurationElement().createExecutableExtension(MIGRATION_DELEGATE);
291
				delegate = fElement.createExecutableExtension(ConfigurationElementConstants.MIGRATION_DELEGATE);
330
				fDelegates.put(MIGRATION_DELEGATE, delegate);
292
				fDelegates.put(ConfigurationElementConstants.MIGRATION_DELEGATE, delegate);
331
			}
293
			}
332
			if(delegate instanceof ILaunchConfigurationMigrationDelegate) {
294
			if(delegate instanceof ILaunchConfigurationMigrationDelegate) {
333
				((ILaunchConfigurationMigrationDelegate)delegate).migrate(candidate);
295
				((ILaunchConfigurationMigrationDelegate)delegate).migrate(candidate);
Lines 339-361 Link Here
339
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#newInstance(org.eclipse.core.resources.IContainer, java.lang.String)
301
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#newInstance(org.eclipse.core.resources.IContainer, java.lang.String)
340
	 */
302
	 */
341
	public ILaunchConfigurationWorkingCopy newInstance(IContainer container, String name) {
303
	public ILaunchConfigurationWorkingCopy newInstance(IContainer container, String name) {
342
			return new LaunchConfigurationWorkingCopy(container, name, this);
304
		return new LaunchConfigurationWorkingCopy(container, name, this);
343
	}
305
	}
344
306
345
	/**
307
	/**
346
	 * Sets this type's configuration element.
308
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#supportsMode(java.lang.String)
347
	 * 
348
	 * @param element this type's configuration element
349
	 */
309
	 */
350
	private void setConfigurationElement(IConfigurationElement element) {
310
	public boolean supportsMode(String mode) {
351
		fElement = element;
311
		return getSupportedModes().contains(mode);
352
	}
312
	}
353
313
	
354
	/**
314
	/* (non-Javadoc)
355
	 * @see ILaunchConfigurationType#supportsMode(String)
315
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#getContributorName()
356
	 */
316
	 */
357
	public boolean supportsMode(String mode) {
317
	public String getContributorName() {
358
		return getBaseModes().contains(mode) || getContributedModes().contains(mode);
318
		return fElement.getContributor().getName();
319
	}
320
	
321
	/* (non-Javadoc)
322
	 * @see org.eclipse.debug.core.ILaunchConfigurationType#getImageDescriptorId()
323
	 */
324
	public String getImageDescriptorPath() {
325
		return fElement.getAttribute(ConfigurationElementConstants.ICON);
359
	}
326
	}
360
}
327
}
361
328
(-)core/org/eclipse/debug/internal/core/LaunchManager.java (-112 / +197 lines)
Lines 76-81 Link Here
76
import org.eclipse.debug.core.ILaunchConfiguration;
76
import org.eclipse.debug.core.ILaunchConfiguration;
77
import org.eclipse.debug.core.ILaunchConfigurationListener;
77
import org.eclipse.debug.core.ILaunchConfigurationListener;
78
import org.eclipse.debug.core.ILaunchConfigurationType;
78
import org.eclipse.debug.core.ILaunchConfigurationType;
79
import org.eclipse.debug.core.ILaunchDelegate;
79
import org.eclipse.debug.core.ILaunchListener;
80
import org.eclipse.debug.core.ILaunchListener;
80
import org.eclipse.debug.core.ILaunchManager;
81
import org.eclipse.debug.core.ILaunchManager;
81
import org.eclipse.debug.core.ILaunchMode;
82
import org.eclipse.debug.core.ILaunchMode;
Lines 85-90 Link Here
85
import org.eclipse.debug.core.IStatusHandler;
86
import org.eclipse.debug.core.IStatusHandler;
86
import org.eclipse.debug.core.model.IDebugTarget;
87
import org.eclipse.debug.core.model.IDebugTarget;
87
import org.eclipse.debug.core.model.IDisconnect;
88
import org.eclipse.debug.core.model.IDisconnect;
89
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
88
import org.eclipse.debug.core.model.IPersistableSourceLocator;
90
import org.eclipse.debug.core.model.IPersistableSourceLocator;
89
import org.eclipse.debug.core.model.IProcess;
91
import org.eclipse.debug.core.model.IProcess;
90
import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector;
92
import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector;
Lines 507-523 Link Here
507
	 * @throws IOException if the encoding attempted to be used is not supported
509
	 * @throws IOException if the encoding attempted to be used is not supported
508
	 */
510
	 */
509
	public static String serializeDocument(Document doc) throws TransformerException, IOException {
511
	public static String serializeDocument(Document doc) throws TransformerException, IOException {
510
		ByteArrayOutputStream s= new ByteArrayOutputStream();
512
		ByteArrayOutputStream s = new ByteArrayOutputStream();
511
		
513
		TransformerFactory factory = TransformerFactory.newInstance();
512
		TransformerFactory factory= TransformerFactory.newInstance();
514
		Transformer transformer = factory.newTransformer();
513
		Transformer transformer= factory.newTransformer();
514
		transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
515
		transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
515
		transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
516
		transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
516
		
517
		DOMSource source = new DOMSource(doc);
517
		DOMSource source= new DOMSource(doc);
518
		StreamResult outputTarget = new StreamResult(s);
518
		StreamResult outputTarget= new StreamResult(s);
519
		transformer.transform(source, outputTarget);
519
		transformer.transform(source, outputTarget);
520
		
521
		return s.toString("UTF8"); //$NON-NLS-1$			
520
		return s.toString("UTF8"); //$NON-NLS-1$			
522
	}
521
	}
523
	
522
	
Lines 564-573 Link Here
564
	private HashMap fLaunchOptions = null;
563
	private HashMap fLaunchOptions = null;
565
	
564
	
566
	/**
565
	/**
567
	 * List of contributed launch delegates (delegates contributed for existing
566
	 * A map of ILaunchDelegate objects stored by id of delegate, or launch config type
568
	 * launch configuration types).
569
	 */
567
	 */
570
	private List fContributedDelegates = null;
568
	private HashMap fLaunchDelegates = null;
571
569
572
	/**
570
	/**
573
	 * Collection of launches
571
	 * Collection of launches
Lines 830-837 Link Here
830
		}
828
		}
831
		Iterator iter = list.iterator();
829
		Iterator iter = list.iterator();
832
		List configs = new ArrayList(list.size());
830
		List configs = new ArrayList(list.size());
831
		IFile file = null;
833
		while (iter.hasNext()) {
832
		while (iter.hasNext()) {
834
			IFile file = (IFile)iter.next();
833
			file = (IFile)iter.next();
835
			configs.add(getLaunchConfiguration(file));
834
			configs.add(getLaunchConfiguration(file));
836
		}
835
		}
837
		return configs;
836
		return configs;
Lines 856-863 Link Here
856
				}
855
				}
857
			};
856
			};
858
			String[] files = directory.list(filter);
857
			String[] files = directory.list(filter);
858
			LaunchConfiguration config = null;
859
			for (int i = 0; i < files.length; i++) {
859
			for (int i = 0; i < files.length; i++) {
860
				LaunchConfiguration config = new LaunchConfiguration(containerPath.append(files[i]));
860
				config = new LaunchConfiguration(containerPath.append(files[i]));
861
				configs.add(config);
861
				configs.add(config);
862
			}
862
			}
863
		}
863
		}
Lines 893-905 Link Here
893
				try {
893
				try {
894
					index = Integer.parseInt(trailer);
894
					index = Integer.parseInt(trailer);
895
					baseName = baseName.substring(0, copyIndex);
895
					baseName = baseName.substring(0, copyIndex);
896
				} catch (NumberFormatException nfe) {
896
				} 
897
				}
897
				catch (NumberFormatException nfe) {}
898
			}
898
			}
899
		} 
899
		} 
900
		String newName = baseName;
900
		String newName = baseName;
901
		
901
		
902
		StringBuffer buffer= null;
902
		StringBuffer buffer = null;
903
		while (isExistingLaunchConfigurationName(newName)) {
903
		while (isExistingLaunchConfigurationName(newName)) {
904
			buffer = new StringBuffer(baseName);
904
			buffer = new StringBuffer(baseName);
905
			buffer.append(" ("); //$NON-NLS-1$
905
			buffer.append(" ("); //$NON-NLS-1$
Lines 995-1010 Link Here
995
		List configs = new ArrayList(4);	
995
		List configs = new ArrayList(4);	
996
		NodeList list = root.getChildNodes();
996
		NodeList list = root.getChildNodes();
997
		int length = list.getLength();
997
		int length = list.getLength();
998
		Node node = null;
999
		Element entry = null;
1000
		String memento = null;
998
		for (int i = 0; i < length; ++i) {
1001
		for (int i = 0; i < length; ++i) {
999
			Node node = list.item(i);
1002
			node = list.item(i);
1000
			short type = node.getNodeType();
1003
			short type = node.getNodeType();
1001
			if (type == Node.ELEMENT_NODE) {
1004
			if (type == Node.ELEMENT_NODE) {
1002
				Element entry = (Element) node;
1005
				entry = (Element) node;
1003
				String nodeName = entry.getNodeName();
1006
				if (!entry.getNodeName().equals("launchConfiguration")) { //$NON-NLS-1$
1004
				if (!nodeName.equals("launchConfiguration")) { //$NON-NLS-1$
1005
					throw invalidFormat;
1007
					throw invalidFormat;
1006
				}
1008
				}
1007
				String memento = entry.getAttribute("memento"); //$NON-NLS-1$
1009
				memento = entry.getAttribute("memento"); //$NON-NLS-1$
1008
				if (memento == null) {
1010
				if (memento == null) {
1009
					throw invalidFormat;
1011
					throw invalidFormat;
1010
				}
1012
				}
Lines 1016-1033 Link Here
1016
	
1018
	
1017
	protected ConfigurationNotifier getConfigurationNotifier() {
1019
	protected ConfigurationNotifier getConfigurationNotifier() {
1018
		return new ConfigurationNotifier();
1020
		return new ConfigurationNotifier();
1019
	}	
1021
	}			
1020
	
1021
	/**
1022
	 * Returns a list of launch delegates contributed for existing launch configuration
1023
	 * types.
1024
	 * 
1025
	 * @return list of ContributedDelegate
1026
	 */
1027
	protected List getContributedDelegates() {
1028
		initializeContributedDelegates();
1029
		return fContributedDelegates;
1030
	}		
1031
	
1022
	
1032
	/**
1023
	/**
1033
	 * @see ILaunchManager#getDebugTargets()
1024
	 * @see ILaunchManager#getDebugTargets()
Lines 1036-1044 Link Here
1036
		synchronized (fLaunches) {
1027
		synchronized (fLaunches) {
1037
			List allTargets= new ArrayList(fLaunches.size());
1028
			List allTargets= new ArrayList(fLaunches.size());
1038
			if (fLaunches.size() > 0) {
1029
			if (fLaunches.size() > 0) {
1039
				Iterator e= fLaunches.iterator();
1030
				Iterator e = fLaunches.iterator();
1031
				IDebugTarget[] targets = null;
1040
				while (e.hasNext()) {
1032
				while (e.hasNext()) {
1041
					IDebugTarget[] targets= ((ILaunch) e.next()).getDebugTargets();
1033
					targets = ((ILaunch) e.next()).getDebugTargets();
1042
					for (int i = 0; i < targets.length; i++) {
1034
					for (int i = 0; i < targets.length; i++) {
1043
						allTargets.add(targets[i]);
1035
						allTargets.add(targets[i]);
1044
					}
1036
					}
Lines 1073-1082 Link Here
1073
		if (configEnv == null) {
1065
		if (configEnv == null) {
1074
			return null;
1066
			return null;
1075
		}
1067
		}
1076
		Map env = null;
1068
		Map env = new HashMap();
1077
		// build base environment
1069
		// build base environment
1078
		env= new HashMap();
1070
		boolean append = configuration.getAttribute(ATTR_APPEND_ENVIRONMENT_VARIABLES, true);
1079
		boolean append= configuration.getAttribute(ATTR_APPEND_ENVIRONMENT_VARIABLES, true);
1080
		if (append) {
1071
		if (append) {
1081
			env.putAll(getNativeEnvironmentCasePreserved());
1072
			env.putAll(getNativeEnvironmentCasePreserved());
1082
		}
1073
		}
Lines 1084-1093 Link Here
1084
		// Add variables from config
1075
		// Add variables from config
1085
		Iterator iter= configEnv.entrySet().iterator();
1076
		Iterator iter= configEnv.entrySet().iterator();
1086
		boolean win32= Platform.getOS().equals(Constants.OS_WIN32);
1077
		boolean win32= Platform.getOS().equals(Constants.OS_WIN32);
1078
		Map.Entry entry = null;
1079
		String key = null;
1080
		String value = null;
1081
		Object nativeValue = null;
1082
		Iterator envIter = null;
1083
		Map.Entry nativeEntry = null;
1084
		String nativeKey = null;
1087
		while (iter.hasNext()) {
1085
		while (iter.hasNext()) {
1088
			Map.Entry entry= (Map.Entry) iter.next();
1086
			entry = (Map.Entry) iter.next();
1089
			String key= (String) entry.getKey();
1087
			key = (String) entry.getKey();
1090
            String value = (String) entry.getValue();
1088
            value = (String) entry.getValue();
1091
            // translate any string substitution variables
1089
            // translate any string substitution variables
1092
            if (value != null) {
1090
            if (value != null) {
1093
                value = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(value);
1091
                value = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(value);
Lines 1095-1101 Link Here
1095
            boolean added= false;
1093
            boolean added= false;
1096
			if (win32) {
1094
			if (win32) {
1097
                // First, check if the key is an exact match for an existing key.
1095
                // First, check if the key is an exact match for an existing key.
1098
                Object nativeValue= env.get(key);
1096
				nativeValue = env.get(key);
1099
                if (nativeValue != null) {
1097
                if (nativeValue != null) {
1100
                    // If an exact match is found, just replace the value
1098
                    // If an exact match is found, just replace the value
1101
                    env.put(key, value);
1099
                    env.put(key, value);
Lines 1103-1115 Link Here
1103
                    // Win32 vars are case-insensitive. If an exact match isn't found, iterate to
1101
                    // Win32 vars are case-insensitive. If an exact match isn't found, iterate to
1104
                    // check for a case-insensitive match. We maintain the key's case (see bug 86725),
1102
                    // check for a case-insensitive match. We maintain the key's case (see bug 86725),
1105
                    // but do a case-insensitive comparison (for example, "pAtH" will still override "PATH").
1103
                    // but do a case-insensitive comparison (for example, "pAtH" will still override "PATH").
1106
                    Iterator envIter= env.entrySet().iterator();
1104
                    envIter = env.entrySet().iterator();
1107
                    while (envIter.hasNext()) {
1105
                    while (envIter.hasNext()) {
1108
                        Map.Entry nativeEntry = (Map.Entry) envIter.next();
1106
                        nativeEntry = (Map.Entry) envIter.next();
1109
                        String nativeKey= (String) (nativeEntry).getKey();
1107
                        nativeKey = (String) (nativeEntry).getKey();
1110
                        if (nativeKey.equalsIgnoreCase(key)) {
1108
                        if (nativeKey.equalsIgnoreCase(key)) {
1111
                            nativeEntry.setValue(value);
1109
                            nativeEntry.setValue(value);
1112
                            added= true;
1110
                            added = true;
1113
                            break;
1111
                            break;
1114
                        }
1112
                        }
1115
                    }
1113
                    }
Lines 1120-1130 Link Here
1120
            }
1118
            }
1121
		}		
1119
		}		
1122
		
1120
		
1123
		iter= env.entrySet().iterator();
1121
		iter = env.entrySet().iterator();
1124
		List strings= new ArrayList(env.size());
1122
		List strings = new ArrayList(env.size());
1123
		StringBuffer buffer = null;
1125
		while (iter.hasNext()) {
1124
		while (iter.hasNext()) {
1126
			Map.Entry entry = (Map.Entry) iter.next();
1125
			entry = (Map.Entry) iter.next();
1127
			StringBuffer buffer= new StringBuffer((String) entry.getKey());
1126
			buffer = new StringBuffer((String) entry.getKey());
1128
			buffer.append('=').append((String) entry.getValue());
1127
			buffer.append('=').append((String) entry.getValue());
1129
			strings.add(buffer.toString());
1128
			strings.add(buffer.toString());
1130
		}
1129
		}
Lines 1215-1222 Link Here
1215
	public ILaunchConfiguration[] getLaunchConfigurations(ILaunchConfigurationType type) throws CoreException {
1214
	public ILaunchConfiguration[] getLaunchConfigurations(ILaunchConfigurationType type) throws CoreException {
1216
		Iterator iter = getAllLaunchConfigurations().iterator();
1215
		Iterator iter = getAllLaunchConfigurations().iterator();
1217
		List configs = new ArrayList();
1216
		List configs = new ArrayList();
1217
		ILaunchConfiguration config = null;
1218
		while (iter.hasNext()) {
1218
		while (iter.hasNext()) {
1219
			ILaunchConfiguration config = (ILaunchConfiguration)iter.next();
1219
			config = (ILaunchConfiguration)iter.next();
1220
			if (config.getType().equals(type)) {
1220
			if (config.getType().equals(type)) {
1221
				configs.add(config);
1221
				configs.add(config);
1222
			}
1222
			}
Lines 1224-1230 Link Here
1224
		return (ILaunchConfiguration[])configs.toArray(new ILaunchConfiguration[configs.size()]);
1224
		return (ILaunchConfiguration[])configs.toArray(new ILaunchConfiguration[configs.size()]);
1225
	}
1225
	}
1226
	
1226
	
1227
	
1228
	/**
1227
	/**
1229
	 * Returns all launch configurations that are stored as resources
1228
	 * Returns all launch configurations that are stored as resources
1230
	 * in the given project.
1229
	 * in the given project.
Lines 1236-1244 Link Here
1236
	protected List getLaunchConfigurations(IProject project) {
1235
	protected List getLaunchConfigurations(IProject project) {
1237
		Iterator iter = getAllLaunchConfigurations().iterator();
1236
		Iterator iter = getAllLaunchConfigurations().iterator();
1238
		List configs = new ArrayList();
1237
		List configs = new ArrayList();
1238
		ILaunchConfiguration config = null;
1239
		IFile file = null;
1239
		while (iter.hasNext()) {
1240
		while (iter.hasNext()) {
1240
			ILaunchConfiguration config = (ILaunchConfiguration)iter.next();
1241
			config = (ILaunchConfiguration)iter.next();
1241
			IFile file = config.getFile();
1242
			file = config.getFile();
1242
			if (file != null && file.getProject().equals(project)) {
1243
			if (file != null && file.getProject().equals(project)) {
1243
				configs.add(config);
1244
				configs.add(config);
1244
			}
1245
			}
Lines 1276-1291 Link Here
1276
		}
1277
		}
1277
	}
1278
	}
1278
	
1279
	
1279
	/* (non-Javadoc)
1280
	/**)
1280
	 * @see org.eclipse.debug.core.ILaunchManager#getLaunchMode(java.lang.String)
1281
	 * @see org.eclipse.debug.core.ILaunchManager#getLaunchMode(java.lang.String)
1282
	 * @deprecated launch modes are removed for 3.3M3 in favour of launching with options
1281
	 */
1283
	 */
1282
	public ILaunchMode getLaunchMode(String mode) {
1284
	public ILaunchMode getLaunchMode(String mode) {
1283
		initializeLaunchModes();
1285
		initializeLaunchModes();
1284
		return (ILaunchMode) fLaunchModes.get(mode);
1286
		return (ILaunchMode) fLaunchModes.get(mode);
1285
	}
1287
	}
1286
	
1288
	
1287
	/* (non-Javadoc)
1289
	/**
1288
	 * @see org.eclipse.debug.core.ILaunchManager#getLaunchModes()
1290
	 * @see org.eclipse.debug.core.ILaunchManager#getLaunchModes()
1291
	 * @deprecated launch modes are removed for 3.3M3 in favour of launching with options
1289
	 */
1292
	 */
1290
	public ILaunchMode[] getLaunchModes() {
1293
	public ILaunchMode[] getLaunchModes() {
1291
		initializeLaunchModes();
1294
		initializeLaunchModes();
Lines 1309-1315 Link Here
1309
		Collection col = fLaunchOptions.values();
1312
		Collection col = fLaunchOptions.values();
1310
		return (ILaunchOption[])col.toArray(new ILaunchOption[col.size()]);
1313
		return (ILaunchOption[])col.toArray(new ILaunchOption[col.size()]);
1311
	}
1314
	}
1312
		
1315
	
1316
	/**
1317
	 * Initializes the listing of registered launch options. Does no work if the mapping is already populated.
1318
	 * 
1319
	 * <p>
1320
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
1321
	 * part of a work in progress. There is no guarantee that this API will
1322
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
1323
	 * without consulting with the Platform/Debug team.
1324
	 * </p>
1325
	 * @since 3.3  
1326
	 */
1327
	private synchronized void initializeLaunchOptions() {
1328
		if(fLaunchOptions == null) {
1329
			try {
1330
				IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_OPTIONS);
1331
				IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
1332
				fLaunchOptions = new HashMap();
1333
				ILaunchOption option = null;
1334
				for(int i =  0; i < infos.length; i++) {
1335
					option = new LaunchOption(infos[i]);
1336
					fLaunchOptions.put(option.getIdentifier(), option);
1337
				}
1338
			}
1339
			catch(CoreException ce) {DebugPlugin.log(ce);}
1340
		}
1341
	}
1342
	
1343
	/**
1344
	 * @see org.eclipse.debug.core.ILaunchManager#getLaunchDelegates()
1345
	 */
1346
	public ILaunchDelegate[] getLaunchDelegates() {
1347
		initializeLaunchDelegates();
1348
		Collection col = fLaunchDelegates.values();
1349
		return (ILaunchDelegate[]) col.toArray(new ILaunchDelegate[col.size()]);
1350
	}
1351
	
1352
	/**
1353
	 * @see org.eclipse.debug.core.ILaunchManager#getLaunchDelegate(java.lang.String, java.lang.String, java.lang.String[])
1354
	 */
1355
	public ILaunchConfigurationDelegate[] getLaunchDelegates(String typeid, String mode, String[] options) {
1356
		try {
1357
			initializeLaunchDelegates();
1358
			ILaunchDelegate ld = null;
1359
			boolean applies = true;
1360
			ArrayList list = new ArrayList();
1361
			Set doptions = null;
1362
			for(Iterator iter = fLaunchDelegates.keySet().iterator(); iter.hasNext();) {
1363
				ld = (ILaunchDelegate) fLaunchDelegates.get(iter.next());
1364
				doptions = ld.getOptions();
1365
				if(ld.appliesTo(typeid, mode)) {
1366
					if(options != null) {
1367
						if(doptions.size() > 0 & options.length == 0) {
1368
							applies = false;
1369
						}
1370
						for(int i = 0; i < options.length; i++) {
1371
							applies &= doptions.contains(options[i]);
1372
						}
1373
					}
1374
					else if(doptions.size() > 0) {
1375
						applies = false;
1376
					}
1377
					if(applies) {
1378
						list.add(ld.getDelegate());
1379
					}
1380
					applies = true;
1381
				}
1382
			}
1383
			return (ILaunchConfigurationDelegate[]) list.toArray(new ILaunchConfigurationDelegate[list.size()]);
1384
		}
1385
		catch(CoreException ce) {}
1386
		return null;
1387
	}
1388
	
1389
	/**
1390
	 * Initializes the listing of delegates available to the launching framework
1391
	 * 
1392
	 * <p>
1393
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
1394
	 * part of a work in progress. There is no guarantee that this API will
1395
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
1396
	 * without consulting with the Platform/Debug team.
1397
	 * </p>
1398
	 * @since 3.3
1399
	 */
1400
	private synchronized void initializeLaunchDelegates() {
1401
		if(fLaunchDelegates == null) {
1402
			fLaunchDelegates = new HashMap();
1403
			//get all launch delegate contributions
1404
			IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_DELEGATES);
1405
			IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
1406
			ILaunchDelegate delegate = null;
1407
			for(int i = 0; i < infos.length; i++) {
1408
				delegate = new LaunchDelegate(infos[i]);
1409
				fLaunchDelegates.put(delegate.getIdentifier(), delegate);
1410
			}
1411
			//get all delegates from launch configuration type contributions
1412
			extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES);
1413
			infos = extensionPoint.getConfigurationElements();
1414
			for(int i = 0; i < infos.length; i++) {
1415
				//must check to see if delegate is provided in contribution
1416
				if(infos[i].getAttribute("delegate") != null) { //$NON-NLS-1$
1417
					delegate = new LaunchDelegate(infos[i]);
1418
					fLaunchDelegates.put(delegate.getIdentifier(), delegate);
1419
				}
1420
			}
1421
		}
1422
	}
1423
	
1313
	/**
1424
	/**
1314
	 * Returns all launch configurations that are stored locally.
1425
	 * Returns all launch configurations that are stored locally.
1315
	 * 
1426
	 * 
Lines 1397-1405 Link Here
1397
			if (Platform.getOS().equals(Constants.OS_WIN32)) {
1508
			if (Platform.getOS().equals(Constants.OS_WIN32)) {
1398
				fgNativeEnv= new HashMap();
1509
				fgNativeEnv= new HashMap();
1399
				Iterator entries = casePreserved.entrySet().iterator();
1510
				Iterator entries = casePreserved.entrySet().iterator();
1511
				Map.Entry entry = null;
1512
				String key = null;
1400
				while (entries.hasNext()) {
1513
				while (entries.hasNext()) {
1401
					Map.Entry entry = (Entry) entries.next();
1514
					entry = (Entry) entries.next();
1402
					String key = ((String)entry.getKey()).toUpperCase();
1515
					key = ((String)entry.getKey()).toUpperCase();
1403
					fgNativeEnv.put(key, entry.getValue());
1516
					fgNativeEnv.put(key, entry.getValue());
1404
				}
1517
				}
1405
			} else {
1518
			} else {
Lines 1425-1434 Link Here
1425
	 */
1538
	 */
1426
	public IProcess[] getProcesses() {
1539
	public IProcess[] getProcesses() {
1427
		synchronized (fLaunches) {
1540
		synchronized (fLaunches) {
1428
			List allProcesses= new ArrayList(fLaunches.size());
1541
			List allProcesses = new ArrayList(fLaunches.size());
1429
			Iterator e= fLaunches.iterator();
1542
			Iterator e = fLaunches.iterator();
1543
			IProcess[] processes = null;
1430
			while (e.hasNext()) {
1544
			while (e.hasNext()) {
1431
				IProcess[] processes= ((ILaunch) e.next()).getProcesses();
1545
				processes = ((ILaunch) e.next()).getProcesses();
1432
				for (int i= 0; i < processes.length; i++) {
1546
				for (int i= 0; i < processes.length; i++) {
1433
					allProcesses.add(processes[i]);
1547
					allProcesses.add(processes[i]);
1434
				}
1548
				}
Lines 1494-1502 Link Here
1494
			IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_COMPARATORS);
1608
			IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_COMPARATORS);
1495
			IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
1609
			IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
1496
			fComparators = new HashMap(infos.length);
1610
			fComparators = new HashMap(infos.length);
1611
			IConfigurationElement configurationElement = null;
1612
			String attr = null;
1497
			for (int i= 0; i < infos.length; i++) {
1613
			for (int i= 0; i < infos.length; i++) {
1498
				IConfigurationElement configurationElement = infos[i];
1614
				configurationElement = infos[i];
1499
				String attr = configurationElement.getAttribute("attribute"); //$NON-NLS-1$			
1615
				attr = configurationElement.getAttribute("attribute"); //$NON-NLS-1$			
1500
				if (attr != null) {
1616
				if (attr != null) {
1501
					fComparators.put(attr, new LaunchConfigurationComparator(configurationElement));
1617
					fComparators.put(attr, new LaunchConfigurationComparator(configurationElement));
1502
				} else {
1618
				} else {
Lines 1508-1539 Link Here
1508
			}
1624
			}
1509
		}
1625
		}
1510
	}
1626
	}
1511
	
1627
1512
	/**
1628
	/**
1513
	 * Initializes contributed launch delegates (i.e. delegates contributed
1629
	 * Initializes the listing of <code>LaunchConfigurationType</code>s.
1514
	 * to an existing launch configuration type).
1515
	 */
1630
	 */
1516
	private synchronized void initializeContributedDelegates() {
1517
		if (fContributedDelegates == null) {
1518
			IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_DELEGATES);
1519
			IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
1520
			fContributedDelegates = new ArrayList(infos.length);
1521
			for (int i= 0; i < infos.length; i++) {		
1522
				fContributedDelegates.add(new ContributedDelegate(infos[i]));
1523
			}
1524
		}
1525
	}
1526
	
1527
	private synchronized void initializeLaunchConfigurationTypes() {
1631
	private synchronized void initializeLaunchConfigurationTypes() {
1528
		if (fLaunchConfigurationTypes == null) {
1632
		if (fLaunchConfigurationTypes == null) {
1529
			hookResourceChangeListener();
1633
			hookResourceChangeListener();
1530
			IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES);
1634
			IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES);
1531
			IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
1635
			IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
1532
			fLaunchConfigurationTypes= new ArrayList(infos.length);
1636
			fLaunchConfigurationTypes = new ArrayList(infos.length);
1533
			for (int i= 0; i < infos.length; i++) {
1637
			for (int i= 0; i < infos.length; i++) {		
1534
				IConfigurationElement configurationElement = infos[i];
1638
				fLaunchConfigurationTypes.add(new LaunchConfigurationType(infos[i]));
1535
				LaunchConfigurationType configType = new LaunchConfigurationType(configurationElement); 			
1536
				fLaunchConfigurationTypes.add(configType);
1537
			}
1639
			}
1538
		}
1640
		}
1539
	}
1641
	}
Lines 1543-1548 Link Here
1543
	 * 
1645
	 * 
1544
	 * @exception CoreException if an exception occurs reading
1646
	 * @exception CoreException if an exception occurs reading
1545
	 *  the extensions
1647
	 *  the extensions
1648
	 *  
1546
	 */
1649
	 */
1547
	private synchronized void initializeLaunchModes() {
1650
	private synchronized void initializeLaunchModes() {
1548
		if (fLaunchModes == null) {
1651
		if (fLaunchModes == null) {
Lines 1559-1584 Link Here
1559
			catch (CoreException e) {DebugPlugin.log(e);}
1662
			catch (CoreException e) {DebugPlugin.log(e);}
1560
		}
1663
		}
1561
	}
1664
	}
1562
1563
	/**
1564
	 * Initializes the listing of registered launch options. Does no work if the mapping is already populated.
1565
	 * @since 3.3  
1566
	 */
1567
	private synchronized void initializeLaunchOptions() {
1568
		if(fLaunchOptions == null) {
1569
			try {
1570
				IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_OPTIONS);
1571
				IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
1572
				fLaunchOptions = new HashMap();
1573
				ILaunchOption option = null;
1574
				for(int i =  0; i < infos.length; i++) {
1575
					option = new LaunchOption(infos[i]);
1576
					fLaunchOptions.put(option.getIdentifier(), option);
1577
				}
1578
			}
1579
			catch(CoreException ce) {DebugPlugin.log(ce);}
1580
		}
1581
	}
1582
	
1665
	
1583
	/**
1666
	/**
1584
	 * Initializes source container type and source path computer extensions.
1667
	 * Initializes source container type and source path computer extensions.
Lines 1615-1623 Link Here
1615
			IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_SOURCE_LOCATORS);
1698
			IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_SOURCE_LOCATORS);
1616
			IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
1699
			IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
1617
			fSourceLocators= new HashMap(infos.length);
1700
			fSourceLocators= new HashMap(infos.length);
1701
			IConfigurationElement configurationElement = null;
1702
			String id = null;
1618
			for (int i= 0; i < infos.length; i++) {
1703
			for (int i= 0; i < infos.length; i++) {
1619
				IConfigurationElement configurationElement = infos[i];
1704
				configurationElement = infos[i];
1620
				String id = configurationElement.getAttribute("id"); //$NON-NLS-1$			
1705
				id = configurationElement.getAttribute("id"); //$NON-NLS-1$			
1621
				if (id != null) {
1706
				if (id != null) {
1622
					fSourceLocators.put(id,configurationElement);
1707
					fSourceLocators.put(id,configurationElement);
1623
				} else {
1708
				} else {
Lines 1812-1819 Link Here
1812
		if (!configs.isEmpty()) {
1897
		if (!configs.isEmpty()) {
1813
			Iterator iterator = configs.iterator();
1898
			Iterator iterator = configs.iterator();
1814
			while (iterator.hasNext()) {
1899
			while (iterator.hasNext()) {
1815
				ILaunchConfiguration configuration = (ILaunchConfiguration)iterator.next();
1900
				launchConfigurationDeleted((ILaunchConfiguration)iterator.next());
1816
				launchConfigurationDeleted(configuration);
1817
			}
1901
			}
1818
		}
1902
		}
1819
		//bug 12134
1903
		//bug 12134
Lines 1832-1839 Link Here
1832
		if (!configs.isEmpty()) {
1916
		if (!configs.isEmpty()) {
1833
			Iterator iterator = configs.iterator();
1917
			Iterator iterator = configs.iterator();
1834
			while (iterator.hasNext()) {
1918
			while (iterator.hasNext()) {
1835
				ILaunchConfiguration config = (ILaunchConfiguration) iterator.next();
1919
				launchConfigurationAdded((ILaunchConfiguration) iterator.next());
1836
				launchConfigurationAdded(config);
1837
			}			
1920
			}			
1838
		}
1921
		}
1839
	}
1922
	}
Lines 1953-1960 Link Here
1953
        fLaunchesListeners = new ListenerList();
2036
        fLaunchesListeners = new ListenerList();
1954
        fLaunchConfigurationListeners = new ListenerList();
2037
        fLaunchConfigurationListeners = new ListenerList();
1955
		ILaunch[] launches = getLaunches();
2038
		ILaunch[] launches = getLaunches();
2039
		ILaunch launch = null;
1956
		for (int i= 0; i < launches.length; i++) {
2040
		for (int i= 0; i < launches.length; i++) {
1957
			ILaunch launch= launches[i];
2041
			launch = launches[i];
1958
			try {
2042
			try {
1959
                if (launch instanceof IDisconnect) {
2043
                if (launch instanceof IDisconnect) {
1960
                    IDisconnect disconnect = (IDisconnect)launch;
2044
                    IDisconnect disconnect = (IDisconnect)launch;
Lines 2014-2021 Link Here
2014
	 */
2098
	 */
2015
	protected void verifyConfigurations(List verify, List valid) {
2099
	protected void verifyConfigurations(List verify, List valid) {
2016
		Iterator configs = verify.iterator();
2100
		Iterator configs = verify.iterator();
2101
		ILaunchConfiguration config = null;
2017
		while (configs.hasNext()) {
2102
		while (configs.hasNext()) {
2018
			ILaunchConfiguration config = (ILaunchConfiguration)configs.next();
2103
			config = (ILaunchConfiguration)configs.next();
2019
			if (isValid(config)) {
2104
			if (isValid(config)) {
2020
				valid.add(config);
2105
				valid.add(config);
2021
			}
2106
			}
(-)core/org/eclipse/debug/internal/core/LaunchConfiguration.java (-6 / +33 lines)
Lines 13-19 Link Here
13
 
13
 
14
import java.io.IOException;
14
import java.io.IOException;
15
import java.io.StringReader;
15
import java.io.StringReader;
16
import com.ibm.icu.text.MessageFormat;
17
import java.util.ArrayList;
16
import java.util.ArrayList;
18
import java.util.List;
17
import java.util.List;
19
import java.util.Map;
18
import java.util.Map;
Lines 55-60 Link Here
55
import org.xml.sax.SAXException;
54
import org.xml.sax.SAXException;
56
import org.xml.sax.helpers.DefaultHandler;
55
import org.xml.sax.helpers.DefaultHandler;
57
56
57
import com.ibm.icu.text.MessageFormat;
58
58
/**
59
/**
59
 * Launch configuration handle.
60
 * Launch configuration handle.
60
 * 
61
 * 
Lines 82-87 Link Here
82
	public static final String ATTR_MAPPED_RESOURCE_TYPES = DebugPlugin.getUniqueIdentifier() + ".MAPPED_RESOURCE_TYPES"; //$NON-NLS-1$
83
	public static final String ATTR_MAPPED_RESOURCE_TYPES = DebugPlugin.getUniqueIdentifier() + ".MAPPED_RESOURCE_TYPES"; //$NON-NLS-1$
83
	
84
	
84
	/**
85
	/**
86
	 * The listing of applicable launch options for this configuration.
87
	 * 
88
	 * <p>
89
	 * <strong>EXPERIMENTAL</strong>. This class has been added as
90
	 * part of a work in progress. There is no guarantee that this API will
91
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
92
	 * without consulting with the Platform/Debug team.
93
	 * </p>
94
	 * @since 3.3
95
	 */
96
	public static final String ATTR_LAUNCH_OPTIONS = DebugPlugin.getUniqueIdentifier() + ".LAUNCH_OPTIONS"; //$NON-NLS-1$
97
	
98
	/**
85
	 * Location this configuration is stored in. This 
99
	 * Location this configuration is stored in. This 
86
	 * is the key for a launch configuration handle.
100
	 * is the key for a launch configuration handle.
87
	 */
101
	 */
Lines 320-333 Link Here
320
	/**
334
	/**
321
	 * Returns the launch configuration delegate for this
335
	 * Returns the launch configuration delegate for this
322
	 * launch configuration, for the specified launch mode.
336
	 * launch configuration, for the specified launch mode.
323
	 * 
324
	 * @param mode launch mode
337
	 * @param mode launch mode
325
	 * @return launch configuration delegate
338
	 * @return launch configuration delegate
326
	 * @exception CoreException if the delegate was unable
339
	 * @exception CoreException if the delegate was unable
327
	 *  to be created
340
	 *  to be created
328
	 */
341
	 */
329
	protected ILaunchConfigurationDelegate getDelegate(String mode) throws CoreException {
342
	protected ILaunchConfigurationDelegate getDelegate(String mode, String[] options) throws CoreException {
330
		return getType().getDelegate(mode);
343
		return getType().getDelegate(mode, options);
331
	}
344
	}
332
345
333
	/* (non-Javadoc)
346
	/* (non-Javadoc)
Lines 480-485 Link Here
480
		return getLastLocationSegment();
493
		return getLastLocationSegment();
481
	}
494
	}
482
495
496
	/**
497
	 * @see org.eclipse.debug.core.ILaunchConfiguration#getOptions()
498
	 */
499
	public String[] getOptions() throws CoreException {
500
		String str = getAttribute(ATTR_LAUNCH_OPTIONS, (String)null); 
501
		if(str != null) {
502
			String[] atts = str.split(","); //$NON-NLS-1$
503
			if(atts != null) {
504
				return atts;
505
			}
506
		}
507
		return new String[0];
508
	}
509
	
483
	/* (non-Javadoc)
510
	/* (non-Javadoc)
484
	 * @see org.eclipse.debug.core.ILaunchConfiguration#getType()
511
	 * @see org.eclipse.debug.core.ILaunchConfiguration#getType()
485
	 */
512
	 */
Lines 570-576 Link Here
570
     */
597
     */
571
    public ILaunch launch(String mode, IProgressMonitor monitor, boolean build, boolean register) throws CoreException {
598
    public ILaunch launch(String mode, IProgressMonitor monitor, boolean build, boolean register) throws CoreException {
572
		// bug 28245 - force the delegate to load in case it is interested in launch notifications
599
		// bug 28245 - force the delegate to load in case it is interested in launch notifications
573
		ILaunchConfigurationDelegate delegate= getDelegate(mode);
600
		ILaunchConfigurationDelegate delegate = getDelegate(mode, getOptions());
574
		ILaunchConfigurationDelegate2 delegate2 = null;
601
		ILaunchConfigurationDelegate2 delegate2 = null;
575
		if (delegate instanceof ILaunchConfigurationDelegate2) {
602
		if (delegate instanceof ILaunchConfigurationDelegate2) {
576
			delegate2 = (ILaunchConfigurationDelegate2) delegate;
603
			delegate2 = (ILaunchConfigurationDelegate2) delegate;
Lines 690-694 Link Here
690
		return getType().supportsMode(mode);
717
		return getType().supportsMode(mode);
691
	}
718
	}
692
	
719
	
693
}//end class
720
}
694
721
(-)core/org/eclipse/debug/internal/core/ContributedDelegate.java (-145 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 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 com.ibm.icu.text.MessageFormat;
14
import java.util.HashSet;
15
import java.util.Set;
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.model.ILaunchConfigurationDelegate;
22
23
/**
24
 * A placeholder for a launch delegate contributed for a launch mode for an
25
 * existing launch configuration type.
26
 */
27
public class ContributedDelegate {
28
29
	/**
30
	 * The configuration element of the extension.
31
	 */
32
	private IConfigurationElement fElement;
33
	
34
	/**
35
	 * Modes this delegate supports.
36
	 */
37
	private Set fModes;
38
	
39
	/**
40
	 * Delegate, or <code>null</code> if not yet instantiated.
41
	 */
42
	private ILaunchConfigurationDelegate fDelegate;
43
	
44
	/**
45
	 * Constructs a new contributed delegate on the
46
	 * given configuration element.
47
	 * 
48
	 * @param element configuration element
49
	 */
50
	protected ContributedDelegate(IConfigurationElement element) {
51
		setConfigurationElement(element);
52
	}
53
	
54
	/**
55
	 * Sets this delegate's configuration element.
56
	 * 
57
	 * @param element this delegate's configuration element
58
	 */
59
	private void setConfigurationElement(IConfigurationElement element) {
60
		fElement = element;
61
	}
62
	
63
	/**
64
	 * Returns this delegate's configuration element.
65
	 * 
66
	 * @return this delegate's configuration element
67
	 */
68
	protected IConfigurationElement getConfigurationElement() {
69
		return fElement;
70
	}	
71
	
72
	/**
73
	 * Returns the set of modes specified in the configuration data.
74
	 * 
75
	 * @return the set of modes specified in the configuration data
76
	 */
77
	protected Set getModes() {
78
		if (fModes == null) {
79
			String modes= getConfigurationElement().getAttribute("modes"); //$NON-NLS-1$
80
			if (modes == null) {
81
				return new HashSet(0);
82
			}
83
			String[] strings = modes.split(","); //$NON-NLS-1$
84
			fModes = new HashSet(3);
85
			for (int i = 0; i < strings.length; i++) {
86
				String string = strings[i];
87
				fModes.add(string.trim());
88
			}
89
		}
90
		return fModes;
91
	}
92
	
93
	/**
94
	 * Returns the type identifier of launch configuration type this delegate is
95
	 * contributed to.
96
	 */
97
	protected String getLaunchConfigurationType() {
98
		return getConfigurationElement().getAttribute("type"); //$NON-NLS-1$
99
	}
100
	
101
	protected ILaunchConfigurationDelegate getDelegate() throws CoreException {
102
		if (fDelegate == null) {
103
			Object object = getConfigurationElement().createExecutableExtension("delegate"); //$NON-NLS-1$
104
			if (object instanceof ILaunchConfigurationDelegate) {
105
				fDelegate = (ILaunchConfigurationDelegate)object;
106
			} else {
107
				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)); 
108
			}		
109
		}
110
		return fDelegate;
111
	}
112
	
113
	/**
114
	 * Returns the identifier of this extension point.
115
	 */
116
	protected String getIdentifier() {
117
		return getConfigurationElement().getAttribute("id"); //$NON-NLS-1$
118
	}	
119
	
120
	/**
121
	 * Returns the source path computer id specified by this launch delegate 
122
	 * or <code>null</code> if none.
123
	 * 
124
	 * @return the source path computer id specified by this launch delegate 
125
	 * or <code>null</code> if none
126
	 * 
127
	 * @since 3.1
128
	 */
129
	protected String getSourcePathComputerId() {
130
		return getConfigurationElement().getAttribute("sourcePathComputerId"); //$NON-NLS-1$
131
	}
132
	
133
	/**
134
	 * Returns the source locater id specified by this launch delegate 
135
	 * or <code>null</code> if none.
136
	 * 
137
	 * @return the source locater id specified by this launch delegate 
138
	 * or <code>null</code> if none
139
	 * 
140
	 * @since 3.1
141
	 */
142
	protected String getSourceLocaterId() {
143
		return getConfigurationElement().getAttribute("sourceLocatorId"); //$NON-NLS-1$
144
	}
145
}
(-)core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java (-2 / +19 lines)
Lines 404-409 Link Here
404
	}
404
	}
405
	
405
	
406
	/**
406
	/**
407
	 * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#setOptions(java.lang.String[])
408
	 */
409
	public void setOptions(String[] options) {
410
		String str = null;
411
		if(options != null) {
412
			str = ""; //$NON-NLS-1$
413
			for(int i = 0; i < options.length; i++) {
414
				str += options[i];
415
				if(i < options.length-1) {
416
					str += ","; //$NON-NLS-1$
417
				}
418
			}
419
		}
420
		setAttribute(ATTR_LAUNCH_OPTIONS, str);
421
	}
422
	
423
	/**
407
	 * Sets this working copy's state to not dirty.
424
	 * Sets this working copy's state to not dirty.
408
	 */
425
	 */
409
	private void resetDirty() {
426
	private void resetDirty() {
Lines 574-580 Link Here
574
		}
591
		}
575
		setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_PATHS, paths);
592
		setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_PATHS, paths);
576
		setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_TYPES, types);
593
		setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_TYPES, types);
577
	}//end setResource
594
	}
578
595
579
}//end class
596
}
580
597
(-)schema/launchOptions.exsd (-2 / +7 lines)
Lines 8-13 Link Here
8
      <documentation>
8
      <documentation>
9
         This extension point is used to contribute launch options to the launch manager.
9
         This extension point is used to contribute launch options to the launch manager.
10
Launch options are used as modifiers when executing a launch configuration.
10
Launch options are used as modifiers when executing a launch configuration.
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;
11
      </documentation>
16
      </documentation>
12
   </annotation>
17
   </annotation>
13
18
Lines 101-107 Link Here
101
   &lt;/launchOption&gt;
106
   &lt;/launchOption&gt;
102
  &lt;/extension&gt;
107
  &lt;/extension&gt;
103
&lt;/pre&gt;
108
&lt;/pre&gt;
104
&lt;/p&gt;   
109
&lt;/p&gt;
105
      </documentation>
110
      </documentation>
106
   </annotation>
111
   </annotation>
107
112
Lines 128-134 Link Here
128
         <meta.section type="copyright"/>
133
         <meta.section type="copyright"/>
129
      </appInfo>
134
      </appInfo>
130
      <documentation>
135
      <documentation>
131
         Copyright (c) 2003, 2005 IBM Corporation and others.&lt;br&gt;
136
         Copyright (c) 2006 IBM Corporation and others.&lt;br&gt;
132
All rights reserved. This program and the accompanying materials are made 
137
All rights reserved. This program and the accompanying materials are made 
133
available under the terms of the Eclipse Public License v1.0 which 
138
available under the terms of the Eclipse Public License v1.0 which 
134
accompanies this distribution, and is available at 
139
accompanies this distribution, and is available at 
(-)schema/launchConfigurationTypes.exsd (-3 / +52 lines)
Lines 60-81 Link Here
60
               </documentation>
60
               </documentation>
61
            </annotation>
61
            </annotation>
62
         </attribute>
62
         </attribute>
63
         <attribute name="delegate" type="string" use="required">
63
         <attribute name="delegate" type="string">
64
            <annotation>
64
            <annotation>
65
               <documentation>
65
               <documentation>
66
                  specifies the fully qualified name of the Java class that implements &lt;code&gt;ILaunchConfigurationDelegate&lt;/code&gt;.
66
                  specifies the fully qualified name of the Java class that implements &lt;code&gt;ILaunchConfigurationDelegate&lt;/code&gt;.
67
Launch configuration instances of this type will delegate to instances of this class to perform launching.
67
Launch configuration instances of this type will delegate to instances of this class to perform launching.
68
69
With new API changes for 3.3M3 the delegate should be contributed via the &lt;code&gt;launchDelegates&lt;/code&gt; extension point
70
&lt;p&gt;
71
&lt;strong&gt;EXPERIMENTAL&lt;/strong&gt;. This attribute has been deprecated as
72
part of a work in progress. There is no guarantee that this API will
73
remain unchanged during the 3.3 release cycle. Please do not use this API
74
without consulting with the Platform/Debug team.
75
&lt;/p&gt;
68
               </documentation>
76
               </documentation>
69
               <appInfo>
77
               <appInfo>
70
                  <meta.attribute kind="java" basedOn="org.eclipse.debug.core.model.ILaunchConfigurationDelegate"/>
78
                  <meta.attribute kind="java" basedOn="org.eclipse.debug.core.model.ILaunchConfigurationDelegate" deprecated="true"/>
71
               </appInfo>
79
               </appInfo>
72
            </annotation>
80
            </annotation>
73
         </attribute>
81
         </attribute>
74
         <attribute name="modes" type="string" use="required">
82
         <attribute name="modes" type="string">
75
            <annotation>
83
            <annotation>
76
               <documentation>
84
               <documentation>
77
                  specifies a comma-separated list of the modes this type of lauch configuration supports - &quot;run&quot; and/or &quot;debug&quot;.
85
                  specifies a comma-separated list of the modes this type of lauch configuration supports - &quot;run&quot; and/or &quot;debug&quot;.
86
87
With new API changes for 3.3M3 the delegate should be contributed via the &lt;code&gt;launchDelegates&lt;/code&gt; extension point
88
89
&lt;p&gt;
90
&lt;strong&gt;EXPERIMENTAL&lt;/strong&gt;. This attribute has been deprecated as
91
part of a work in progress. There is no guarantee that this API will
92
remain unchanged during the 3.3 release cycle. Please do not use this API
93
without consulting with the Platform/Debug team.
94
&lt;/p&gt;
78
               </documentation>
95
               </documentation>
96
               <appInfo>
97
                  <meta.attribute deprecated="true"/>
98
               </appInfo>
79
            </annotation>
99
            </annotation>
80
         </attribute>
100
         </attribute>
81
         <attribute name="name" type="string" use="required">
101
         <attribute name="name" type="string" use="required">
Lines 106-119 Link Here
106
            <annotation>
126
            <annotation>
107
               <documentation>
127
               <documentation>
108
                  The unique identifier of a sourcePathComputer extension that is used to compute a default source lookup path for launch configurations of this type. This atttribute was added in the 3.0 release.
128
                  The unique identifier of a sourcePathComputer extension that is used to compute a default source lookup path for launch configurations of this type. This atttribute was added in the 3.0 release.
129
130
With new API changes for 3.3M3 the delegate should be contributed via the &lt;code&gt;launchDelegates&lt;/code&gt; extension point
109
               </documentation>
131
               </documentation>
132
               <appInfo>
133
                  <meta.attribute deprecated="true"/>
134
               </appInfo>
110
            </annotation>
135
            </annotation>
111
         </attribute>
136
         </attribute>
112
         <attribute name="sourceLocatorId" type="string">
137
         <attribute name="sourceLocatorId" type="string">
113
            <annotation>
138
            <annotation>
114
               <documentation>
139
               <documentation>
115
                  The unique identifier of a sourceLocator extension that is used to create the source locator for sessions launched using launch configurations of this type. This atttribute was added in the 3.0 release.
140
                  The unique identifier of a sourceLocator extension that is used to create the source locator for sessions launched using launch configurations of this type. This atttribute was added in the 3.0 release.
141
142
With new API changes for 3.3M3 the delegate should be contributed via the &lt;code&gt;launchDelegates&lt;/code&gt; extension point
116
               </documentation>
143
               </documentation>
144
               <appInfo>
145
                  <meta.attribute deprecated="true"/>
146
               </appInfo>
117
            </annotation>
147
            </annotation>
118
         </attribute>
148
         </attribute>
119
         <attribute name="migrationDelegate" type="string">
149
         <attribute name="migrationDelegate" type="string">
Lines 126-131 Link Here
126
               </appInfo>
156
               </appInfo>
127
            </annotation>
157
            </annotation>
128
         </attribute>
158
         </attribute>
159
         <attribute name="icon" type="string">
160
            <annotation>
161
               <documentation>
162
                  The id of the icon for this launch configuraiton type.
163
164
since 3.3
165
166
&lt;p&gt;
167
&lt;strong&gt;EXPERIMENTAL&lt;/strong&gt;. This element has been added as
168
part of a work in progress. There is no guarantee that this API will
169
remain unchanged during the 3.3 release cycle. Please do not use this API
170
without consulting with the Platform/Debug team.
171
&lt;/p&gt;
172
               </documentation>
173
               <appInfo>
174
                  <meta.attribute kind="resource"/>
175
               </appInfo>
176
            </annotation>
177
         </attribute>
129
      </complexType>
178
      </complexType>
130
   </element>
179
   </element>
131
180
(-)schema/launchDelegates.exsd (-155 / +207 lines)
Lines 1-155 Link Here
1
<?xml version='1.0' encoding='UTF-8'?>
1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- Schema file written by PDE -->
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.eclipse.debug.core">
3
<schema targetNamespace="org.eclipse.debug.core">
4
<annotation>
4
<annotation>
5
      <appInfo>
5
      <appInfo>
6
         <meta.schema plugin="org.eclipse.debug.core" id="launchDelegates" name="Launch Delegates"/>
6
         <meta.schema plugin="org.eclipse.debug.core" id="launchDelegates" name="Launch Delegates"/>
7
      </appInfo>
7
      </appInfo>
8
      <documentation>
8
      <documentation>
9
         This extension point provides a mechanism for contributing a launch delegate to an existing launch configuration type for one or more launch modes. Since launch modes are extensible, it may be neccessary to contribute additional launch delegates to an existing launch configuration type. Each launch delegate is contributed for a specific launch configuration type. A launch delegate supports one or more launch modes, and specifies a delegate responsible for the implementation of launching.
9
         This extension point provides a mechanism for contributing a launch delegate to an existing launch configuration type for one or more launch modes. Since launch modes are extensible, it may be neccessary to contribute additional launch delegates to an existing launch configuration type. Each launch delegate is contributed for a specific launch configuration type. A launch delegate supports one or more launch modes, and specifies a delegate responsible for the implementation of launching.
10
      </documentation>
10
      </documentation>
11
   </annotation>
11
   </annotation>
12
12
13
   <element name="extension">
13
   <element name="extension">
14
      <complexType>
14
      <complexType>
15
         <sequence>
15
         <sequence>
16
            <element ref="launchDelegate" minOccurs="1" maxOccurs="unbounded"/>
16
            <element ref="launchDelegate" minOccurs="1" maxOccurs="unbounded"/>
17
         </sequence>
17
         </sequence>
18
         <attribute name="point" type="string" use="required">
18
         <attribute name="point" type="string" use="required">
19
            <annotation>
19
            <annotation>
20
               <documentation>
20
               <documentation>
21
                  a fully qualified identifier of the target extension point
21
                  a fully qualified identifier of the target extension point
22
               </documentation>
22
               </documentation>
23
            </annotation>
23
            </annotation>
24
         </attribute>
24
         </attribute>
25
         <attribute name="id" type="string">
25
         <attribute name="id" type="string">
26
            <annotation>
26
            <annotation>
27
               <documentation>
27
               <documentation>
28
                  an optional identifier of the extension instance
28
                  an optional identifier of the extension instance
29
               </documentation>
29
               </documentation>
30
            </annotation>
30
            </annotation>
31
         </attribute>
31
         </attribute>
32
         <attribute name="name" type="string">
32
         <attribute name="name" type="string">
33
            <annotation>
33
            <annotation>
34
               <documentation>
34
               <documentation>
35
                  an optional name of the extension instance
35
                  an optional name of the extension instance
36
               </documentation>
36
               </documentation>
37
            </annotation>
37
            </annotation>
38
         </attribute>
38
         </attribute>
39
      </complexType>
39
      </complexType>
40
   </element>
40
   </element>
41
41
42
   <element name="launchDelegate">
42
   <element name="launchDelegate">
43
      <annotation>
43
      <annotation>
44
         <appInfo>
44
         <appInfo>
45
            <meta.element labelAttribute="name"/>
45
            <meta.element labelAttribute="name"/>
46
         </appInfo>
46
         </appInfo>
47
      </annotation>
47
      </annotation>
48
      <complexType>
48
      <complexType>
49
         <sequence>
49
         <sequence minOccurs="0" maxOccurs="unbounded">
50
         </sequence>
50
         </sequence>
51
         <attribute name="id" type="string" use="required">
51
         <attribute name="id" type="string" use="required">
52
            <annotation>
52
            <annotation>
53
               <documentation>
53
               <documentation>
54
                  specifies a unique identifier for this launch delegate.
54
                  specifies a unique identifier for this launch delegate.
55
               </documentation>
55
               </documentation>
56
            </annotation>
56
            </annotation>
57
         </attribute>
57
         </attribute>
58
         <attribute name="delegate" type="string" use="required">
58
         <attribute name="name" type="string">
59
            <annotation>
59
            <annotation>
60
               <documentation>
60
               <documentation>
61
                  specifies the fully qualified name of the Java class that implements &lt;code&gt;ILaunchConfigurationDelegate&lt;/code&gt;.
61
                  specifies a human readable name for this delegate
62
Launch configuration instances of this delegate&apos;s type will delegate to instances of this class to perform launching.
62
63
               </documentation>
63
since 3.3M3
64
               <appInfo>
64
65
                  <meta.attribute kind="java" basedOn="org.eclipse.debug.core.model.ILaunchConfigurationDelegate"/>
65
&lt;p&gt;
66
               </appInfo>
66
&lt;strong&gt;EXPERIMENTAL&lt;/strong&gt;. This attribute has been added as
67
            </annotation>
67
part of a work in progress. There is no guarantee that this API will
68
         </attribute>
68
remain unchanged during the 3.3 release cycle. Please do not use this API
69
         <attribute name="modes" type="string" use="required">
69
without consulting with the Platform/Debug team.
70
            <annotation>
70
&lt;/p&gt;
71
               <documentation>
71
               </documentation>
72
                  specifies a comma-separated list of the modes this lauch delegate supports.
72
               <appInfo>
73
               </documentation>
73
                  <meta.attribute translatable="true"/>
74
            </annotation>
74
               </appInfo>
75
         </attribute>
75
            </annotation>
76
         <attribute name="type" type="string" use="required">
76
         </attribute>
77
            <annotation>
77
         <attribute name="delegate" type="string" use="required">
78
               <documentation>
78
            <annotation>
79
                  identifier of an existing launch configuration type that this launch delegate is capable of launching.
79
               <documentation>
80
               </documentation>
80
                  specifies the fully qualified name of the Java class that implements &lt;code&gt;ILaunchConfigurationDelegate&lt;/code&gt;.
81
            </annotation>
81
Launch configuration instances of this delegate&apos;s type will delegate to instances of this class to perform launching.
82
         </attribute>
82
               </documentation>
83
         <attribute name="sourcePathComputerId" type="string">
83
               <appInfo>
84
            <annotation>
84
                  <meta.attribute kind="java" basedOn="org.eclipse.debug.core.model.ILaunchConfigurationDelegate"/>
85
               <documentation>
85
               </appInfo>
86
                  The unique identifier of a sourcePathComputer extension that is used to compute a default source lookup path for launch configurations of this type. Since 3.1, this attribute cab be specified in a launchDelegate extension when unspecified in the assocaited launchConfigurationType extension. Only one source path computer can be specified per launch configuration type.
86
            </annotation>
87
               </documentation>
87
         </attribute>
88
            </annotation>
88
         <attribute name="modes" type="string">
89
         </attribute>
89
            <annotation>
90
         <attribute name="sourceLocatorId" type="string">
90
               <documentation>
91
            <annotation>
91
                  specifies a comma-separated list of the modes this lauch delegate supports.
92
               <documentation>
92
               </documentation>
93
                  The unique identifier of a sourceLocator extension that is used to create the source locator for sessions launched using launch configurations of this type. Since 3.1, this attribute can be specified in a launchDelegate extension when unspecified in the assocaited launchConfigurationType extension. Only one source locater can be specified per launch configuration type.
93
            </annotation>
94
               </documentation>
94
         </attribute>
95
            </annotation>
95
         <attribute name="type" type="string">
96
         </attribute>
96
            <annotation>
97
      </complexType>
97
               <documentation>
98
   </element>
98
                  identifier of an existing launch configuration type that this launch delegate is capable of launching.
99
99
               </documentation>
100
   <annotation>
100
            </annotation>
101
      <appInfo>
101
         </attribute>
102
         <meta.section type="since"/>
102
         <attribute name="sourcePathComputerId" type="string">
103
      </appInfo>
103
            <annotation>
104
      <documentation>
104
               <documentation>
105
         3.0
105
                  The unique identifier of a sourcePathComputer extension that is used to compute a default source lookup path for launch configurations of this type. Since 3.1, this attribute cab be specified in a launchDelegate extension when unspecified in the assocaited launchConfigurationType extension. Only one source path computer can be specified per launch configuration type.
106
      </documentation>
106
               </documentation>
107
   </annotation>
107
            </annotation>
108
108
         </attribute>
109
   <annotation>
109
         <attribute name="sourceLocatorId" type="string">
110
      <appInfo>
110
            <annotation>
111
         <meta.section type="examples"/>
111
               <documentation>
112
      </appInfo>
112
                  The unique identifier of a sourceLocator extension that is used to create the source locator for sessions launched using launch configurations of this type. Since 3.1, this attribute can be specified in a launchDelegate extension when unspecified in the assocaited launchConfigurationType extension. Only one source locater can be specified per launch configuration type.
113
      <documentation>
113
               </documentation>
114
         The following is an example of a launch delegate extension point:
114
            </annotation>
115
115
         </attribute>
116
&lt;p&gt;
116
         <attribute name="options" type="string">
117
&lt;pre&gt;
117
            <annotation>
118
 &lt;extension point=&quot;org.eclipse.debug.core.launchDelegates&quot;&gt;
118
               <documentation>
119
  &lt;launchDelegate
119
                  This attribute allows contributors to sepcify what options this delegate can apply to other than the specified modes
120
   id=&quot;com.example.ExampleProfileDelegate&quot;
120
121
   delegate=&quot;com.example.ExampleProfileDelegate&quot;
121
since 3.3M3
122
   type=&quot;org.eclipse.jdt.launching.localJavaApplication&quot;
122
123
   modes=&quot;profile&quot;&gt;
123
&lt;p&gt;
124
  &lt;/launchDelegate&gt;
124
&lt;strong&gt;EXPERIMENTAL&lt;/strong&gt;. This attribute has been added as
125
 &lt;/extension&gt;
125
part of a work in progress. There is no guarantee that this API will
126
&lt;/pre&gt;
126
remain unchanged during the 3.3 release cycle. Please do not use this API
127
&lt;/p&gt;
127
without consulting with the Platform/Debug team.
128
128
&lt;/p&gt;
129
In the example above, the specified launch delegate is contributed to launch Java applications in profile mode.
129
               </documentation>
130
      </documentation>
130
            </annotation>
131
   </annotation>
131
         </attribute>
132
132
      </complexType>
133
   <annotation>
133
   </element>
134
      <appInfo>
134
135
         <meta.section type="apiInfo"/>
135
   <annotation>
136
      </appInfo>
136
      <appInfo>
137
      <documentation>
137
         <meta.section type="since"/>
138
         Value of the attribute &lt;b&gt;delegate&lt;/b&gt; must be a fully qualified name of a Java class that implements the interface &lt;b&gt;org.eclipse.debug.core.model.ILaunchConfigurationDelegate&lt;/b&gt;.
138
      </appInfo>
139
      </documentation>
139
      <documentation>
140
   </annotation>
140
         3.0
141
141
      </documentation>
142
   <annotation>
142
   </annotation>
143
      <appInfo>
143
144
         <meta.section type="copyright"/>
144
   <annotation>
145
      </appInfo>
145
      <appInfo>
146
      <documentation>
146
         <meta.section type="examples"/>
147
         Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
147
      </appInfo>
148
All rights reserved. This program and the accompanying materials are made 
148
      <documentation>
149
available under the terms of the Eclipse Public License v1.0 which 
149
         The following is an example of a launch delegate extension point:
150
accompanies this distribution, and is available at 
150
151
&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;
151
&lt;p&gt;
152
      </documentation>
152
&lt;pre&gt;
153
   </annotation>
153
 &lt;extension point=&quot;org.eclipse.debug.core.launchDelegates&quot;&gt;
154
154
  &lt;launchDelegate
155
</schema>
155
   id=&quot;com.example.ExampleProfileDelegate&quot;
156
   delegate=&quot;com.example.ExampleProfileDelegate&quot;
157
   type=&quot;org.eclipse.jdt.launching.localJavaApplication&quot;
158
   modes=&quot;profile&quot;&gt;
159
  &lt;/launchDelegate&gt;
160
 &lt;/extension&gt;
161
&lt;/pre&gt;
162
&lt;/p&gt;
163
164
In the example above, the specified launch delegate is contributed to launch Java applications in profile mode.
165
166
The previous example has been deprecated as of 3.3M3, but left in for brevity. See the following example for new usage.
167
168
&lt;p&gt;
169
&lt;pre&gt;
170
&lt;extension point=&quot;org.eclipse.debug.core.launchDelegates&quot;&gt;
171
      &lt;launchDelegate
172
            delegate=&quot;org.eclipse.jdt.launching.JavaLaunchDelegate&quot;
173
            id=&quot;org.eclipse.jdt.launching.JavaLaunchDelegate&quot;
174
            type=&quot;org.eclipse.jdt.launching.localJavaApplication&quot;
175
      modes=&quot;profile&quot;&gt;
176
      &lt;/launchDelegate&gt;
177
   &lt;/extension&gt;   
178
&lt;/pre&gt;
179
&lt;/p&gt;
180
181
In 3.3 mode-based launching has been deprecated, and in its place we have provided launching with options. Options are contributed via the &lt;code&gt;launchOptions&lt;/code&gt; extension point and can be referenced here to describe what options your launch delegate supports. Options are further arranged in the form of expressions that can be evaluated to determine suitablility of your delegate for a variety of combinations of options.
182
      </documentation>
183
   </annotation>
184
185
   <annotation>
186
      <appInfo>
187
         <meta.section type="apiInfo"/>
188
      </appInfo>
189
      <documentation>
190
         Value of the attribute &lt;b&gt;delegate&lt;/b&gt; must be a fully qualified name of a Java class that implements the interface &lt;b&gt;org.eclipse.debug.core.model.ILaunchConfigurationDelegate&lt;/b&gt;.
191
      </documentation>
192
   </annotation>
193
194
   <annotation>
195
      <appInfo>
196
         <meta.section type="copyright"/>
197
      </appInfo>
198
      <documentation>
199
         Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
200
All rights reserved. This program and the accompanying materials are made 
201
available under the terms of the Eclipse Public License v1.0 which 
202
accompanies this distribution, and is available at 
203
&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;
204
      </documentation>
205
   </annotation>
206
207
</schema>
(-)schema/launchModes.exsd (-134 / +120 lines)
Lines 1-134 Link Here
1
<?xml version='1.0' encoding='UTF-8'?>
1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- Schema file written by PDE -->
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.eclipse.debug.core">
3
<schema targetNamespace="org.eclipse.debug.core">
4
<annotation>
4
<annotation>
5
      <appInfo>
5
      <appInfo>
6
         <meta.schema plugin="org.eclipse.debug.core" id="launchModes" name="Launch Modes"/>
6
         <meta.schema plugin="org.eclipse.debug.core" id="launchModes" name="Launch Modes"/>
7
      </appInfo>
7
      </appInfo>
8
      <documentation>
8
      <documentation>
9
         This extension point provides a mechanism for contributing launch modes to the debug platform. The debug platform defines modes for &quot;run&quot;, &quot;debug&quot;, and &quot;profile&quot;.
9
         This extension point provides a mechanism for contributing launch modes to the debug platform. The debug platform defines modes for &quot;run&quot;, &quot;debug&quot;, and &quot;profile&quot;.
10
      </documentation>
10
      </documentation>
11
   </annotation>
11
   </annotation>
12
12
13
   <element name="extension">
13
   <element name="extension">
14
      <complexType>
14
      <complexType>
15
         <sequence>
15
         <sequence>
16
            <element ref="launchMode" minOccurs="0" maxOccurs="unbounded"/>
16
            <element ref="launchMode" minOccurs="0" maxOccurs="unbounded"/>
17
         </sequence>
17
         </sequence>
18
         <attribute name="point" type="string" use="required">
18
         <attribute name="point" type="string" use="required">
19
            <annotation>
19
            <annotation>
20
               <documentation>
20
               <documentation>
21
                  a fully qualified identifier of the target extension point
21
                  a fully qualified identifier of the target extension point
22
               </documentation>
22
               </documentation>
23
            </annotation>
23
            </annotation>
24
         </attribute>
24
         </attribute>
25
         <attribute name="id" type="string">
25
      </complexType>
26
            <annotation>
26
   </element>
27
               <documentation>
27
28
                  an optional identifier of the extension instance
28
   <element name="launchMode">
29
               </documentation>
29
      <annotation>
30
            </annotation>
30
         <appInfo>
31
         </attribute>
31
            <meta.element labelAttribute="name"/>
32
         <attribute name="name" type="string">
32
         </appInfo>
33
            <annotation>
33
      </annotation>
34
               <documentation>
34
      <complexType>
35
                  an optional name of the extension instance
35
         <sequence>
36
               </documentation>
36
         </sequence>
37
            </annotation>
37
         <attribute name="mode" type="string" use="required">
38
         </attribute>
38
            <annotation>
39
      </complexType>
39
               <documentation>
40
   </element>
40
                  specifies a unique identifier for this launch mode. The launch modes contributed by the debug plaform are &quot;run&quot;, &quot;debug&quot;, and &quot;profile&quot;.
41
41
               </documentation>
42
   <element name="launchMode">
42
            </annotation>
43
      <annotation>
43
         </attribute>
44
         <appInfo>
44
         <attribute name="label" type="string" use="required">
45
            <meta.element labelAttribute="name"/>
45
            <annotation>
46
         </appInfo>
46
               <documentation>
47
      </annotation>
47
                  A human-readable label that describes the launch mode
48
      <complexType>
48
               </documentation>
49
         <sequence>
49
               <appInfo>
50
         </sequence>
50
                  <meta.attribute translatable="true"/>
51
         <attribute name="mode" type="string" use="required">
51
               </appInfo>
52
            <annotation>
52
            </annotation>
53
               <documentation>
53
         </attribute>
54
                  specifies a unique identifier for this launch mode. The launch modes contributed by the debug plaform are &quot;run&quot;, &quot;debug&quot;, and &quot;profile&quot;.
54
         <attribute name="launchAsLabel" type="string">
55
               </documentation>
55
            <annotation>
56
            </annotation>
56
               <documentation>
57
         </attribute>
57
                  A human-readable label to be used in a launch cascade menu. For example &quot;Run As&quot;. This attribute was added in 3.2 to allow the label to be properly externalized. When unspecified, a default label is created via concatenation.
58
         <attribute name="label" type="string" use="required">
58
               </documentation>
59
            <annotation>
59
               <appInfo>
60
               <documentation>
60
                  <meta.attribute translatable="true"/>
61
                  A human-readable label that describes the launch mode
61
               </appInfo>
62
               </documentation>
62
            </annotation>
63
               <appInfo>
63
         </attribute>
64
                  <meta.attribute translatable="true"/>
64
      </complexType>
65
               </appInfo>
65
   </element>
66
            </annotation>
66
67
         </attribute>
67
   <annotation>
68
         <attribute name="launchAsLabel" type="string">
68
      <appInfo>
69
            <annotation>
69
         <meta.section type="since"/>
70
               <documentation>
70
      </appInfo>
71
                  A human-readable label to be used in a launch cascade menu. For example &quot;Run As&quot;. This attribute was added in 3.2 to allow the label to be properly externalized. When unspecified, a default label is created via concatenation.
71
      <documentation>
72
               </documentation>
72
         3.0
73
               <appInfo>
73
      </documentation>
74
                  <meta.attribute translatable="true"/>
74
   </annotation>
75
               </appInfo>
75
76
            </annotation>
76
   <annotation>
77
         </attribute>
77
      <appInfo>
78
      </complexType>
78
         <meta.section type="examples"/>
79
   </element>
79
      </appInfo>
80
80
      <documentation>
81
   <annotation>
81
         The following is an example of a launch delegate extension point:
82
      <appInfo>
82
83
         <meta.section type="since"/>
83
&lt;p&gt;
84
      </appInfo>
84
&lt;pre&gt;
85
      <documentation>
85
 &lt;extension point=&quot;org.eclipse.debug.core.launchModes&quot;&gt;
86
         3.0
86
  &lt;launchMode
87
      </documentation>
87
   mode=&quot;profile&quot;
88
   </annotation>
88
   label=&quot;Profile&quot;&gt;
89
89
  &lt;/launchMode&gt;
90
   <annotation>
90
 &lt;/extension&gt;
91
      <appInfo>
91
&lt;/pre&gt;
92
         <meta.section type="examples"/>
92
&lt;/p&gt;
93
      </appInfo>
93
94
      <documentation>
94
In the example above, the profile launch mode is contributed.
95
         The following is an example of a launch delegate extension point:
95
      </documentation>
96
96
   </annotation>
97
&lt;p&gt;
97
98
&lt;pre&gt;
98
   <annotation>
99
 &lt;extension point=&quot;org.eclipse.debug.core.launchModes&quot;&gt;
99
      <appInfo>
100
  &lt;launchMode
100
         <meta.section type="apiInfo"/>
101
   mode=&quot;profile&quot;
101
      </appInfo>
102
   label=&quot;Profile&quot;&gt;
102
      <documentation>
103
  &lt;/launchMode&gt;
103
         
104
 &lt;/extension&gt;
104
      </documentation>
105
&lt;/pre&gt;
105
   </annotation>
106
&lt;/p&gt;
106
107
107
   <annotation>
108
In the example above, the profile launch mode is contributed.
108
      <appInfo>
109
      </documentation>
109
         <meta.section type="copyright"/>
110
   </annotation>
110
      </appInfo>
111
111
      <documentation>
112
   <annotation>
112
         Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
113
      <appInfo>
113
All rights reserved. This program and the accompanying materials are made 
114
         <meta.section type="apiInfo"/>
114
available under the terms of the Eclipse Public License v1.0 which 
115
      </appInfo>
115
accompanies this distribution, and is available at 
116
      <documentation>
116
&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;
117
         
117
      </documentation>
118
      </documentation>
118
   </annotation>
119
   </annotation>
119
120
120
</schema>
121
   <annotation>
122
      <appInfo>
123
         <meta.section type="copyright"/>
124
      </appInfo>
125
      <documentation>
126
         Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
127
All rights reserved. This program and the accompanying materials are made 
128
available under the terms of the Eclipse Public License v1.0 which 
129
accompanies this distribution, and is available at 
130
&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;
131
      </documentation>
132
   </annotation>
133
134
</schema>
(-)buildnotes_platform-debug.html (-5 / +36 lines)
Lines 20-32 Link Here
20
  <li>deprecated <code>IDebugUIConstants.ATTR_CONSOLE_ENCODING</code>.</li>
20
  <li>deprecated <code>IDebugUIConstants.ATTR_CONSOLE_ENCODING</code>.</li>
21
  <li>added <code>DebugUITools.getLastLaunch(String id)</code> - provides access to the last launch in
21
  <li>added <code>DebugUITools.getLastLaunch(String id)</code> - provides access to the last launch in
22
   each launch group.</li>
22
   each launch group.</li>
23
   <li>Add <code>launchOptions</code> schema -- provides a new mechanism for providing launch options to the launching framework</li>
24
   <li>Added <code>ILaunchOption</code> -- which describes a single contributed launch option within the launch manager</li>
25
   <li>Added <code>ILaunchManager.getLaunchOptions()</code> -- returns and array of all of the <code>ILaunchOptions</code> registered with the launch manager</li>
26
   <li>Added <code>ILaunchManager.getLaunchOption(String id)</code> -- returns the <code>ILaunchOption</code> associated with the given unique id, or <code>null</code></li>
27
</ul>
23
</ul>
28
24
29
<h2>Oct 3, 2006</h2>
25
<h2>Summary of Launch Option conversion changes in 3.3</h2>
26
<ul>
27
<li>Added <code>launchOptions</code> schema -- provides a new mechanism for providing launch options to the launching framework</li>
28
   <li>Added interface/class <code>ILaunchOption</code> -- which describes a single contributed launch option within the launch manager</li>
29
   <li>Added method <code>ILaunchManager.getLaunchOptions()</code> -- returns and array of all of the <code>ILaunchOptions</code> registered with the launch manager</li>
30
   <li>Added method <code>ILaunchManager.getLaunchOption(String id)</code> -- returns the <code>ILaunchOption</code> associated with the given unique id, or <code>null</code></li>
31
   <li>Added interface/class <code>ILaunchOption</code> -- which describes a single contributed launch option within the launch manager</li>
32
   <li>Added method <code>ILaunchConfiguration.getOptions()</code> -- returns the comma seperated listiong of options</li>
33
   <li>Added method <code>ILaunchConfigurationWorkingCopy.setOptions(String[] options)</code> -- allows the options to be set in the launch configuration</li>
34
   <li>Added method <code>ILaunchManager.getLaunchDelegates()</code> -- returns all of the registered launch delegates</li>
35
   <li>Added method <code>ILaunchManager.getLaunchDelegates(String typeid, String mode, String[] options)</code> -- returns the 
36
   list of delegates that apply to the the specifed mode, config type id and options (if any)</li>
37
   <li>Added constant <code>ATTR_LAUNCH_OPTIONS</code> to <code>LaunchConfiguration</code></li>
38
   <li>Added method <code>ILaunchConfigurationType.getContributorName()</code> -- returns the name of the contributor of the type</li>
39
   <li>Added method <code>ILaunchConfigurationType.getImageDescriptorPath()</code> -- returns the path of the image descriptor (if provided)</li>
40
   <li>Added method <code>ILaunchConfigurationType.getDelegate(String mode, String[] options)</code> -- returns the launch delegate for the specified mode and options</li>
41
   <li>Added class <code>ConfigurationElementConstants</code> -- contains common constants for getting child elements of <code>IConfigurationElements</code> 
42
   <li>Added internal method <code>LaunchManager.initializeLaunchDelegates()</code> -- loads the listing of delegates</li>
43
   <li>Added internal method <code>LaunchManager.initializeLaunchOptions()</code> -- loads the listing of launch options</li>
44
   <li>Deprecated method <code>ILaunchConfigurationType.getDelegate(String mode)</code> -- in favour of the new <code>getDelegate(String mode, String[] options) method</code></li>
45
   <li>Deprecated attribute 'delegate' in <code>launchConfigurationTypes</code> schema, in favour of contributing delegates via the <code>launchDelegates</code> extension point</li>
46
   <li>Deprecated attribute 'modes' in <code>launchConfigurationTypes</code> schema, in favour of contributing modes via the <code>launchDelegates</code> extension point</li>
47
   <li>Deprecated attribute 'sourcePathComputerId' in <code>launchConfigurationTypes</code> schema, in favour of contributing it via the <code>launchDelegates</code> extension point</li>
48
   <li>Deprecated attribute 'sourceLocatorId' in <code>launchConfigurationTypes</code> schema, in favour of contributing it via the <code>launchDelegates</code> extension point</li>
49
   <li>Added attrbute 'icon' in <code>launchConfigurationTypes</code> schema, in favour of contributing a seperate extension <code>launchConfigurationTypeImages</code></li>
50
   <li>Added attribute 'name' to the <code>launchDelegates</code> schema, providing a human readable name for the delegate. To be used in duplicate resolution</li>
51
   <li>Added attribute 'options' to the <code>launchDelegates</code> schema, providing the ability to specify launch options that this delegate can support</li>
52
   <li>Added interface/class <code>ILaunchConfigurationTabExtension</code> -- provides a proxy to a contributed tab <code>IConfigurationElement</code> element</li>
53
   <li>Added internal method <code>LauncConfigurationPtresentationManager.initializeContributedTabExtensions</code> -- loads contributed tabs</li>
54
   <li>Added method <code>LaunchConfigurationPresentationManager.createContributedTabs(String groupid)</code> -- lazily creates the tabs for a specified tabgroup id</li>
55
   <li>Added constant <code>EXTENSION_POINT_CONTRIBUTED_LAUNCH_TABS</code> to <code>IDebugUIConstants</code></li>
56
   <li>Added class <code>LaunchConfigurationTabGroupWrapper</code> -- which is used to wrap an existing tab group with its contributed tabs</li>
57
   <li>Deprecated <code>launchConfigurationTypeImages</code> extension point</li>
58
</ul>
59
60
h2>Oct 3, 2006</h2>
30
<h3>Problem Reports Fixed</h3>
61
<h3>Problem Reports Fixed</h3>
31
<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=158760">158760</a>: Warning in latest nightly build and integration build<br>
62
<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=158760">158760</a>: Warning in latest nightly build and integration build<br>
32
63
(-)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/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/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
}

Return to bug 157059