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

Collapse All | Expand All

(-)core/org/eclipse/debug/core/ILaunchManager.java (-2 / +50 lines)
Lines 229-235 Link Here
229
	 * @param optionId the unique id of the launch option
229
	 * @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
230
	 * @return the lauch option associated with ther specified id or <code>null</code> if not found
231
	 * <p>
231
	 * <p>
232
	 * <strong>EXPERIMENTAL</strong>. This ,method has been added as
232
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
233
	 * part of a work in progress. There is no guarantee that this API will
233
	 * 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
234
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
235
	 * without consulting with the Platform/Debug team.
235
	 * without consulting with the Platform/Debug team.
Lines 242-248 Link Here
242
	 * Returns all registered launch options
242
	 * Returns all registered launch options
243
	 * @return all registered launch options
243
	 * @return all registered launch options
244
	 * <p>
244
	 * <p>
245
	 * <strong>EXPERIMENTAL</strong>. This ,method has been added as
245
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
246
	 * part of a work in progress. There is no guarantee that this API will
246
	 * 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
247
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
248
	 * without consulting with the Platform/Debug team.
248
	 * without consulting with the Platform/Debug team.
Lines 252-257 Link Here
252
	public ILaunchOption[] getLaunchOptions();
252
	public ILaunchOption[] getLaunchOptions();
253
	
253
	
254
	/**
254
	/**
255
	 * Returns whether the specified launch option is a valid launch option or not.
256
	 * Validity is based on if the launch option has been contributed via the <code>launchOptions</code>
257
	 * extension point or not.
258
	 * 
259
	 * @param option the name of the specified launch option
260
	 * @return true if the sepcified launch option is valid, false otherwise
261
	 * 
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
	 * @since 3.3
268
	 */
269
	public boolean isValidLaunchOption(String option);
270
	
271
	/**
272
	 * Returns all of the launch delegates. The rturned listing of delegates cannot be directly used to launch,
273
	 * instead the method <code>IlaunchDelegate.getDelegate</code> must be used to acquire an executable form of
274
	 * the delegate, allowing us to maintain lazy loading of the delegates themselves.
275
	 * @return all of the launch delegates
276
	 * @since 3.3
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 ILaunchDelegate[] getLaunchDelegates();
285
	
286
	/** Returns the launch delegates that applies to the specified options for the specified mode and type id
287
	 * @param typeid the <code>ILaunchConfigurationType</code> id
288
	 * @param the mode id
289
	 * @param options the array of options to find the delegate for
290
	 * @return the delegates that apply to the specified launch options for the specified mode and type id
291
	 * 
292
	 * <p>
293
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
294
	 * part of a work in progress. There is no guarantee that this API will
295
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
296
	 * without consulting with the Platform/Debug team.
297
	 * </p>
298
	 * @since 3.3
299
	 */
300
	public ILaunchDelegate[] getLaunchDelegates(String typeid, String mode, String[] options); 
301
	
302
	/**
255
	 * Returns a collection of launch configurations that required migration to be
303
	 * Returns a collection of launch configurations that required migration to be
256
	 * compatible with current tooling.
304
	 * compatible with current tooling.
257
	 * 
305
	 * 
(-)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 List 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/ILaunchConfigurationWorkingCopy.java (+15 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 option the name of the option to set
179
	 * @param set if the option should be set or removed. true adds the option to the listing, false removes it. 
180
	 * 
181
	 * <p>
182
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
183
	 * part of a work in progress. There is no guarantee that this API will
184
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
185
	 * without consulting with the Platform/Debug team.
186
	 * </p>
187
	 * @since 3.3
188
	 */
189
	public void setOption(String option, boolean set);
175
}
190
}
(-)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/internal/core/LaunchManager.java (-115 / +273 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 148-154 Link Here
148
	 * @since 3.2
149
	 * @since 3.2
149
	 */
150
	 */
150
	protected static final IStatus deleteAssociatedLaunchConfigs = new Status(IStatus.INFO, DEBUG_CORE, 225, EMPTY_STRING, null);
151
	protected static final IStatus deleteAssociatedLaunchConfigs = new Status(IStatus.INFO, DEBUG_CORE, 225, EMPTY_STRING, null);
151
    
152
	
152
	
153
	
153
	
154
	/**
154
	/**
Lines 507-523 Link Here
507
	 * @throws IOException if the encoding attempted to be used is not supported
507
	 * @throws IOException if the encoding attempted to be used is not supported
508
	 */
508
	 */
509
	public static String serializeDocument(Document doc) throws TransformerException, IOException {
509
	public static String serializeDocument(Document doc) throws TransformerException, IOException {
510
		ByteArrayOutputStream s= new ByteArrayOutputStream();
510
		ByteArrayOutputStream s = new ByteArrayOutputStream();
511
		
511
		TransformerFactory factory = TransformerFactory.newInstance();
512
		TransformerFactory factory= TransformerFactory.newInstance();
512
		Transformer transformer = factory.newTransformer();
513
		Transformer transformer= factory.newTransformer();
514
		transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
513
		transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
515
		transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
514
		transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
516
		
515
		DOMSource source = new DOMSource(doc);
517
		DOMSource source= new DOMSource(doc);
516
		StreamResult outputTarget = new StreamResult(s);
518
		StreamResult outputTarget= new StreamResult(s);
519
		transformer.transform(source, outputTarget);
517
		transformer.transform(source, outputTarget);
520
		
521
		return s.toString("UTF8"); //$NON-NLS-1$			
518
		return s.toString("UTF8"); //$NON-NLS-1$			
522
	}
519
	}
523
	
520
	
Lines 564-573 Link Here
564
	private HashMap fLaunchOptions = null;
561
	private HashMap fLaunchOptions = null;
565
	
562
	
566
	/**
563
	/**
567
	 * List of contributed launch delegates (delegates contributed for existing
564
	 * A map of ILaunchDelegate objects stored by id of delegate, or launch config type
568
	 * launch configuration types).
569
	 */
565
	 */
570
	private List fContributedDelegates = null;
566
	private HashMap fLaunchDelegates = null;
567
	
568
	/**
569
	 * A map of duplicate delegates arranged by config type id
570
	 */
571
	private HashMap fDuplicateDelegates = null;
571
572
572
	/**
573
	/**
573
	 * Collection of launches
574
	 * Collection of launches
Lines 581-587 Link Here
581
	/**
582
	/**
582
	 * Collection of listeners
583
	 * Collection of listeners
583
	 */
584
	 */
584
	private ListenerList fListeners= new ListenerList();
585
	private ListenerList fListeners = new ListenerList();
585
	
586
	
586
	/**
587
	/**
587
	 * Collection of "plural" listeners.
588
	 * Collection of "plural" listeners.
Lines 630-636 Link Here
630
	 * and values are associated configuration elements.
631
	 * and values are associated configuration elements.
631
	 */
632
	 */
632
	private Map sourcePathComputers;
633
	private Map sourcePathComputers;
633
	
634
634
	/**
635
	/**
635
	 * @see ILaunchManager#addLaunch(ILaunch)
636
	 * @see ILaunchManager#addLaunch(ILaunch)
636
	 */
637
	 */
Lines 830-837 Link Here
830
		}
831
		}
831
		Iterator iter = list.iterator();
832
		Iterator iter = list.iterator();
832
		List configs = new ArrayList(list.size());
833
		List configs = new ArrayList(list.size());
834
		IFile file = null;
833
		while (iter.hasNext()) {
835
		while (iter.hasNext()) {
834
			IFile file = (IFile)iter.next();
836
			file = (IFile)iter.next();
835
			configs.add(getLaunchConfiguration(file));
837
			configs.add(getLaunchConfiguration(file));
836
		}
838
		}
837
		return configs;
839
		return configs;
Lines 856-863 Link Here
856
				}
858
				}
857
			};
859
			};
858
			String[] files = directory.list(filter);
860
			String[] files = directory.list(filter);
861
			LaunchConfiguration config = null;
859
			for (int i = 0; i < files.length; i++) {
862
			for (int i = 0; i < files.length; i++) {
860
				LaunchConfiguration config = new LaunchConfiguration(containerPath.append(files[i]));
863
				config = new LaunchConfiguration(containerPath.append(files[i]));
861
				configs.add(config);
864
				configs.add(config);
862
			}
865
			}
863
		}
866
		}
Lines 893-905 Link Here
893
				try {
896
				try {
894
					index = Integer.parseInt(trailer);
897
					index = Integer.parseInt(trailer);
895
					baseName = baseName.substring(0, copyIndex);
898
					baseName = baseName.substring(0, copyIndex);
896
				} catch (NumberFormatException nfe) {
899
				} 
897
				}
900
				catch (NumberFormatException nfe) {}
898
			}
901
			}
899
		} 
902
		} 
900
		String newName = baseName;
903
		String newName = baseName;
901
		
904
		
902
		StringBuffer buffer= null;
905
		StringBuffer buffer = null;
903
		while (isExistingLaunchConfigurationName(newName)) {
906
		while (isExistingLaunchConfigurationName(newName)) {
904
			buffer = new StringBuffer(baseName);
907
			buffer = new StringBuffer(baseName);
905
			buffer.append(" ("); //$NON-NLS-1$
908
			buffer.append(" ("); //$NON-NLS-1$
Lines 995-1010 Link Here
995
		List configs = new ArrayList(4);	
998
		List configs = new ArrayList(4);	
996
		NodeList list = root.getChildNodes();
999
		NodeList list = root.getChildNodes();
997
		int length = list.getLength();
1000
		int length = list.getLength();
1001
		Node node = null;
1002
		Element entry = null;
1003
		String memento = null;
998
		for (int i = 0; i < length; ++i) {
1004
		for (int i = 0; i < length; ++i) {
999
			Node node = list.item(i);
1005
			node = list.item(i);
1000
			short type = node.getNodeType();
1006
			short type = node.getNodeType();
1001
			if (type == Node.ELEMENT_NODE) {
1007
			if (type == Node.ELEMENT_NODE) {
1002
				Element entry = (Element) node;
1008
				entry = (Element) node;
1003
				String nodeName = entry.getNodeName();
1009
				if (!entry.getNodeName().equals("launchConfiguration")) { //$NON-NLS-1$
1004
				if (!nodeName.equals("launchConfiguration")) { //$NON-NLS-1$
1005
					throw invalidFormat;
1010
					throw invalidFormat;
1006
				}
1011
				}
1007
				String memento = entry.getAttribute("memento"); //$NON-NLS-1$
1012
				memento = entry.getAttribute("memento"); //$NON-NLS-1$
1008
				if (memento == null) {
1013
				if (memento == null) {
1009
					throw invalidFormat;
1014
					throw invalidFormat;
1010
				}
1015
				}
Lines 1016-1033 Link Here
1016
	
1021
	
1017
	protected ConfigurationNotifier getConfigurationNotifier() {
1022
	protected ConfigurationNotifier getConfigurationNotifier() {
1018
		return new ConfigurationNotifier();
1023
		return new ConfigurationNotifier();
1019
	}	
1024
	}			
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
	
1025
	
1032
	/**
1026
	/**
1033
	 * @see ILaunchManager#getDebugTargets()
1027
	 * @see ILaunchManager#getDebugTargets()
Lines 1036-1044 Link Here
1036
		synchronized (fLaunches) {
1030
		synchronized (fLaunches) {
1037
			List allTargets= new ArrayList(fLaunches.size());
1031
			List allTargets= new ArrayList(fLaunches.size());
1038
			if (fLaunches.size() > 0) {
1032
			if (fLaunches.size() > 0) {
1039
				Iterator e= fLaunches.iterator();
1033
				Iterator e = fLaunches.iterator();
1034
				IDebugTarget[] targets = null;
1040
				while (e.hasNext()) {
1035
				while (e.hasNext()) {
1041
					IDebugTarget[] targets= ((ILaunch) e.next()).getDebugTargets();
1036
					targets = ((ILaunch) e.next()).getDebugTargets();
1042
					for (int i = 0; i < targets.length; i++) {
1037
					for (int i = 0; i < targets.length; i++) {
1043
						allTargets.add(targets[i]);
1038
						allTargets.add(targets[i]);
1044
					}
1039
					}
Lines 1073-1082 Link Here
1073
		if (configEnv == null) {
1068
		if (configEnv == null) {
1074
			return null;
1069
			return null;
1075
		}
1070
		}
1076
		Map env = null;
1071
		Map env = new HashMap();
1077
		// build base environment
1072
		// build base environment
1078
		env= new HashMap();
1073
		boolean append = configuration.getAttribute(ATTR_APPEND_ENVIRONMENT_VARIABLES, true);
1079
		boolean append= configuration.getAttribute(ATTR_APPEND_ENVIRONMENT_VARIABLES, true);
1080
		if (append) {
1074
		if (append) {
1081
			env.putAll(getNativeEnvironmentCasePreserved());
1075
			env.putAll(getNativeEnvironmentCasePreserved());
1082
		}
1076
		}
Lines 1084-1093 Link Here
1084
		// Add variables from config
1078
		// Add variables from config
1085
		Iterator iter= configEnv.entrySet().iterator();
1079
		Iterator iter= configEnv.entrySet().iterator();
1086
		boolean win32= Platform.getOS().equals(Constants.OS_WIN32);
1080
		boolean win32= Platform.getOS().equals(Constants.OS_WIN32);
1081
		Map.Entry entry = null;
1082
		String key = null;
1083
		String value = null;
1084
		Object nativeValue = null;
1085
		Iterator envIter = null;
1086
		Map.Entry nativeEntry = null;
1087
		String nativeKey = null;
1087
		while (iter.hasNext()) {
1088
		while (iter.hasNext()) {
1088
			Map.Entry entry= (Map.Entry) iter.next();
1089
			entry = (Map.Entry) iter.next();
1089
			String key= (String) entry.getKey();
1090
			key = (String) entry.getKey();
1090
            String value = (String) entry.getValue();
1091
            value = (String) entry.getValue();
1091
            // translate any string substitution variables
1092
            // translate any string substitution variables
1092
            if (value != null) {
1093
            if (value != null) {
1093
                value = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(value);
1094
                value = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(value);
Lines 1095-1101 Link Here
1095
            boolean added= false;
1096
            boolean added= false;
1096
			if (win32) {
1097
			if (win32) {
1097
                // First, check if the key is an exact match for an existing key.
1098
                // First, check if the key is an exact match for an existing key.
1098
                Object nativeValue= env.get(key);
1099
				nativeValue = env.get(key);
1099
                if (nativeValue != null) {
1100
                if (nativeValue != null) {
1100
                    // If an exact match is found, just replace the value
1101
                    // If an exact match is found, just replace the value
1101
                    env.put(key, value);
1102
                    env.put(key, value);
Lines 1103-1115 Link Here
1103
                    // Win32 vars are case-insensitive. If an exact match isn't found, iterate to
1104
                    // 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),
1105
                    // 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").
1106
                    // but do a case-insensitive comparison (for example, "pAtH" will still override "PATH").
1106
                    Iterator envIter= env.entrySet().iterator();
1107
                    envIter = env.entrySet().iterator();
1107
                    while (envIter.hasNext()) {
1108
                    while (envIter.hasNext()) {
1108
                        Map.Entry nativeEntry = (Map.Entry) envIter.next();
1109
                        nativeEntry = (Map.Entry) envIter.next();
1109
                        String nativeKey= (String) (nativeEntry).getKey();
1110
                        nativeKey = (String) (nativeEntry).getKey();
1110
                        if (nativeKey.equalsIgnoreCase(key)) {
1111
                        if (nativeKey.equalsIgnoreCase(key)) {
1111
                            nativeEntry.setValue(value);
1112
                            nativeEntry.setValue(value);
1112
                            added= true;
1113
                            added = true;
1113
                            break;
1114
                            break;
1114
                        }
1115
                        }
1115
                    }
1116
                    }
Lines 1120-1130 Link Here
1120
            }
1121
            }
1121
		}		
1122
		}		
1122
		
1123
		
1123
		iter= env.entrySet().iterator();
1124
		iter = env.entrySet().iterator();
1124
		List strings= new ArrayList(env.size());
1125
		List strings = new ArrayList(env.size());
1126
		StringBuffer buffer = null;
1125
		while (iter.hasNext()) {
1127
		while (iter.hasNext()) {
1126
			Map.Entry entry = (Map.Entry) iter.next();
1128
			entry = (Map.Entry) iter.next();
1127
			StringBuffer buffer= new StringBuffer((String) entry.getKey());
1129
			buffer = new StringBuffer((String) entry.getKey());
1128
			buffer.append('=').append((String) entry.getValue());
1130
			buffer.append('=').append((String) entry.getValue());
1129
			strings.add(buffer.toString());
1131
			strings.add(buffer.toString());
1130
		}
1132
		}
Lines 1215-1222 Link Here
1215
	public ILaunchConfiguration[] getLaunchConfigurations(ILaunchConfigurationType type) throws CoreException {
1217
	public ILaunchConfiguration[] getLaunchConfigurations(ILaunchConfigurationType type) throws CoreException {
1216
		Iterator iter = getAllLaunchConfigurations().iterator();
1218
		Iterator iter = getAllLaunchConfigurations().iterator();
1217
		List configs = new ArrayList();
1219
		List configs = new ArrayList();
1220
		ILaunchConfiguration config = null;
1218
		while (iter.hasNext()) {
1221
		while (iter.hasNext()) {
1219
			ILaunchConfiguration config = (ILaunchConfiguration)iter.next();
1222
			config = (ILaunchConfiguration)iter.next();
1220
			if (config.getType().equals(type)) {
1223
			if (config.getType().equals(type)) {
1221
				configs.add(config);
1224
				configs.add(config);
1222
			}
1225
			}
Lines 1224-1230 Link Here
1224
		return (ILaunchConfiguration[])configs.toArray(new ILaunchConfiguration[configs.size()]);
1227
		return (ILaunchConfiguration[])configs.toArray(new ILaunchConfiguration[configs.size()]);
1225
	}
1228
	}
1226
	
1229
	
1227
	
1228
	/**
1230
	/**
1229
	 * Returns all launch configurations that are stored as resources
1231
	 * Returns all launch configurations that are stored as resources
1230
	 * in the given project.
1232
	 * in the given project.
Lines 1236-1244 Link Here
1236
	protected List getLaunchConfigurations(IProject project) {
1238
	protected List getLaunchConfigurations(IProject project) {
1237
		Iterator iter = getAllLaunchConfigurations().iterator();
1239
		Iterator iter = getAllLaunchConfigurations().iterator();
1238
		List configs = new ArrayList();
1240
		List configs = new ArrayList();
1241
		ILaunchConfiguration config = null;
1242
		IFile file = null;
1239
		while (iter.hasNext()) {
1243
		while (iter.hasNext()) {
1240
			ILaunchConfiguration config = (ILaunchConfiguration)iter.next();
1244
			config = (ILaunchConfiguration)iter.next();
1241
			IFile file = config.getFile();
1245
			file = config.getFile();
1242
			if (file != null && file.getProject().equals(project)) {
1246
			if (file != null && file.getProject().equals(project)) {
1243
				configs.add(config);
1247
				configs.add(config);
1244
			}
1248
			}
Lines 1276-1282 Link Here
1276
		}
1280
		}
1277
	}
1281
	}
1278
	
1282
	
1279
	/* (non-Javadoc)
1283
	/**)
1280
	 * @see org.eclipse.debug.core.ILaunchManager#getLaunchMode(java.lang.String)
1284
	 * @see org.eclipse.debug.core.ILaunchManager#getLaunchMode(java.lang.String)
1281
	 */
1285
	 */
1282
	public ILaunchMode getLaunchMode(String mode) {
1286
	public ILaunchMode getLaunchMode(String mode) {
Lines 1284-1290 Link Here
1284
		return (ILaunchMode) fLaunchModes.get(mode);
1288
		return (ILaunchMode) fLaunchModes.get(mode);
1285
	}
1289
	}
1286
	
1290
	
1287
	/* (non-Javadoc)
1291
	/**
1288
	 * @see org.eclipse.debug.core.ILaunchManager#getLaunchModes()
1292
	 * @see org.eclipse.debug.core.ILaunchManager#getLaunchModes()
1289
	 */
1293
	 */
1290
	public ILaunchMode[] getLaunchModes() {
1294
	public ILaunchMode[] getLaunchModes() {
Lines 1309-1315 Link Here
1309
		Collection col = fLaunchOptions.values();
1313
		Collection col = fLaunchOptions.values();
1310
		return (ILaunchOption[])col.toArray(new ILaunchOption[col.size()]);
1314
		return (ILaunchOption[])col.toArray(new ILaunchOption[col.size()]);
1311
	}
1315
	}
1312
		
1316
	
1317
	/**
1318
	 * @see org.eclipse.debug.core.ILaunchManager#isValidLaunchOption(java.lang.String)
1319
	 */
1320
	public boolean isValidLaunchOption(String option) {
1321
		ILaunchOption op = null;
1322
		for(Iterator iter = fLaunchOptions.keySet().iterator(); iter.hasNext();) {
1323
			op = (ILaunchOption) fLaunchOptions.get(iter.next());
1324
			if(op.getOption().equals(option)) {
1325
				return true;
1326
			}
1327
		}
1328
		return false;
1329
	}
1330
	
1331
	/**
1332
	 * Initializes the listing of registered launch options. Does no work if the mapping is already populated.
1333
	 * 
1334
	 * <p>
1335
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
1336
	 * part of a work in progress. There is no guarantee that this API will
1337
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
1338
	 * without consulting with the Platform/Debug team.
1339
	 * </p>
1340
	 * @since 3.3  
1341
	 */
1342
	private synchronized void initializeLaunchOptions() {
1343
		if(fLaunchOptions == null) {
1344
			try {
1345
				IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_OPTIONS);
1346
				IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
1347
				fLaunchOptions = new HashMap();
1348
				ILaunchOption option = null;
1349
				for(int i =  0; i < infos.length; i++) {
1350
					option = new LaunchOption(infos[i]);
1351
					fLaunchOptions.put(option.getIdentifier(), option);
1352
				}
1353
			}
1354
			catch(CoreException ce) {DebugPlugin.log(ce);}
1355
		}
1356
	}
1357
	
1358
	/**
1359
	 * @see org.eclipse.debug.core.ILaunchManager#getLaunchDelegates()
1360
	 */
1361
	public ILaunchDelegate[] getLaunchDelegates() {
1362
		initializeLaunchDelegates();
1363
		Collection col = fLaunchDelegates.values();
1364
		return (ILaunchDelegate[]) col.toArray(new ILaunchDelegate[col.size()]);
1365
	}
1366
	
1367
	/**
1368
	 * @see org.eclipse.debug.core.ILaunchManager#getLaunchDelegate(java.lang.String, java.lang.String, java.lang.String[])
1369
	 */
1370
	public ILaunchDelegate[] getLaunchDelegates(String typeid, String mode, String[] options) {
1371
		initializeLaunchDelegates();
1372
		ILaunchDelegate ld = null;
1373
		boolean applies = true;
1374
		ArrayList list = new ArrayList();
1375
		Set doptions = null;
1376
		for(Iterator iter = fLaunchDelegates.keySet().iterator(); iter.hasNext();) {
1377
			ld = (ILaunchDelegate) fLaunchDelegates.get(iter.next());
1378
			doptions = ld.getOptions();
1379
			if(ld.appliesTo(typeid, mode)) {
1380
				if(options != null) {
1381
					if(doptions.size() > 0 & options.length == 0) {
1382
						applies = false;
1383
					}
1384
					for(int i = 0; i < options.length; i++) {
1385
						applies &= doptions.contains(options[i]);
1386
					}
1387
				}
1388
				else if(doptions.size() > 0) {
1389
					applies = false;
1390
				}
1391
				if(applies) {
1392
					list.add(ld);
1393
				}
1394
				applies = true;
1395
			}
1396
		}
1397
		return (ILaunchDelegate[]) list.toArray(new ILaunchDelegate[list.size()]);
1398
	}
1399
	
1400
	/**
1401
	 * Returns the listing of duplicate launch delegates in the form of a <code>HashMap</code>, with the 
1402
	 * object arrangement: 
1403
	 * <p>
1404
	 * <pre>
1405
	 * HashMap<ILaunchConfigurationType, HashMap<string, ILaunchDelegate[]>>
1406
	 * </pre>
1407
	 * </p>
1408
	 * <p>
1409
	 * Where the first map is keyed based on <code>ILaunchConfigurationType</code> ids and the inner map
1410
	 * is keyed by mode.
1411
	 * </p> 
1412
	 * @return the map of <code>ILaunchDelegate</code>s that are in conflict for type, mode and options
1413
	 * 
1414
	 * @since 3.3
1415
	 * 
1416
	 * EXPERIMENTAL
1417
	 */
1418
	public HashMap getDuplicateLaunchDelegates() {
1419
		initializeDuplicateLaunchDelegates();
1420
		return fDuplicateDelegates;
1421
	}
1422
	
1423
	/**
1424
	 * Lazily initializes the listing of duplicate launch delegates
1425
	 * 
1426
	 * @since 3.3
1427
	 * 
1428
	 * EXPERIMENTAL
1429
	 */
1430
	private synchronized void initializeDuplicateLaunchDelegates() {
1431
		if(fDuplicateDelegates == null) {
1432
			fDuplicateDelegates = new HashMap();
1433
			//for each delegate get the delegates[]
1434
			ILaunchDelegate[] delegates = getLaunchDelegates();
1435
			ILaunchDelegate[] dupes = null;
1436
			ILaunchConfigurationType type = null;
1437
			Set modes = null;
1438
			Iterator iter = null;
1439
			Set options = null;
1440
			HashMap tmp = null;
1441
			String mode = null;
1442
			for(int i = 0; i < delegates.length; i++) {
1443
				type = getLaunchConfigurationType(delegates[i].getLaunchConfigurationType());
1444
				options = delegates[i].getOptions();
1445
				modes = type.getSupportedModes();
1446
				for(iter = modes.iterator(); iter.hasNext();) {
1447
					mode = (String) iter.next();
1448
					dupes = getLaunchDelegates(type.getIdentifier(), mode, (String[])options.toArray(new String[options.size()]));
1449
					if(dupes.length > 1) {
1450
						tmp = (HashMap) fDuplicateDelegates.get(type);
1451
						if(tmp == null) {
1452
							tmp = new HashMap(dupes.length);
1453
						}
1454
						tmp.put(mode, dupes);
1455
						fDuplicateDelegates.put(type, tmp);
1456
					}
1457
				}
1458
			}
1459
		}
1460
	}
1461
	
1462
	/**
1463
	 * Initializes the listing of delegates available to the launching framework
1464
	 * 
1465
	 * <p>
1466
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
1467
	 * part of a work in progress. There is no guarantee that this API will
1468
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
1469
	 * without consulting with the Platform/Debug team.
1470
	 * </p>
1471
	 * @since 3.3
1472
	 */
1473
	private synchronized void initializeLaunchDelegates() {
1474
		if(fLaunchDelegates == null) {
1475
			fLaunchDelegates = new HashMap();
1476
			//get all launch delegate contributions
1477
			IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_DELEGATES);
1478
			IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
1479
			ILaunchDelegate delegate = null;
1480
			for(int i = 0; i < infos.length; i++) {
1481
				delegate = new LaunchDelegate(infos[i]);
1482
				fLaunchDelegates.put(delegate.getIdentifier(), delegate);
1483
			}
1484
			//get all delegates from launch configuration type contributions
1485
			extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES);
1486
			infos = extensionPoint.getConfigurationElements();
1487
			for(int i = 0; i < infos.length; i++) {
1488
				//must check to see if delegate is provided in contribution
1489
				if(infos[i].getAttribute("delegate") != null) { //$NON-NLS-1$
1490
					delegate = new LaunchDelegate(infos[i]);
1491
					fLaunchDelegates.put(delegate.getIdentifier(), delegate);
1492
				}
1493
			}
1494
		}
1495
	}
1496
	
1313
	/**
1497
	/**
1314
	 * Returns all launch configurations that are stored locally.
1498
	 * Returns all launch configurations that are stored locally.
1315
	 * 
1499
	 * 
Lines 1397-1405 Link Here
1397
			if (Platform.getOS().equals(Constants.OS_WIN32)) {
1581
			if (Platform.getOS().equals(Constants.OS_WIN32)) {
1398
				fgNativeEnv= new HashMap();
1582
				fgNativeEnv= new HashMap();
1399
				Iterator entries = casePreserved.entrySet().iterator();
1583
				Iterator entries = casePreserved.entrySet().iterator();
1584
				Map.Entry entry = null;
1585
				String key = null;
1400
				while (entries.hasNext()) {
1586
				while (entries.hasNext()) {
1401
					Map.Entry entry = (Entry) entries.next();
1587
					entry = (Entry) entries.next();
1402
					String key = ((String)entry.getKey()).toUpperCase();
1588
					key = ((String)entry.getKey()).toUpperCase();
1403
					fgNativeEnv.put(key, entry.getValue());
1589
					fgNativeEnv.put(key, entry.getValue());
1404
				}
1590
				}
1405
			} else {
1591
			} else {
Lines 1425-1434 Link Here
1425
	 */
1611
	 */
1426
	public IProcess[] getProcesses() {
1612
	public IProcess[] getProcesses() {
1427
		synchronized (fLaunches) {
1613
		synchronized (fLaunches) {
1428
			List allProcesses= new ArrayList(fLaunches.size());
1614
			List allProcesses = new ArrayList(fLaunches.size());
1429
			Iterator e= fLaunches.iterator();
1615
			Iterator e = fLaunches.iterator();
1616
			IProcess[] processes = null;
1430
			while (e.hasNext()) {
1617
			while (e.hasNext()) {
1431
				IProcess[] processes= ((ILaunch) e.next()).getProcesses();
1618
				processes = ((ILaunch) e.next()).getProcesses();
1432
				for (int i= 0; i < processes.length; i++) {
1619
				for (int i= 0; i < processes.length; i++) {
1433
					allProcesses.add(processes[i]);
1620
					allProcesses.add(processes[i]);
1434
				}
1621
				}
Lines 1494-1502 Link Here
1494
			IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_COMPARATORS);
1681
			IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_COMPARATORS);
1495
			IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
1682
			IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
1496
			fComparators = new HashMap(infos.length);
1683
			fComparators = new HashMap(infos.length);
1684
			IConfigurationElement configurationElement = null;
1685
			String attr = null;
1497
			for (int i= 0; i < infos.length; i++) {
1686
			for (int i= 0; i < infos.length; i++) {
1498
				IConfigurationElement configurationElement = infos[i];
1687
				configurationElement = infos[i];
1499
				String attr = configurationElement.getAttribute("attribute"); //$NON-NLS-1$			
1688
				attr = configurationElement.getAttribute("attribute"); //$NON-NLS-1$			
1500
				if (attr != null) {
1689
				if (attr != null) {
1501
					fComparators.put(attr, new LaunchConfigurationComparator(configurationElement));
1690
					fComparators.put(attr, new LaunchConfigurationComparator(configurationElement));
1502
				} else {
1691
				} else {
Lines 1508-1539 Link Here
1508
			}
1697
			}
1509
		}
1698
		}
1510
	}
1699
	}
1511
	
1700
1512
	/**
1701
	/**
1513
	 * Initializes contributed launch delegates (i.e. delegates contributed
1702
	 * Initializes the listing of <code>LaunchConfigurationType</code>s.
1514
	 * to an existing launch configuration type).
1515
	 */
1703
	 */
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() {
1704
	private synchronized void initializeLaunchConfigurationTypes() {
1528
		if (fLaunchConfigurationTypes == null) {
1705
		if (fLaunchConfigurationTypes == null) {
1529
			hookResourceChangeListener();
1706
			hookResourceChangeListener();
1530
			IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES);
1707
			IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES);
1531
			IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
1708
			IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
1532
			fLaunchConfigurationTypes= new ArrayList(infos.length);
1709
			fLaunchConfigurationTypes = new ArrayList(infos.length);
1533
			for (int i= 0; i < infos.length; i++) {
1710
			for (int i= 0; i < infos.length; i++) {		
1534
				IConfigurationElement configurationElement = infos[i];
1711
				fLaunchConfigurationTypes.add(new LaunchConfigurationType(infos[i]));
1535
				LaunchConfigurationType configType = new LaunchConfigurationType(configurationElement); 			
1536
				fLaunchConfigurationTypes.add(configType);
1537
			}
1712
			}
1538
		}
1713
		}
1539
	}
1714
	}
Lines 1543-1548 Link Here
1543
	 * 
1718
	 * 
1544
	 * @exception CoreException if an exception occurs reading
1719
	 * @exception CoreException if an exception occurs reading
1545
	 *  the extensions
1720
	 *  the extensions
1721
	 *  
1546
	 */
1722
	 */
1547
	private synchronized void initializeLaunchModes() {
1723
	private synchronized void initializeLaunchModes() {
1548
		if (fLaunchModes == null) {
1724
		if (fLaunchModes == null) {
Lines 1559-1584 Link Here
1559
			catch (CoreException e) {DebugPlugin.log(e);}
1735
			catch (CoreException e) {DebugPlugin.log(e);}
1560
		}
1736
		}
1561
	}
1737
	}
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
	
1738
	
1583
	/**
1739
	/**
1584
	 * Initializes source container type and source path computer extensions.
1740
	 * 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);
1771
			IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_SOURCE_LOCATORS);
1616
			IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
1772
			IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
1617
			fSourceLocators= new HashMap(infos.length);
1773
			fSourceLocators= new HashMap(infos.length);
1774
			IConfigurationElement configurationElement = null;
1775
			String id = null;
1618
			for (int i= 0; i < infos.length; i++) {
1776
			for (int i= 0; i < infos.length; i++) {
1619
				IConfigurationElement configurationElement = infos[i];
1777
				configurationElement = infos[i];
1620
				String id = configurationElement.getAttribute("id"); //$NON-NLS-1$			
1778
				id = configurationElement.getAttribute("id"); //$NON-NLS-1$			
1621
				if (id != null) {
1779
				if (id != null) {
1622
					fSourceLocators.put(id,configurationElement);
1780
					fSourceLocators.put(id,configurationElement);
1623
				} else {
1781
				} else {
Lines 1812-1819 Link Here
1812
		if (!configs.isEmpty()) {
1970
		if (!configs.isEmpty()) {
1813
			Iterator iterator = configs.iterator();
1971
			Iterator iterator = configs.iterator();
1814
			while (iterator.hasNext()) {
1972
			while (iterator.hasNext()) {
1815
				ILaunchConfiguration configuration = (ILaunchConfiguration)iterator.next();
1973
				launchConfigurationDeleted((ILaunchConfiguration)iterator.next());
1816
				launchConfigurationDeleted(configuration);
1817
			}
1974
			}
1818
		}
1975
		}
1819
		//bug 12134
1976
		//bug 12134
Lines 1832-1839 Link Here
1832
		if (!configs.isEmpty()) {
1989
		if (!configs.isEmpty()) {
1833
			Iterator iterator = configs.iterator();
1990
			Iterator iterator = configs.iterator();
1834
			while (iterator.hasNext()) {
1991
			while (iterator.hasNext()) {
1835
				ILaunchConfiguration config = (ILaunchConfiguration) iterator.next();
1992
				launchConfigurationAdded((ILaunchConfiguration) iterator.next());
1836
				launchConfigurationAdded(config);
1837
			}			
1993
			}			
1838
		}
1994
		}
1839
	}
1995
	}
Lines 1953-1960 Link Here
1953
        fLaunchesListeners = new ListenerList();
2109
        fLaunchesListeners = new ListenerList();
1954
        fLaunchConfigurationListeners = new ListenerList();
2110
        fLaunchConfigurationListeners = new ListenerList();
1955
		ILaunch[] launches = getLaunches();
2111
		ILaunch[] launches = getLaunches();
2112
		ILaunch launch = null;
1956
		for (int i= 0; i < launches.length; i++) {
2113
		for (int i= 0; i < launches.length; i++) {
1957
			ILaunch launch= launches[i];
2114
			launch = launches[i];
1958
			try {
2115
			try {
1959
                if (launch instanceof IDisconnect) {
2116
                if (launch instanceof IDisconnect) {
1960
                    IDisconnect disconnect = (IDisconnect)launch;
2117
                    IDisconnect disconnect = (IDisconnect)launch;
Lines 2014-2021 Link Here
2014
	 */
2171
	 */
2015
	protected void verifyConfigurations(List verify, List valid) {
2172
	protected void verifyConfigurations(List verify, List valid) {
2016
		Iterator configs = verify.iterator();
2173
		Iterator configs = verify.iterator();
2174
		ILaunchConfiguration config = null;
2017
		while (configs.hasNext()) {
2175
		while (configs.hasNext()) {
2018
			ILaunchConfiguration config = (ILaunchConfiguration)configs.next();
2176
			config = (ILaunchConfiguration)configs.next();
2019
			if (isValid(config)) {
2177
			if (isValid(config)) {
2020
				valid.add(config);
2178
				valid.add(config);
2021
			}
2179
			}
(-)core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java (-8 / +23 lines)
Lines 16-22 Link Here
16
import java.io.FileOutputStream;
16
import java.io.FileOutputStream;
17
import java.io.IOException;
17
import java.io.IOException;
18
import java.io.UnsupportedEncodingException;
18
import java.io.UnsupportedEncodingException;
19
import com.ibm.icu.text.MessageFormat;
20
import java.util.ArrayList;
19
import java.util.ArrayList;
21
import java.util.List;
20
import java.util.List;
22
import java.util.Map;
21
import java.util.Map;
Lines 40-45 Link Here
40
import org.eclipse.debug.core.ILaunchConfigurationType;
39
import org.eclipse.debug.core.ILaunchConfigurationType;
41
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
40
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
42
41
42
import com.ibm.icu.text.MessageFormat;
43
43
/**
44
/**
44
 * A working copy launch configuration
45
 * A working copy launch configuration
45
 */
46
 */
Lines 194-200 Link Here
194
		}
195
		}
195
		// write the new file
196
		// write the new file
196
		writeNewFile();
197
		writeNewFile();
197
		resetDirty();
198
		fDirty = false;
198
	}
199
	}
199
200
200
	/**
201
	/**
Lines 350-356 Link Here
350
		LaunchConfigurationInfo info = original.getInfo();
351
		LaunchConfigurationInfo info = original.getInfo();
351
		setInfo(info.getCopy());
352
		setInfo(info.getCopy());
352
		setContainer(original.getContainer());
353
		setContainer(original.getContainer());
353
		resetDirty();
354
		fDirty = false;
354
	}
355
	}
355
	
356
	
356
	/**
357
	/**
Lines 404-413 Link Here
404
	}
405
	}
405
	
406
	
406
	/**
407
	/**
407
	 * Sets this working copy's state to not dirty.
408
	 * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#setOptions(java.lang.String[])
408
	 */
409
	 */
409
	private void resetDirty() {
410
	public void setOption(String option, boolean set) {
410
		fDirty = false;
411
		try {
412
			List options = getOptions();
413
			if(option != null) {
414
				int idx = options.indexOf(option);
415
				if(idx > -1 && !set) {
416
					options.remove(idx);
417
				}
418
				else if(idx < 0 && set) {
419
					options.add(option);
420
				}
421
			}
422
			getInfo().setAttribute(ATTR_LAUNCH_OPTIONS, (options.size() > 0 ? options : null));
423
			setDirty();
424
		} 
425
		catch (CoreException e) {DebugPlugin.log(e);}
411
	}	
426
	}	
412
		
427
		
413
	/**
428
	/**
Lines 574-580 Link Here
574
		}
589
		}
575
		setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_PATHS, paths);
590
		setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_PATHS, paths);
576
		setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_TYPES, types);
591
		setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_TYPES, types);
577
	}//end setResource
592
	}
578
593
579
}//end class
594
}
580
595
(-)core/org/eclipse/debug/internal/core/LaunchConfiguration.java (-6 / +28 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 List getOptions() throws CoreException {
500
		List options = getAttribute(ATTR_LAUNCH_OPTIONS, (List)null); 
501
		return (options != null ? options : new ArrayList(0));
502
	}
503
	
483
	/* (non-Javadoc)
504
	/* (non-Javadoc)
484
	 * @see org.eclipse.debug.core.ILaunchConfiguration#getType()
505
	 * @see org.eclipse.debug.core.ILaunchConfiguration#getType()
485
	 */
506
	 */
Lines 570-576 Link Here
570
     */
591
     */
571
    public ILaunch launch(String mode, IProgressMonitor monitor, boolean build, boolean register) throws CoreException {
592
    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
593
		// bug 28245 - force the delegate to load in case it is interested in launch notifications
573
		ILaunchConfigurationDelegate delegate= getDelegate(mode);
594
    	List options  = getOptions();
595
		ILaunchConfigurationDelegate delegate = getDelegate(mode, (String[]) options.toArray(new String[options.size()]));
574
		ILaunchConfigurationDelegate2 delegate2 = null;
596
		ILaunchConfigurationDelegate2 delegate2 = null;
575
		if (delegate instanceof ILaunchConfigurationDelegate2) {
597
		if (delegate instanceof ILaunchConfigurationDelegate2) {
576
			delegate2 = (ILaunchConfigurationDelegate2) delegate;
598
			delegate2 = (ILaunchConfigurationDelegate2) delegate;
Lines 690-694 Link Here
690
		return getType().supportsMode(mode);
712
		return getType().supportsMode(mode);
691
	}
713
	}
692
	
714
	
693
}//end class
715
}
694
716
(-)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/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
				ILaunchDelegate[] 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].getDelegate();
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
(-)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>
(-)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/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/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>
(-)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/internal/core/ConfigurationElementConstants.java (+119 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2006 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.debug.internal.core;
12
13
/**
14
 * This class provides a repository for the names of <code>IConfigurationElement</code> child node ids.
15
 * @since 3.3
16
 * <p>
17
 * <strong>EXPERIMENTAL</strong>. This class has been added as
18
 * part of a work in progress. There is no guarantee that this API will
19
 * remain unchanged during the 3.3 release cycle. Please do not use this API
20
 * without consulting with the Platform/Debug team.
21
 * </p>
22
 */
23
public class ConfigurationElementConstants {
24
25
	/**
26
	 * The id node name for a configuration element
27
	 */
28
	public static final String ID = "id"; //$NON-NLS-1$
29
	
30
	/**
31
	 * the name node name for a configuration element
32
	 */
33
	public static final String NAME = "name"; //$NON-NLS-1$
34
	
35
	/**
36
	 * the category node name for a configuration element
37
	 */
38
	public static final String CATEGORY = "category"; //$NON-NLS-1$
39
	
40
	/**
41
	 * the launchMode node name for a configuration element
42
	 */
43
	public static final String LAUNCH_MODE = "launchMode"; //$NON-NLS-1$
44
	
45
	/**
46
	 * the description node name for a configuration element
47
	 */
48
	public static final String DESCRIPTION = "description"; //$NON-NLS-1$
49
	
50
	/**
51
	 * the helpContextId node name for a configuration element
52
	 */
53
	public static final String HELP_CONTEXT_ID = "helpContextId"; //$NON-NLS-1$
54
	
55
	/**
56
	 * the icon node name for a configuration element
57
	 */
58
	public static final String ICON = "icon"; //$NON-NLS-1$
59
	
60
	/**
61
	 * the public node name for a configuration element
62
	 */
63
	public static final String PUBLIC = "public"; //$NON-NLS-1$
64
	
65
	/**
66
	 * the perspective node name for a configuration element
67
	 */
68
	public static final String PERSPECTIVE = "perspective"; //$NON-NLS-1$
69
	
70
	/**
71
	 * the modes node name for a configuration element
72
	 */
73
	public static final String MODES = "modes"; //$NON-NLS-1$
74
	
75
	/**
76
	 * the mode node name for a configuration element
77
	 */
78
	public static final String MODE = "mode"; //$NON-NLS-1$
79
	
80
	/**
81
	 * the type node name for a configuration element
82
	 */
83
	public static final String TYPE = "type"; //$NON-NLS-1$
84
	
85
	/**
86
	 * the option node name for a configuration element
87
	 */
88
	public static final String OPTIONS = "options"; //$NON-NLS-1$
89
	
90
	/**
91
	 * the delegate node name for a configuration element
92
	 */
93
	public static final String DELEGATE = "delegate"; //$NON-NLS-1$
94
	
95
	/**
96
	 * the group node name for a configuration element
97
	 */
98
	public static final String GROUP = "group"; //$NON-NLS-1$
99
	
100
	/**
101
	 * the class node name for a configuration element
102
	 */
103
	public static final String CLASS = "class"; //$NON-NLS-1$
104
	
105
	/**
106
	 * the sourcePathComputerId node name for a configuration element
107
	 */
108
	public static final String SOURCE_PATH_COMPUTER = "sourcePathComputerId"; //$NON-NLS-1$
109
	
110
	/**
111
	 * the sourceLocatorId node name for a configuration element
112
	 */
113
	public static final String SOURCE_LOCATOR = "sourceLocatorId"; //$NON-NLS-1$
114
	
115
	/**
116
	 * the migrationDelegate node name for a configuration element
117
	 */
118
	public static final String MIGRATION_DELEGATE = "migrationDelegate";  //$NON-NLS-1$
119
}
(-)core/org/eclipse/debug/core/ILaunchDelegate.java (+97 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2006 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.debug.core;
12
13
import java.util.Set;
14
15
import org.eclipse.core.runtime.CoreException;
16
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
17
18
/**
19
 * This interface describes a launch delegate
20
 * Clients can contribute launch delegate through the <code>launchDelegates</code> extension point
21
 * 
22
 * Example contribution of the local java launch delegate
23
 * <pre>
24
 * <launchDelegate
25
            delegate="org.eclipse.jdt.launching.JavaLaunchDelegate"
26
            id="org.eclipse.jdt.launching.JavaLaunchDelegate">
27
         <appliesTo
28
               type="org.eclipse.jdt.launching.localJavaApplication">
29
            <option
30
                  option="debug">
31
            </option>
32
         </appliesTo>
33
      </launchDelegate>
34
 * </pre>
35
 * 
36
 * Clients are NOT intended to implement this interface
37
 * @since 3.3
38
 */
39
public interface ILaunchDelegate {
40
41
	/**
42
	 * @return returns the unique id of the delegate
43
	 */
44
	public String getIdentifier();
45
	
46
	/**
47
	 * @return the launch delegate
48
	 */
49
	public ILaunchConfigurationDelegate getDelegate() throws CoreException;
50
	
51
	/**
52
	 * One delegate definition can now be associated with more than on launch configuration type.
53
	 * In this case we need to return them all. In the deprecated case when one delegate is associated
54
	 * with one type, we only need return the one (a set of only one element)
55
	 * @return the set of associated launch configuration type ids (String) or the empty set, never <code>null</code>
56
	 */
57
	public String getLaunchConfigurationType();
58
	
59
	/**
60
	 * @return the associated source locator id or <code>null</code> if not provided
61
	 */
62
	public String getSourceLocatorId();
63
	
64
	/**
65
	 * @return the associated source path computer id or <code>null</code> if not provided
66
	 */
67
	public String getSourcePathComputerId();
68
	
69
	/**
70
	 * @return the options associated with this delegate. If no options are specified an empty set is
71
	 * returned, never <code>null</code>.
72
	 */
73
	public Set getOptions();
74
	
75
	/**
76
	 * This method is provided as a backward compatibility measure to allow access to modes, if mode-based
77
	 * launching is still being used.
78
	 * 
79
	 * @return a set of modes for this delegate or the empty set if none are found, never <code>null</code>.
80
	 */
81
	public Set getModes();
82
	
83
	/**
84
	 * used to determine if the delegate applies to the specified launch configuration type via its id only (no expression evaluation is done)
85
	 * @param configtypeId the id of the <code>ILaunchConfigurationType</code>.
86
	 * @return true if the delegate applies to the associated config type, false otherwise
87
	 */
88
	public boolean appliesTo(String configtypeId);
89
	
90
	/**
91
	 * used to determine if the delegate applies to the specified launch configuration type via its id and mode (no expression evaluation is done)
92
	 * @param configtypeId the id of the <code>ILaunchConfigurationType</code>.
93
	 * @param mode the mode
94
	 * @return true if the delegate applies to the associated config type, false otherwise
95
	 */
96
	public boolean appliesTo(String configtypeId, String mode);
97
}
(-)core/org/eclipse/debug/internal/core/LaunchDelegate.java (+154 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2006 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.debug.internal.core;
12
13
import java.util.HashSet;
14
import java.util.Set;
15
16
import org.eclipse.core.runtime.CoreException;
17
import org.eclipse.core.runtime.IConfigurationElement;
18
import org.eclipse.core.runtime.IStatus;
19
import org.eclipse.core.runtime.Status;
20
import org.eclipse.debug.core.DebugPlugin;
21
import org.eclipse.debug.core.ILaunchDelegate;
22
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
23
24
import com.ibm.icu.text.MessageFormat;
25
26
/**
27
 * Proxy to a launch delegate extension
28
 * 
29
 * @since 3.3
30
 */
31
public class LaunchDelegate implements ILaunchDelegate {
32
	
33
	/**
34
	 * The configuration element for this delegate
35
	 */
36
	private IConfigurationElement fElement = null;
37
	
38
	/**
39
	 * The cached delegate. Remains null until asked for, then persisted
40
	 */
41
	private ILaunchConfigurationDelegate fDelegate = null;
42
	
43
	//lists of cached entries
44
	private HashSet fModes = null;
45
	private HashSet fOptions = null;
46
	private String fType = null;
47
	
48
	/**
49
	 * Constructor
50
	 * @param element the configuration element to associate with this launch delegate
51
	 */
52
	public LaunchDelegate(IConfigurationElement element) {
53
		fElement = element;
54
	}
55
	
56
	/* (non-Javadoc)
57
	 * @see org.eclipse.debug.core.ILaunchDelegate#getDelegate()
58
	 */
59
	public ILaunchConfigurationDelegate getDelegate() throws CoreException {
60
		if(fDelegate == null) {
61
			Object obj = fElement.createExecutableExtension(ConfigurationElementConstants.DELEGATE);
62
			if(obj instanceof ILaunchConfigurationDelegate) {
63
				return (ILaunchConfigurationDelegate)obj;
64
			}
65
			throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_Launch_delegate_for__0__does_not_implement_required_interface_ILaunchConfigurationDelegate__1, new String[]{getIdentifier()}), null));
66
		}
67
		return fDelegate;
68
	}
69
70
	/* (non-Javadoc)
71
	 * @see org.eclipse.debug.core.ILaunchDelegate#getIdentifier()
72
	 */
73
	public String getIdentifier() {
74
		return fElement.getAttribute(ConfigurationElementConstants.ID);
75
	}
76
77
	/* (non-Javadoc)
78
	 * @see org.eclipse.debug.core.ILaunchDelegate#getLaunchConfigurationType()
79
	 */
80
	public String getLaunchConfigurationType() {
81
		if(fType == null) {
82
			//fall back to single association if no appliesTo
83
			fType = fElement.getAttribute(ConfigurationElementConstants.TYPE);
84
			if(fType == null) {
85
				//the case when we have passed a launch configuration type to the launch delegate
86
				fType = fElement.getAttribute(ConfigurationElementConstants.ID);
87
			}
88
		}
89
		return fType;
90
	}
91
92
	/* (non-Javadoc)
93
	 * @see org.eclipse.debug.core.ILaunchDelegate#getOptions()
94
	 */
95
	public Set getOptions() {
96
		if(fOptions == null) {
97
			fOptions = new HashSet();
98
			String option = fElement.getAttribute(ConfigurationElementConstants.OPTIONS);
99
			if(option != null) {
100
				String[] options = option.split(","); //$NON-NLS-1$
101
				for(int i = 0; i < options.length; i++) {
102
					fOptions.add(options[i]);
103
				}
104
			}
105
		}
106
		return fOptions;
107
	}
108
	
109
	/* (non-Javadoc)
110
	 * @see org.eclipse.debug.core.ILaunchDelegate#getModes()
111
	 */
112
	public Set getModes() {
113
		if (fModes == null) {
114
			fModes = new HashSet();
115
			String modes = fElement.getAttribute(ConfigurationElementConstants.MODES); 
116
			if (modes != null) {
117
				String[] strings = modes.split(","); //$NON-NLS-1$
118
				for (int i = 0; i < strings.length; i++) {
119
					fModes.add(strings[i].trim());
120
				}
121
			}
122
		}
123
		return fModes;
124
	}
125
	
126
	/* (non-Javadoc)
127
	 * @see org.eclipse.debug.core.ILaunchDelegate#getSourceLocatorId()
128
	 */
129
	public String getSourceLocatorId() {
130
		return fElement.getAttribute(ConfigurationElementConstants.SOURCE_LOCATOR);
131
	}
132
133
	/* (non-Javadoc)
134
	 * @see org.eclipse.debug.core.ILaunchDelegate#getSourcePathComputerId()
135
	 */
136
	public String getSourcePathComputerId() {
137
		return fElement.getAttribute(ConfigurationElementConstants.SOURCE_PATH_COMPUTER);
138
	}
139
140
	/* (non-Javadoc)
141
	 * @see org.eclipse.debug.core.ILaunchDelegate#appliesTo(java.lang.String)
142
	 */
143
	public boolean appliesTo(String configtypeId) {
144
		return getLaunchConfigurationType().equals(configtypeId);
145
	}
146
	
147
	/* (non-Javadoc)
148
	 * @see org.eclipse.debug.core.ILaunchDelegate#appliesTo(java.lang.String, java.lang.String)
149
	 */
150
	public boolean appliesTo(String configtypeId, String mode) {
151
		return getLaunchConfigurationType().equals(configtypeId) & getModes().contains(mode);
152
	}
153
154
}
(-)plugin.xml (-12 / +33 lines)
Lines 27-57 Link Here
27
   <extension
27
   <extension
28
         point="org.eclipse.debug.core.launchConfigurationTypes">
28
         point="org.eclipse.debug.core.launchConfigurationTypes">
29
      <launchConfigurationType
29
      <launchConfigurationType
30
            delegate="org.eclipse.jdt.launching.JavaLaunchDelegate"
31
            id="org.eclipse.jdt.launching.localJavaApplication"
30
            id="org.eclipse.jdt.launching.localJavaApplication"
32
            migrationDelegate="org.eclipse.jdt.internal.launching.JavaMigrationDelegate"
31
            migrationDelegate="org.eclipse.jdt.internal.launching.JavaMigrationDelegate"
33
            modes="run, debug"
34
            name="%localJavaApplication"
32
            name="%localJavaApplication"
35
            sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"
33
            >
36
            sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer">
37
      </launchConfigurationType>
34
      </launchConfigurationType>
38
      <launchConfigurationType
35
      <launchConfigurationType
39
            delegate="org.eclipse.jdt.internal.launching.JavaRemoteApplicationLaunchConfigurationDelegate"
40
            id="org.eclipse.jdt.launching.remoteJavaApplication"
36
            id="org.eclipse.jdt.launching.remoteJavaApplication"
41
            migrationDelegate="org.eclipse.jdt.internal.launching.JavaMigrationDelegate"
37
            migrationDelegate="org.eclipse.jdt.internal.launching.JavaMigrationDelegate"
42
            modes="debug"
43
            name="%remoteJavaApplication"
38
            name="%remoteJavaApplication"
44
            sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"
39
            >
45
            sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer">
46
      </launchConfigurationType>
40
      </launchConfigurationType>
47
      <launchConfigurationType
41
      <launchConfigurationType
48
            delegate="org.eclipse.jdt.internal.launching.JavaAppletLaunchConfigurationDelegate"
49
            id="org.eclipse.jdt.launching.javaApplet"
42
            id="org.eclipse.jdt.launching.javaApplet"
50
            migrationDelegate="org.eclipse.jdt.internal.launching.JavaMigrationDelegate"
43
            migrationDelegate="org.eclipse.jdt.internal.launching.JavaMigrationDelegate"
51
            modes="run, debug"
52
            name="%appletLabel"
44
            name="%appletLabel"
53
            sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"
45
            >
54
            sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer">
55
      </launchConfigurationType>
46
      </launchConfigurationType>
56
   </extension>
47
   </extension>
57
   <extension
48
   <extension
Lines 189-193 Link Here
189
      	 name= "%jreContainerMarkerProblemName">
180
      	 name= "%jreContainerMarkerProblemName">
190
      <super type="org.eclipse.core.resources.problemmarker"/>
181
      <super type="org.eclipse.core.resources.problemmarker"/>
191
      <persistent value="true"/>
182
      <persistent value="true"/>
183
   </extension>
184
   <extension
185
         point="org.eclipse.debug.core.launchDelegates">
186
      <launchDelegate
187
            delegate="org.eclipse.jdt.launching.JavaLaunchDelegate"
188
            id="org.eclipse.jdt.launching.localJavaApplicationDelegate"
189
            modes="run, debug"
190
            name="%localJavaApplication"
191
            sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"
192
            sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer"
193
            type="org.eclipse.jdt.launching.localJavaApplication">
194
      </launchDelegate>
195
      <launchDelegate
196
            delegate="org.eclipse.jdt.internal.launching.JavaRemoteApplicationLaunchConfigurationDelegate"
197
            id="org.eclipse.jdt.launching.remoteJavaApplicationDelegate"
198
            modes="debug"
199
            name="%remoteJavaApplication"
200
            sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"
201
            sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer"
202
            type="org.eclipse.jdt.launching.remoteJavaApplication">
203
      </launchDelegate>
204
      <launchDelegate
205
            delegate="org.eclipse.jdt.internal.launching.JavaAppletLaunchConfigurationDelegate"
206
            id="org.eclipse.jdt.launching.javaAppletDelegate"
207
            modes="run, debug"
208
            name="%appletLabel"
209
            sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"
210
            sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer"
211
            type="org.eclipse.jdt.launching.javaApplet">
212
      </launchDelegate>
192
   </extension>   
213
   </extension>   
193
</plugin>
214
</plugin>
(-)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 
(-)plugin.properties (+2 lines)
Lines 43-48 Link Here
43
DebugLaunchGroup.title=Select or configure an application to debug
43
DebugLaunchGroup.title=Select or configure an application to debug
44
DebugModelPresentationExtensionName=Debug Model Presentation
44
DebugModelPresentationExtensionName=Debug Model Presentation
45
45
46
LaunchConfigurationTabsExtension.name=Launch Configuration Tabs
47
46
DebugPerspective.name=Debug
48
DebugPerspective.name=Debug
47
DebugPerspective.description=This Debug perspective is designed to support application debugging.  It incorporates views for displaying the debug stack, variables and breakpoint management.
49
DebugPerspective.description=This Debug perspective is designed to support application debugging.  It incorporates views for displaying the debug stack, variables and breakpoint management.
48
50
(-)plugin.xml (+1 lines)
Lines 18-23 Link Here
18
   <extension-point id="memoryRenderings" name="%memoryRenderingsExtensionPointName" schema="schema/memoryRenderings.exsd"/>
18
   <extension-point id="memoryRenderings" name="%memoryRenderingsExtensionPointName" schema="schema/memoryRenderings.exsd"/>
19
   <extension-point id="breakpointOrganizers" name="%BreakpointOrganizersName" schema="schema/breakpointOrganizers.exsd"/>
19
   <extension-point id="breakpointOrganizers" name="%BreakpointOrganizersName" schema="schema/breakpointOrganizers.exsd"/>
20
   <extension-point id="variableValueEditors" name="%VariableValueEditorsName" schema="schema/variableValueEditors.exsd"/>
20
   <extension-point id="variableValueEditors" name="%VariableValueEditorsName" schema="schema/variableValueEditors.exsd"/>
21
   <extension-point id="launchConfigurationTabs" name="%LaunchConfigurationTabsExtension.name" schema="schema/launchConfigurationTabs.exsd"/>
21
22
22
<!-- Extensions -->
23
<!-- Extensions -->
23
   <extension
24
   <extension
(-)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
	 * 
(-)ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java (-11 / +26 lines)
Lines 18-23 Link Here
18
18
19
import org.eclipse.core.runtime.CoreException;
19
import org.eclipse.core.runtime.CoreException;
20
import org.eclipse.core.runtime.IConfigurationElement;
20
import org.eclipse.core.runtime.IConfigurationElement;
21
import org.eclipse.debug.internal.core.ConfigurationElementConstants;
21
import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
22
import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
22
23
23
24
Lines 84-98 Link Here
84
	 */
85
	 */
85
	protected Set getModes() {
86
	protected Set getModes() {
86
		if (fModes == null) {
87
		if (fModes == null) {
87
			IConfigurationElement[] modes= getConfigurationElement().getChildren("launchMode"); //$NON-NLS-1$
88
			IConfigurationElement[] modes= getConfigurationElement().getChildren(ConfigurationElementConstants.LAUNCH_MODE);
88
			if (modes.length > 0) {
89
			if (modes.length > 0) {
89
				fModes = new HashSet(modes.length);
90
				fModes = new HashSet(modes.length);
90
				fPerspectives = new Hashtable(modes.length);
91
				fPerspectives = new Hashtable(modes.length);
92
				IConfigurationElement element = null;
93
				String perspective = null;
94
				String mode = null;
91
				for (int i = 0; i < modes.length; i++) {
95
				for (int i = 0; i < modes.length; i++) {
92
					IConfigurationElement element = modes[i];
96
					element = modes[i];
93
					String mode = element.getAttribute("mode"); //$NON-NLS-1$
97
					mode = element.getAttribute(ConfigurationElementConstants.MODE);
94
					fModes.add(mode);
98
					fModes.add(mode);
95
					String perspective = element.getAttribute("perspective"); //$NON-NLS-1$
99
					perspective = element.getAttribute(ConfigurationElementConstants.PERSPECTIVE);
96
					if (perspective != null) {
100
					if (perspective != null) {
97
						fPerspectives.put(mode, perspective);
101
						fPerspectives.put(mode, perspective);
98
					}
102
					}
Lines 127-133 Link Here
127
	 *  tab group is associated with
131
	 *  tab group is associated with
128
	 */	
132
	 */	
129
	protected String getTypeIdentifier() {
133
	protected String getTypeIdentifier() {
130
		return getConfigurationElement().getAttribute("type"); //$NON-NLS-1$
134
		return getConfigurationElement().getAttribute(ConfigurationElementConstants.TYPE);
131
	}
135
	}
132
	
136
	
133
	/**
137
	/**
Lines 139-145 Link Here
139
	 * @since 2.1
143
	 * @since 2.1
140
	 */	
144
	 */	
141
	protected String getHelpContextId() {
145
	protected String getHelpContextId() {
142
		return getConfigurationElement().getAttribute("helpContextId"); //$NON-NLS-1$		
146
		return getConfigurationElement().getAttribute(ConfigurationElementConstants.HELP_CONTEXT_ID);		
147
	}
148
	
149
	/**
150
	 * Returns the identifier of the tab group
151
	 * @return the id of the tab group
152
	 * 
153
	 * @since 3.3
154
	 */
155
	protected String getIdentifier() {
156
		return getConfigurationElement().getAttribute(ConfigurationElementConstants.ID); 
143
	}
157
	}
144
	
158
	
145
	/**
159
	/**
Lines 150-156 Link Here
150
	 * 	the tab group
164
	 * 	the tab group
151
	 */
165
	 */
152
	public ILaunchConfigurationTabGroup newTabGroup() throws CoreException {
166
	public ILaunchConfigurationTabGroup newTabGroup() throws CoreException {
153
		return (ILaunchConfigurationTabGroup)getConfigurationElement().createExecutableExtension("class"); //$NON-NLS-1$
167
		return (ILaunchConfigurationTabGroup)getConfigurationElement().createExecutableExtension(ConfigurationElementConstants.CLASS); 
154
	}
168
	}
155
169
156
	/**
170
	/**
Lines 163-179 Link Here
163
	public String getDescription(String mode) {
177
	public String getDescription(String mode) {
164
		String description = null;
178
		String description = null;
165
		
179
		
166
		IConfigurationElement[] children = fConfig.getChildren("launchMode"); //$NON-NLS-1$
180
		IConfigurationElement[] children = fConfig.getChildren(ConfigurationElementConstants.LAUNCH_MODE);
167
		if (children!= null && children.length != 0) {
181
		if (children!= null && children.length != 0) {
182
			IConfigurationElement child = null;
168
			for (int i=0; i<children.length; i++) {
183
			for (int i=0; i<children.length; i++) {
169
				IConfigurationElement child = children[i];
184
				child = children[i];
170
				if (child.getAttribute("mode").equals(mode)) { //$NON-NLS-1$
185
				if (child.getAttribute("mode").equals(mode)) { //$NON-NLS-1$
171
					description = child.getAttribute("description"); //$NON-NLS-1$
186
					description = child.getAttribute(ConfigurationElementConstants.DESCRIPTION);
172
				}
187
				}
173
			}
188
			}
174
		} 
189
		} 
175
		if (description == null){
190
		if (description == null){
176
			description = fConfig.getAttribute("description"); //$NON-NLS-1$
191
			description = fConfig.getAttribute(ConfigurationElementConstants.DESCRIPTION);
177
		}
192
		}
178
		
193
		
179
		if (description == null)
194
		if (description == null)
(-)ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java (-1 / +1 lines)
Lines 68-74 Link Here
68
	public void updateButtons() {
68
	public void updateButtons() {
69
		// Launch button
69
		// Launch button
70
		getTabViewer().refresh();
70
		getTabViewer().refresh();
71
		getButton(ID_LAUNCH_BUTTON).setEnabled(getTabViewer().canLaunch());
71
		getButton(ID_LAUNCH_BUTTON).setEnabled(getTabViewer().canLaunch() & getTabViewer().canLaunchWithOptions());
72
		
72
		
73
	}
73
	}
74
		
74
		
(-)ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties (+4 lines)
Lines 46-57 Link Here
46
LaunchConfigurationDialog_An_exception_occurred_while_retrieving_launch_configurations_20=An exception occurred while retrieving launch configurations
46
LaunchConfigurationDialog_An_exception_occurred_while_retrieving_launch_configurations_20=An exception occurred while retrieving launch configurations
47
LaunchConfigurationTabGroupViewer_0={0} is an invalid character in launch configuration name {1}
47
LaunchConfigurationTabGroupViewer_0={0} is an invalid character in launch configuration name {1}
48
LaunchConfigurationTabGroupViewer_1=Configure launch settings from this dialog:
48
LaunchConfigurationTabGroupViewer_1=Configure launch settings from this dialog:
49
LaunchConfigurationTabGroupViewer_10=The selected configuration
50
LaunchConfigurationTabGroupViewer_11=\ cannot be launched with the set of options: 
51
LaunchConfigurationTabGroupViewer_12=\ and 
49
LaunchConfigurationTabGroupViewer_2=- Press the 'New' button to create a configuration of the selected type.
52
LaunchConfigurationTabGroupViewer_2=- Press the 'New' button to create a configuration of the selected type.
50
LaunchConfigurationTabGroupViewer_3=- Edit or view an existing configuration by selecting it.
53
LaunchConfigurationTabGroupViewer_3=- Edit or view an existing configuration by selecting it.
51
LaunchConfigurationTabGroupViewer_4=- Press the 'Delete' button to remove the selected configuration.
54
LaunchConfigurationTabGroupViewer_4=- Press the 'Delete' button to remove the selected configuration.
52
LaunchConfigurationTabGroupViewer_6=- Press the 'Duplicate' button to copy the selected configuration.
55
LaunchConfigurationTabGroupViewer_6=- Press the 'Duplicate' button to copy the selected configuration.
53
LaunchConfigurationTabGroupViewer_5=Configure launch perspective settings from the <a>Perspectives</a> preference page.
56
LaunchConfigurationTabGroupViewer_5=Configure launch perspective settings from the <a>Perspectives</a> preference page.
54
LaunchConfigurationTabGroupViewer_8=- Press the 'Filter' button to configure filtering options.
57
LaunchConfigurationTabGroupViewer_8=- Press the 'Filter' button to configure filtering options.
58
LaunchConfigurationTabGroupViewer_9=Configuration 
55
LaunchConfigurationDialog_Create__manage__and_run_launch_configurations_8=Create, manage, and run configurations
59
LaunchConfigurationDialog_Create__manage__and_run_launch_configurations_8=Create, manage, and run configurations
56
LaunchConfigurationDialog_Dele_te_14=De&lete
60
LaunchConfigurationDialog_Dele_te_14=De&lete
57
LaunchConfigurationDialog_Discard_changes__38=Discard changes?
61
LaunchConfigurationDialog_Discard_changes__38=Discard changes?
(-)ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java (+47 lines)
Lines 11-16 Link Here
11
package org.eclipse.debug.internal.ui.launchConfigurations;
11
package org.eclipse.debug.internal.ui.launchConfigurations;
12
12
13
13
14
import java.util.List;
15
14
import org.eclipse.core.resources.IResource;
16
import org.eclipse.core.resources.IResource;
15
import org.eclipse.core.resources.ResourcesPlugin;
17
import org.eclipse.core.resources.ResourcesPlugin;
16
import org.eclipse.core.runtime.CoreException;
18
import org.eclipse.core.runtime.CoreException;
Lines 958-966 Link Here
958
				return false;
960
				return false;
959
			}
961
			}
960
		}
962
		}
963
		
961
		return true;
964
		return true;
962
	}	
965
	}	
963
	
966
	
967
	
968
	/**
969
	 * <p>
970
	 * <strong>EXPERIMENTAL</strong>. This method has been added as
971
	 * part of a work in progress. There is no guarantee that this API will
972
	 * remain unchanged during the 3.3 release cycle. Please do not use this API
973
	 * without consulting with the Platform/Debug team.
974
	 * </p>
975
	 * @return
976
	 */
977
	public boolean canLaunchWithOptions() {
978
		if(fInitializingTabs) {
979
			return false;
980
		}
981
		//check if selected options exist and that the selected combination can be launched
982
		try {
983
			ILaunchConfigurationWorkingCopy wc = getWorkingCopy();
984
			if(wc != null) {
985
				List options = wc.getOptions();
986
				if(options.size() > 0) {
987
					return DebugPlugin.getDefault().getLaunchManager().getLaunchDelegates(fTabType.getIdentifier(), getLaunchConfigurationDialog().getMode(), (String[]) options.toArray(new String[options.size()])).length > 0;
988
				}
989
			}
990
		} 
991
		catch (CoreException e) {
992
			e.printStackTrace();
993
		}
994
		return true;
995
	}
996
	
964
	/**
997
	/**
965
	 * Returns the current error message or <code>null</code> if none.
998
	 * Returns the current error message or <code>null</code> if none.
966
	 */
999
	 */
Lines 988-993 Link Here
988
			return message;
1021
			return message;
989
		}
1022
		}
990
		
1023
		
1024
	//EXPERIMENTAL
991
		ILaunchConfigurationTab[] allTabs = getTabs();
1025
		ILaunchConfigurationTab[] allTabs = getTabs();
992
		for (int i = 0; i < allTabs.length; i++) {
1026
		for (int i = 0; i < allTabs.length; i++) {
993
			ILaunchConfigurationTab tab = allTabs[i];
1027
			ILaunchConfigurationTab tab = allTabs[i];
Lines 1004-1009 Link Here
1004
				return temp.toString();
1038
				return temp.toString();
1005
			}
1039
			}
1006
		}
1040
		}
1041
		if(!canLaunchWithOptions()) {
1042
			try {
1043
				Object o = getInput();
1044
				String name = null;
1045
				if(o instanceof ILaunchConfiguration) {
1046
					ILaunchConfiguration lc = (ILaunchConfiguration) o;
1047
					name = LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_9+lc.getName();
1048
				}
1049
				return (name == null ? LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_10 : name) + LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_11+getLaunchConfigurationDialog().getMode()+LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_12+getWorkingCopy().getOptions().toString();
1050
			} catch (CoreException e) {
1051
				e.printStackTrace();
1052
			}
1053
		}
1007
		return null;
1054
		return null;
1008
	}	
1055
	}	
1009
	
1056
	
(-)ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java (+8 lines)
Lines 88-93 Link Here
88
	public static String LaunchConfigurationsDialog_Warning_2;
88
	public static String LaunchConfigurationsDialog_Warning_2;
89
	public static String LaunchConfigurationsDialog_Information_3;
89
	public static String LaunchConfigurationsDialog_Information_3;
90
	public static String LaunchConfigurationPresentationManager_No_tab_group_defined_for_launch_configuration_type__0__3;
90
	public static String LaunchConfigurationPresentationManager_No_tab_group_defined_for_launch_configuration_type__0__3;
91
92
	public static String LaunchConfigurationTabGroupViewer_10;
93
94
	public static String LaunchConfigurationTabGroupViewer_11;
95
96
	public static String LaunchConfigurationTabGroupViewer_12;
97
98
	public static String LaunchConfigurationTabGroupViewer_9;
91
	public static String PerspectiveManager_Error_1;
99
	public static String PerspectiveManager_Error_1;
92
	public static String PerspectiveManager_Unable_to_switch_perpsectives_as_specified_by_launch___0__4;
100
	public static String PerspectiveManager_Unable_to_switch_perpsectives_as_specified_by_launch___0__4;
93
	public static String PerspectiveManager_Unable_to_switch_to_perspective___0__2;
101
	public static String PerspectiveManager_Unable_to_switch_to_perspective___0__2;
(-)ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java (-2 / +2 lines)
Lines 518-524 Link Here
518
				IStructuredSelection selection = (IStructuredSelection)fLaunchConfigurationView.getViewer().getSelection();
518
				IStructuredSelection selection = (IStructuredSelection)fLaunchConfigurationView.getViewer().getSelection();
519
				Object target = selection.getFirstElement();
519
				Object target = selection.getFirstElement();
520
				if (target instanceof ILaunchConfiguration) {
520
				if (target instanceof ILaunchConfiguration) {
521
					if (getTabViewer().canLaunch()) {
521
					if (getTabViewer().canLaunch() & getTabViewer().canLaunchWithOptions()) {
522
						handleLaunchPressed();
522
						handleLaunchPressed();
523
					}
523
					}
524
				} else {
524
				} else {
Lines 1420-1426 Link Here
1420
		getDeleteAction().setEnabled(getDeleteAction().isEnabled());
1420
		getDeleteAction().setEnabled(getDeleteAction().isEnabled());
1421
		getDuplicateAction().setEnabled(getDuplicateAction().isEnabled());
1421
		getDuplicateAction().setEnabled(getDuplicateAction().isEnabled());
1422
		getTabViewer().refresh();
1422
		getTabViewer().refresh();
1423
		getButton(ID_LAUNCH_BUTTON).setEnabled(getTabViewer().canLaunch());
1423
		getButton(ID_LAUNCH_BUTTON).setEnabled(getTabViewer().canLaunch() & getTabViewer().canLaunchWithOptions());
1424
	}
1424
	}
1425
1425
1426
	/* (non-Javadoc)
1426
	/* (non-Javadoc)
(-)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
(-)schema/launchConfigurationTabs.exsd (+137 lines)
Added Link Here
1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.eclipse.debug.ui">
4
<annotation>
5
      <appInfo>
6
         <meta.schema plugin="org.eclipse.debug.ui" id="launchConfigurationTabs" name="Launch Configuration Tabs"/>
7
      </appInfo>
8
      <documentation>
9
         This extension point is used to allow developers to contribute launch configuration tabs (one or more) to an existing launch configuration tab group.
10
11
12
&lt;p&gt;&lt;strong&gt;EXPERIMENTAL&lt;/strong&gt;. This method has been added as
13
part of a work in progress. There is no guarantee that this API will
14
remain unchanged during the 3.3 release cycle. Please do not use this API
15
without consulting with the Platform/Debug team.&lt;/p&gt;
16
      </documentation>
17
   </annotation>
18
19
   <element name="extension">
20
      <complexType>
21
         <sequence minOccurs="1" maxOccurs="unbounded">
22
            <element ref="tab"/>
23
         </sequence>
24
         <attribute name="point" type="string" use="required">
25
            <annotation>
26
               <documentation>
27
                  
28
               </documentation>
29
            </annotation>
30
         </attribute>
31
      </complexType>
32
   </element>
33
34
   <element name="tab">
35
      <annotation>
36
         <documentation>
37
            describes an individual launch configuration tab contribution
38
         </documentation>
39
      </annotation>
40
      <complexType>
41
         <attribute name="id" type="string" use="required">
42
            <annotation>
43
               <documentation>
44
                  the unique id of this contributed tab
45
               </documentation>
46
            </annotation>
47
         </attribute>
48
         <attribute name="group" type="string" use="required">
49
            <annotation>
50
               <documentation>
51
                  the string id of the &lt;code&gt;ILaunchConfigurationTabGroup&lt;/code&gt; that this tab should be contributed to
52
               </documentation>
53
            </annotation>
54
         </attribute>
55
         <attribute name="name" type="string" use="required">
56
            <annotation>
57
               <documentation>
58
                  a human readable name for this tab. the prvided name does not have to be the name that you wish to appear on the tab itself. But it should sufficiently describe your tab.
59
               </documentation>
60
            </annotation>
61
         </attribute>
62
         <attribute name="class" type="string" use="required">
63
            <annotation>
64
               <documentation>
65
                  the implementation of your tab
66
               </documentation>
67
               <appInfo>
68
                  <meta.attribute kind="java" basedOn="org.eclipse.debug.ui.ILaunchConfigurationTab"/>
69
               </appInfo>
70
            </annotation>
71
         </attribute>
72
      </complexType>
73
   </element>
74
75
   <annotation>
76
      <appInfo>
77
         <meta.section type="since"/>
78
      </appInfo>
79
      <documentation>
80
         Eclipse 3.3 M3
81
      </documentation>
82
   </annotation>
83
84
   <annotation>
85
      <appInfo>
86
         <meta.section type="examples"/>
87
      </appInfo>
88
      <documentation>
89
         The following example adds the tab &quot;FooTab&quot; to the local java application launch tab group.
90
91
&lt;p&gt;
92
&lt;pre&gt;
93
&lt;extension point=&quot;org.eclipse.debug.ui.launchConfigurationTabs&quot;&gt;
94
    &lt;tab
95
      	class=&quot;org.eclipse.jdt.debug.ui.launchConfigurations.FooTab&quot;
96
        group=&quot;org.eclipse.jdt.debug.ui.launchConfigurationTabGroup.localJavaApplication&quot;
97
        id=&quot;org.eclipse.jdt.debug.ui.fooTab&quot;
98
        name=&quot;Foo Tab&quot;&gt;
99
    &lt;/tab&gt;
100
 &lt;/extension&gt;	
101
&lt;/pre&gt;
102
&lt;/p&gt;
103
      </documentation>
104
   </annotation>
105
106
   <annotation>
107
      <appInfo>
108
         <meta.section type="apiInfo"/>
109
      </appInfo>
110
      <documentation>
111
         [Enter API information here.]
112
      </documentation>
113
   </annotation>
114
115
   <annotation>
116
      <appInfo>
117
         <meta.section type="implementation"/>
118
      </appInfo>
119
      <documentation>
120
         [Enter information about supplied implementation of this extension point.]
121
      </documentation>
122
   </annotation>
123
124
   <annotation>
125
      <appInfo>
126
         <meta.section type="copyright"/>
127
      </appInfo>
128
      <documentation>
129
         Copyright (c) 2006 IBM Corporation and others.&lt;br&gt;
130
All rights reserved. This program and the accompanying materials are made 
131
available under the terms of the Eclipse Public License v1.0 which 
132
accompanies this distribution, and is available at 
133
&lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
134
      </documentation>
135
   </annotation>
136
137
</schema>
(-)ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java (+128 lines)
Added Link Here
1
package org.eclipse.debug.internal.ui.launchConfigurations;
2
3
import org.eclipse.debug.core.ILaunch;
4
import org.eclipse.debug.core.ILaunchConfiguration;
5
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
6
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
7
import org.eclipse.debug.ui.ILaunchConfigurationTab;
8
import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
9
10
/**
11
 * This class is used to wrap a contributed <code>ILaunchConfigurationTabGroup</code> with any contributed tabs
12
 * for that group (from a <code>launchConfigurationTabs</code> extension point).
13
 * 
14
 * <p>
15
 * <strong>EXPERIMENTAL</strong>. This class has been added as
16
 * part of a work in progress. There is no guarantee that this API will
17
 * remain unchanged during the 3.3 release cycle. Please do not use this API
18
 * without consulting with the Platform/Debug team.
19
 * </p>
20
 * @since 3.3
21
 */
22
public class LaunchConfigurationTabGroupWrapper implements ILaunchConfigurationTabGroup {
23
	
24
	private ILaunchConfigurationTabGroup fGroup = null;
25
	private String fGroupId = null;
26
	private ILaunchConfigurationTab[] fContributedTabs = null;
27
	
28
	/**
29
	 * Constructor
30
	 * @param group the existing group to wrapper
31
	 */
32
	public LaunchConfigurationTabGroupWrapper(ILaunchConfigurationTabGroup group, String groupId) {
33
		fGroup = group;
34
		fGroupId = groupId;
35
	}
36
	
37
	/**
38
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String)
39
	 */
40
	public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
41
		if(fGroup != null) {
42
			fGroup.createTabs(dialog, mode);
43
		}
44
	}
45
46
	/**
47
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#dispose()
48
	 */
49
	public void dispose() {
50
		if(fGroup != null) {
51
			fGroup.dispose();
52
		}
53
		if(fContributedTabs != null) {
54
			for(int i = 0; i < fContributedTabs.length; i++) {
55
				fContributedTabs[i].dispose();
56
			}
57
		}
58
	}
59
60
	/**
61
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#getTabs()
62
	 */
63
	public ILaunchConfigurationTab[] getTabs() {
64
		if(fContributedTabs == null) {
65
			fContributedTabs = LaunchConfigurationPresentationManager.getDefault().createContributedTabs(fGroupId);
66
		}
67
		ILaunchConfigurationTab[] grouptabs = fGroup.getTabs();
68
		ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[grouptabs.length + fContributedTabs.length];
69
		System.arraycopy(grouptabs, 0, tabs, 0, grouptabs.length);
70
		System.arraycopy(fContributedTabs, 0, tabs, grouptabs.length, fContributedTabs.length);
71
		return tabs;
72
	}
73
74
	/**
75
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
76
	 */
77
	public void initializeFrom(ILaunchConfiguration configuration) {
78
		if(fGroup != null) {
79
			fGroup.initializeFrom(configuration);
80
		}
81
		if(fContributedTabs == null) {
82
			getTabs();
83
		}
84
		for(int i = 0; i < fContributedTabs.length; i++) {
85
			fContributedTabs[i].initializeFrom(configuration);
86
		}
87
	}
88
89
	/**
90
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#launched(org.eclipse.debug.core.ILaunch)
91
	 */
92
	public void launched(ILaunch launch) {
93
		if(fGroup != null) {
94
			fGroup.launched(launch);
95
		}
96
	}
97
98
	/**
99
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
100
	 */
101
	public void performApply(ILaunchConfigurationWorkingCopy configuration) {
102
		if(fGroup != null) {
103
			fGroup.performApply(configuration);
104
			if(fContributedTabs == null) {
105
				getTabs();
106
			}
107
			for(int i = 0; i < fContributedTabs.length; i++) {
108
				fContributedTabs[i].performApply(configuration);
109
			}
110
		}
111
	}
112
113
	/**
114
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
115
	 */
116
	public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
117
		if(fGroup != null) {
118
			fGroup.setDefaults(configuration);
119
			if(fContributedTabs == null) { 
120
				getTabs();
121
			}
122
			for(int i = 0; i < fContributedTabs.length; i++) {
123
				fContributedTabs[i].setDefaults(configuration);
124
			}
125
		}
126
	}
127
128
}
(-)ui/org/eclipse/debug/ui/ILaunchConfigurationTabExtension.java (+50 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2006 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.debug.ui;
12
13
/**
14
 * Describes a contributed launch configuration tab 
15
 * 
16
 * <p>
17
 * <strong>EXPERIMENTAL</strong>. This method has been added as
18
 * part of a work in progress. There is no guarantee that this API will
19
 * remain unchanged during the 3.3 release cycle. Please do not use this API
20
 * without consulting with the Platform/Debug team.
21
 * </p>
22
 * @since 3.3
23
 */
24
public interface ILaunchConfigurationTabExtension {
25
	
26
	/**
27
	 * Returns the human readable name for the tab, not to be confused with the name that appears on the tab itself
28
	 * @return the name of the tab
29
	 */
30
	public String getName();
31
	
32
	/**
33
	 * Returns the unique id ofthe tab
34
	 * @return the unique id of the tab
35
	 */
36
	public String getIdentifier();
37
	
38
	/**
39
	 * Returns the unique id of the <code>ILaunchConfigurationTabGroup</code> that this tab contributes to
40
	 * @return the id of the <code>ILaunchConfigurationTabGroup</code> this tab conributes to
41
	 */
42
	public String getTabGroupId();
43
	
44
	/**
45
	 * Returns the instantiated class of this tab
46
	 * @return the instantiated class of this tab
47
	 */
48
	public ILaunchConfigurationTab getTab();
49
50
}
(-)ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java (+79 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2006 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.debug.internal.ui;
12
13
import org.eclipse.core.runtime.CoreException;
14
import org.eclipse.core.runtime.IConfigurationElement;
15
import org.eclipse.debug.internal.core.ConfigurationElementConstants;
16
import org.eclipse.debug.ui.ILaunchConfigurationTabExtension;
17
import org.eclipse.debug.ui.ILaunchConfigurationTab;
18
19
/**
20
 * Provides a proxy to a launchConfigurationTabs extension point
21
 * 
22
 * <p>
23
 * <strong>EXPERIMENTAL</strong>. This method has been added as
24
 * part of a work in progress. There is no guarantee that this API will
25
 * remain unchanged during the 3.3 release cycle. Please do not use this API
26
 * without consulting with the Platform/Debug team.
27
 * </p>
28
 * @since 3.3
29
 */
30
public class LaunchConfigurationTabExtension implements ILaunchConfigurationTabExtension {
31
32
	/**
33
	 * The configuration element backing this proxy
34
	 */
35
	IConfigurationElement fElement = null;
36
	
37
	/**
38
	 * Constructor
39
	 * @param element the <code>IConfigurationElement</code> for this proxy
40
	 */
41
	public LaunchConfigurationTabExtension(IConfigurationElement element) {
42
		fElement = element;
43
	}
44
	
45
	/* (non-Javadoc)
46
	 * @see org.eclipse.debug.ui.IContributedLaunchConfigurationTab#getIdentifier()
47
	 */
48
	public String getIdentifier() {
49
		return fElement.getAttribute(ConfigurationElementConstants.ID);
50
	}
51
52
	/* (non-Javadoc)
53
	 * @see org.eclipse.debug.ui.IContributedLaunchConfigurationTab#getName()
54
	 */
55
	public String getName() {
56
		return fElement.getAttribute(ConfigurationElementConstants.NAME);
57
	}
58
59
	/* (non-Javadoc)
60
	 * @see org.eclipse.debug.ui.IContributedLaunchConfigurationTab#getTab()
61
	 */
62
	public ILaunchConfigurationTab getTab() {
63
		try {
64
			Object object = fElement.createExecutableExtension(ConfigurationElementConstants.CLASS);
65
			if(object instanceof ILaunchConfigurationTab) {
66
				return (ILaunchConfigurationTab) object;
67
			}
68
		} catch (CoreException e) {DebugUIPlugin.log(e);}
69
		return null;
70
	}
71
72
	/* (non-Javadoc)
73
	 * @see org.eclipse.debug.ui.IContributedLaunchConfigurationTab#getTabGroupId()
74
	 */
75
	public String getTabGroupId() {
76
		return fElement.getAttribute(ConfigurationElementConstants.GROUP);
77
	}
78
79
}

Return to bug 157059