Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2006-10-18 16:16:20 +0000
committerDarin Wright2006-10-18 16:16:20 +0000
commit5be00964584f5cd17015791e1ac7cb1536215dd8 (patch)
tree1b658443505da14f09655bfbbcaf00f306ffe175
parent49cdb5c1b3eeec778480ec4f00acf9f62e37e007 (diff)
downloadeclipse.platform.debug-5be00964584f5cd17015791e1ac7cb1536215dd8.tar.gz
eclipse.platform.debug-5be00964584f5cd17015791e1ac7cb1536215dd8.tar.xz
eclipse.platform.debug-5be00964584f5cd17015791e1ac7cb1536215dd8.zip
merge with HEAD
-rw-r--r--org.eclipse.debug.core/buildnotes_platform-debug.html55
-rw-r--r--org.eclipse.debug.core/component.xml1
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfiguration.java37
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationType.java68
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java52
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchManager.java14
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchOption.java27
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ContributedDelegate.java145
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java2
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties3
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java68
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java415
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java283
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java55
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java453
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchOption.java54
-rw-r--r--org.eclipse.debug.core/plugin.xml8
-rw-r--r--org.eclipse.debug.core/schema/launchConfigurationTypes.exsd31
-rw-r--r--org.eclipse.debug.core/schema/launchDelegates.exsd56
-rw-r--r--org.eclipse.debug.core/schema/launchModes.exsd14
-rw-r--r--org.eclipse.debug.core/schema/launchOptions.exsd25
21 files changed, 1174 insertions, 692 deletions
diff --git a/org.eclipse.debug.core/buildnotes_platform-debug.html b/org.eclipse.debug.core/buildnotes_platform-debug.html
index 072cf199d..7dacd791e 100644
--- a/org.eclipse.debug.core/buildnotes_platform-debug.html
+++ b/org.eclipse.debug.core/buildnotes_platform-debug.html
@@ -11,22 +11,51 @@
<h2>Summary of API changes in 3.3</h2>
<ul>
- <li>added <code>DebugPlugin.ATTR_CONSOLE_ENCODING</code> - this launch attribute specifies the encoding
- used by the console. When unspecified the default system encoding is used. This constant replaces
- the now deprecated <code>IDebugUIConstants.ATTR_CONSOLE_ENCODING</code>.</li>
- <li>added <code>org.eclipse.debug.ui.actions.IWatchExpressionFactoryAdapterExtension</code> - this is an
- interface that can be optionally implemented by <code>IWatchExpressionFactoryAdapter</code>'s. Allows
- the <b>Create Watch Expression</b> action to be dynamically enabled based on the selected variables.</li>
+ <li>added <code>DebugPlugin.ATTR_CONSOLE_ENCODING</code> - this launch attribute
+ specifies the encoding used by the console. When unspecified the default system
+ encoding is used. This constant replaces the now deprecated <code>IDebugUIConstants.ATTR_CONSOLE_ENCODING</code>.</li>
+ <li>added <code>org.eclipse.debug.ui.actions.IWatchExpressionFactoryAdapterExtension</code>
+ - this is an interface that can be optionally implemented by <code>IWatchExpressionFactoryAdapter</code>'s.
+ Allows the <b>Create Watch Expression</b> action to be dynamically enabled
+ based on the selected variables.</li>
<li>deprecated <code>IDebugUIConstants.ATTR_CONSOLE_ENCODING</code>.</li>
- <li>added <code>DebugUITools.getLastLaunch(String id)</code> - provides access to the last launch in
- each launch group.</li>
- <li>Add <code>launchOptions</code> schema -- provides a new mechanism for providing launch options to the launching framework</li>
- <li>Added <code>ILaunchOption</code> -- which describes a single contributed launch option within the launch manager</li>
- <li>Added <code>ILaunchManager.getLaunchOptions()</code> -- returns and array of all of the <code>ILaunchOptions</code> registered with the launch manager</li>
- <li>Added <code>ILaunchManager.getLaunchOption(String id)</code> -- returns the <code>ILaunchOption</code> associated with the given unique id, or <code>null</code></li>
+ <li>added <code>DebugUITools.getLastLaunch(String id)</code> - provides access
+ to the last launch in each launch group.</li>
</ul>
-<h2>Oct 3, 2006</h2>
+<h2>Summary of Launch Option conversion/changes in 3.3</h2>
+<ul>
+ <li>Added <code>launchOptions</code> schema -- provides a mechanism for contributing
+ launch options</li>
+ <li>Added interface<code>ILaunchOption</code> -- describes a contributed launch
+ option</li>
+ <li>Added method <code>ILaunchManager.getLaunchOptions()</code> -- returns all
+ of the <code>contributed ILaunchOptions</code> </li>
+ <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>
+ <li>Added method <code>ILaunchConfiguration.getOptions()</code> -- returns a
+ configuration's launch options</li>
+ <li>Added method <code>ILaunchConfigurationWorkingCopy.setOptions(String[] options)</code>
+ -- sets a configuration's options</li>
+ <li>Added method <code>ILaunchConfigurationType.getContributorName()</code>
+ -- returns the name of the contributing plug-in </li>
+ <li>Added method <code>ILaunchConfigurationType.getImageDescriptorPath()</code>
+ -- returns path of the image or <code>null</code></li>
+ <li>Added method <code>ILaunchConfigurationType.getDelegate(String mode, Set
+ options)</code> -- returns the launch delegate for the specified mode and
+ options</li>
+ <li>Deprecated method <code>ILaunchConfigurationType.getDelegate(String mode)</code>
+ -- in favour of the new <code>getDelegate(String mode, String[] options) method</code></li>
+ <li>Added attrbute 'icon' in <code>launchConfigurationTypes</code> schema, in
+ favour of contributing a seperate extension <code>launchConfigurationTypeImages</code></li>
+ <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>
+ <li>Added attribute 'options' to the <code>launchDelegates</code> schema, providing
+ the ability to specify launch options that this delegate can support</li>
+ <li>Added constant <code>EXTENSION_POINT_CONTRIBUTED_LAUNCH_TABS</code> to <code>IDebugUIConstants</code></li>
+</ul>
+
+<h2>Oct 3, 2006</h2>
<h3>Problem Reports Fixed</h3>
<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=158760">158760</a>: Warning in latest nightly build and integration build<br>
diff --git a/org.eclipse.debug.core/component.xml b/org.eclipse.debug.core/component.xml
index 3fe9c5c8a..71f9b8953 100644
--- a/org.eclipse.debug.core/component.xml
+++ b/org.eclipse.debug.core/component.xml
@@ -29,6 +29,7 @@
<type name="ILaunchListener" />
<type name="ILaunchManager" implement="false" />
<type name="ILaunchMode" implement="false" />
+ <type name="ILaunchOption" implement="false" />
<type name="ILogicalStructureProvider" />
<type name="ILogicalStructureType" />
<type name="IMemoryBlockListener" />
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfiguration.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfiguration.java
index 836f9a8d6..06504c866 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfiguration.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfiguration.java
@@ -13,6 +13,7 @@ package org.eclipse.debug.core;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
@@ -190,6 +191,27 @@ public interface ILaunchConfiguration extends IAdaptable {
public List getAttribute(String attributeName, List defaultValue) throws CoreException;
/**
+ * Returns the <code>java.util.Set</code>-valued attribute with the given name.
+ * Returns the given default value if the attribute is undefined.
+ *
+ * @param attributeName the name of the attribute
+ * @param defaultValue the value to use if no value is found
+ * @return the value or the default value if no value was found.
+ * @exception CoreException if this method fails. Reasons include:
+ * <ul>
+ * <li>An exception occurs while retrieving the attribute from
+ * underlying storage.</li>
+ * <li>An attribute with the given name exists, but does not
+ * have a List value</li>
+ * </ul>
+ *
+ * @since 3.3
+ *
+ * EXPERIMENTAL
+ */
+ public Set getAttribute(String attributeName, Set defaultValue) throws CoreException;
+
+ /**
* Returns the <code>java.util.Map</code>-valued attribute with the given name.
* Returns the given default value if the attribute is undefined.
*
@@ -304,6 +326,21 @@ public interface ILaunchConfiguration extends IAdaptable {
public String getName();
/**
+ * Returns this configuration's launch options.
+ *
+ * @return this configuration's launch options
+ *
+ * <p>
+ * <strong>EXPERIMENTAL</strong>. This method has been added as
+ * part of a work in progress. There is no guarantee that this API will
+ * remain unchanged during the 3.3 release cycle. Please do not use this API
+ * without consulting with the Platform/Debug team.
+ * </p>
+ * @since 3.3
+ */
+ public Set getOptions() throws CoreException;
+
+ /**
* Returns the type of this launch configuration. This is a
* handle-only method.
*
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationType.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationType.java
index a69f70580..6422ce71d 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationType.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationType.java
@@ -126,10 +126,32 @@ public interface ILaunchConfigurationType extends IAdaptable {
* @exception CoreException if unable to instantiate the
* delegate
* @since 3.0
+ * @deprecated in 3.3 delegates should be acquired using the new
+ * <code>getDelegate(String mode, Set options)</code> method.
+ *
*/
public ILaunchConfigurationDelegate getDelegate(String mode) throws CoreException;
/**
+ * Returns the launch delegate for the specified mode and options.
+ *
+ * @param mode launch mode
+ * @param options launch options
+ * @return the <code>ILaunchConfigurationDelegate</code> for the given mode and options,
+ * or <code>null</code> if none
+ * @throws CoreException
+ * @since 3.3
+ *
+ * <p>
+ * <strong>EXPERIMENTAL</strong>. This method has been added as
+ * part of a work in progress. There is no guarantee that this API will
+ * remain unchanged during the 3.3 release cycle. Please do not use this API
+ * without consulting with the Platform/Debug team.
+ * </p>
+ */
+ public ILaunchConfigurationDelegate getDelegate(String mode, Set options) throws CoreException;
+
+ /**
* Returns the unique identifier for this type of launch configuration
*
* @return the unique identifier for this type of launch configuration
@@ -154,9 +176,12 @@ public interface ILaunchConfigurationType extends IAdaptable {
/**
* Returns the identifier of the persistable source locator registered with
* this launch configurations type, or <code>null</code> if unspecified.
- * Launch configuration types optionally specify this attribute
- * in their plug-in XML via the <code>sourceLocatorId</code> attribute.
- *
+ * A source locator can be specified by a launch configuration type or
+ * launch delegate extension's <code>sourceLocatorId</code> attribute.
+ * <p>
+ * Only one source locator should be provided per launch configuration type
+ * and its launch delegates.
+ * </p>
* @return the identifier of the persistable source locator registered with
* this launch configurations type, or <code>null</code> if unspecified
* @since 3.0
@@ -166,9 +191,12 @@ public interface ILaunchConfigurationType extends IAdaptable {
/**
* Returns the source path computer registered with this launch configuration
* type or <code>null</code> if unspecified. A source path computer can be
- * registered with a launch configuration type in plug-in XML via the
+ * specified by a launch configuration type or launch delegate extension's
* <code>sourcePathComputerId</code> attribute.
- *
+ * <p>
+ * Only one source path computer should be provided per launch configuration type
+ * and its launch delegates.
+ * </p>
* @return the source path computer registered with this launch configuration
* type or <code>null</code> if unspecified
* @since 3.0
@@ -224,4 +252,34 @@ public interface ILaunchConfigurationType extends IAdaptable {
* specified mode
*/
public boolean supportsMode(String mode);
+
+ /**
+ * Returns the name of the plug-in that contributed this launch configuration type.
+ *
+ * @return the name of contributing plug-in
+ * @since 3.3
+ *
+ * <p>
+ * <strong>EXPERIMENTAL</strong>. This method has been added as
+ * part of a work in progress. There is no guarantee that this API will
+ * remain unchanged during the 3.3 release cycle. Please do not use this API
+ * without consulting with the Platform/Debug team.
+ * </p>
+ */
+ public String getContributorName();
+
+ /**
+ * Returns the plug-in relative path of the image for this launch configuration type.
+ *
+ * @return plug-in relative path for image
+ * @since 3.3
+ *
+ * <p>
+ * <strong>EXPERIMENTAL</strong>. This method has been added as
+ * part of a work in progress. There is no guarantee that this API will
+ * remain unchanged during the 3.3 release cycle. Please do not use this API
+ * without consulting with the Platform/Debug team.
+ * </p>
+ */
+ public String getImageDescriptorPath();
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java
index 964cec8bd..7770c4105 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java
@@ -13,6 +13,7 @@ package org.eclipse.debug.core;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
@@ -180,4 +181,55 @@ public interface ILaunchConfigurationWorkingCopy extends ILaunchConfiguration, I
* @since 3.2
*/
public void setMappedResources(IResource[] resources);
+
+ /**
+ * Set the launch options for this configuration.
+ * Over-writes existing launch options.
+ * <p>
+ * If the specified list of options is empty or <code>null</code>,
+ * the 'options' attribute is removed from the launch configuration altogether
+ * </p>
+ * @param new launch options or <code>null</code>
+ *
+ * <p>
+ * <strong>EXPERIMENTAL</strong>. This method has been added as
+ * part of a work in progress. There is no guarantee that this API will
+ * remain unchanged during the 3.3 release cycle. Please do not use this API
+ * without consulting with the Platform/Debug team.
+ * </p>
+ * @since 3.3
+ */
+ public void setOptions(Set options);
+
+ /**
+ * Adds the specified launch options to this configuration's existing options.
+ *
+ * @param options options to append to the current set of options specified
+ * as a set of launch option identifiers
+ *
+ * <p>
+ * <strong>EXPERIMENTAL</strong>. This method has been added as
+ * part of a work in progress. There is no guarantee that this API will
+ * remain unchanged during the 3.3 release cycle. Please do not use this API
+ * without consulting with the Platform/Debug team.
+ * </p>
+ * @since 3.3
+ */
+ public void addOptions(Set options);
+
+ /**
+ * Removes the specified options from this configuration's existing options.
+ *
+ * @param options options to remove specified as a set of launch option
+ * identifiers
+ *
+ * <p>
+ * <strong>EXPERIMENTAL</strong>. This method has been added as
+ * part of a work in progress. There is no guarantee that this API will
+ * remain unchanged during the 3.3 release cycle. Please do not use this API
+ * without consulting with the Platform/Debug team.
+ * </p>
+ * @since 3.3
+ */
+ public void removeOptions(Set options);
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchManager.java
index f6ed55503..9d8196f89 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchManager.java
@@ -225,11 +225,12 @@ public interface ILaunchManager {
public ILaunchMode[] getLaunchModes();
/**
- * Returns the launch option registered with the given id
- * @param optionId the unique id of the launch option
- * @return the lauch option associated with ther specified id or <code>null</code> if not found
+ * Returns the launch option with the given id or <code>null</code>.
+ *
+ * @param optionId launch option identifier
+ * @return the launch option with the given id or <code>null</code>
* <p>
- * <strong>EXPERIMENTAL</strong>. This ,method has been added as
+ * <strong>EXPERIMENTAL</strong>. This method has been added as
* part of a work in progress. There is no guarantee that this API will
* remain unchanged during the 3.3 release cycle. Please do not use this API
* without consulting with the Platform/Debug team.
@@ -239,10 +240,11 @@ public interface ILaunchManager {
public ILaunchOption getLaunchOption(String optionId);
/**
- * Returns all registered launch options
+ * Returns all registered launch options.
+ *
* @return all registered launch options
* <p>
- * <strong>EXPERIMENTAL</strong>. This ,method has been added as
+ * <strong>EXPERIMENTAL</strong>. This method has been added as
* part of a work in progress. There is no guarantee that this API will
* remain unchanged during the 3.3 release cycle. Please do not use this API
* without consulting with the Platform/Debug team.
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchOption.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchOption.java
index edf257178..44a12bd87 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchOption.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchOption.java
@@ -16,18 +16,16 @@ package org.eclipse.debug.core;
*
* Example contribution of the debug launch option:
* <pre>
- * <extension
- point="org.eclipse.debug.core.launchOptions">
- <launchOption
- id="org.eclipse.debug.core.debug"
- label="Debug"
- option="debug">
- </launchOption>
- </extension>
+ * &lt;extension point=&quot;org.eclipse.debug.core.launchOptions&quot;&gt;
+ * &lt;launchOption
+ * id=&quot;org.eclipse.debug.core.debug&quot;
+ * label=&quot;Debug&quot;&gt;
+ * &lt;/launchOption&gt;
+ * &lt;/extension&gt;
* </pre>
- *
- * Clients are NOT intended to implement this interface
* <p>
+ * Clients are <strong>NOT</strong> intended to implement this interface
+ * </p>
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as
* part of a work in progress. There is no guarantee that this API will
* remain unchanged during the 3.3 release cycle. Please do not use this API
@@ -45,14 +43,7 @@ public interface ILaunchOption {
public String getLabel();
/**
- * Returns the launch option defined for this extension. The option is non-translatable, one word and
- * all lowercase.
- * @return the option defined by this extension
- */
- public String getOption();
-
- /**
- * @return the unique id provided for this option e.g. org.eclipse.debug.core.debug
+ * @return the unique id provided for this option e.g. debug
*/
public String getIdentifier();
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ContributedDelegate.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ContributedDelegate.java
deleted file mode 100644
index 33527b0ac..000000000
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ContributedDelegate.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.core;
-
-import com.ibm.icu.text.MessageFormat;
-import java.util.HashSet;
-import java.util.Set;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
-
-/**
- * A placeholder for a launch delegate contributed for a launch mode for an
- * existing launch configuration type.
- */
-public class ContributedDelegate {
-
- /**
- * The configuration element of the extension.
- */
- private IConfigurationElement fElement;
-
- /**
- * Modes this delegate supports.
- */
- private Set fModes;
-
- /**
- * Delegate, or <code>null</code> if not yet instantiated.
- */
- private ILaunchConfigurationDelegate fDelegate;
-
- /**
- * Constructs a new contributed delegate on the
- * given configuration element.
- *
- * @param element configuration element
- */
- protected ContributedDelegate(IConfigurationElement element) {
- setConfigurationElement(element);
- }
-
- /**
- * Sets this delegate's configuration element.
- *
- * @param element this delegate's configuration element
- */
- private void setConfigurationElement(IConfigurationElement element) {
- fElement = element;
- }
-
- /**
- * Returns this delegate's configuration element.
- *
- * @return this delegate's configuration element
- */
- protected IConfigurationElement getConfigurationElement() {
- return fElement;
- }
-
- /**
- * Returns the set of modes specified in the configuration data.
- *
- * @return the set of modes specified in the configuration data
- */
- protected Set getModes() {
- if (fModes == null) {
- String modes= getConfigurationElement().getAttribute("modes"); //$NON-NLS-1$
- if (modes == null) {
- return new HashSet(0);
- }
- String[] strings = modes.split(","); //$NON-NLS-1$
- fModes = new HashSet(3);
- for (int i = 0; i < strings.length; i++) {
- String string = strings[i];
- fModes.add(string.trim());
- }
- }
- return fModes;
- }
-
- /**
- * Returns the type identifier of launch configuration type this delegate is
- * contributed to.
- */
- protected String getLaunchConfigurationType() {
- return getConfigurationElement().getAttribute("type"); //$NON-NLS-1$
- }
-
- protected ILaunchConfigurationDelegate getDelegate() throws CoreException {
- if (fDelegate == null) {
- Object object = getConfigurationElement().createExecutableExtension("delegate"); //$NON-NLS-1$
- if (object instanceof ILaunchConfigurationDelegate) {
- fDelegate = (ILaunchConfigurationDelegate)object;
- } else {
- 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));
- }
- }
- return fDelegate;
- }
-
- /**
- * Returns the identifier of this extension point.
- */
- protected String getIdentifier() {
- return getConfigurationElement().getAttribute("id"); //$NON-NLS-1$
- }
-
- /**
- * Returns the source path computer id specified by this launch delegate
- * or <code>null</code> if none.
- *
- * @return the source path computer id specified by this launch delegate
- * or <code>null</code> if none
- *
- * @since 3.1
- */
- protected String getSourcePathComputerId() {
- return getConfigurationElement().getAttribute("sourcePathComputerId"); //$NON-NLS-1$
- }
-
- /**
- * Returns the source locater id specified by this launch delegate
- * or <code>null</code> if none.
- *
- * @return the source locater id specified by this launch delegate
- * or <code>null</code> if none
- *
- * @since 3.1
- */
- protected String getSourceLocaterId() {
- return getConfigurationElement().getAttribute("sourceLocatorId"); //$NON-NLS-1$
- }
-}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java
index e74950c80..4759d366a 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java
@@ -27,6 +27,8 @@ public class DebugCoreMessages extends NLS {
public static String DebugPlugin_1;
public static String EnvironmentVariableResolver_0;
+ public static String LaunchConfigurationInfo_35;
+
public static String LaunchOption_0;
public static String SystemPropertyResolver_0;
public static String InputStreamMonitor_label;
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties
index 5f409e7e3..eae94f5df 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties
@@ -42,6 +42,7 @@ LaunchConfigurationInfo_Attribute__0__is_not_of_type_java_util_Map__1=Attribute
LaunchConfigurationInfo_Invalid_launch_configuration_XML__10=Invalid launch configuration XML.
LaunchConfigurationInfo_missing_type=Launch configuration type id \"{0}\" does not exist.\nPossible causes:\n\tMissing specification of a launch type (missing plug-in)\n\tIncorrect launch configuration XML
LaunchConfigurationInfo_36=A null key has been specified for an attribute in this launch configuration
+LaunchConfigurationInfo_35=Attribute {0} is not of type java.util.Set.
LaunchConfigurationWorkingCopy__0__occurred_generating_launch_configuration_XML__1={0} occurred generating launch configuration XML.
LaunchConfigurationWorkingCopy_Specified_container_for_launch_configuration_does_not_exist_2=Specified container for launch configuration does not exist
LaunchConfigurationWorkingCopy_5=Unable to save launch configuration.
@@ -63,6 +64,6 @@ RuntimeProcess_terminate_failed=Terminate failed
RuntimeProcess_Exit_value_not_available_until_process_terminates__1=Exit value not available until process terminates.
LaunchConfigurationType_Launch_delegate_for__0__does_not_implement_required_interface_ILaunchConfigurationDelegate__1=Launch delegate for {0} does not implement required interface ILaunchConfigurationDelegate.
LaunchConfigurationType_9=Launch mode {0} not supported for configuration type {1}
-LaunchConfigurationType_10=Launch delegate not registered for configuration type {0}, mode {1}
+LaunchConfigurationType_10=There is no launch delegate registered for configuration type {0}, mode {1}
WatchExpression_0=(Watch expressions not supported)
NullStreamsProxy_0=Null Stream Monitor
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
index 5b9c3082e..1c11df460 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
@@ -13,10 +13,11 @@ package org.eclipse.debug.internal.core;
import java.io.IOException;
import java.io.StringReader;
-import com.ibm.icu.text.MessageFormat;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -44,6 +45,7 @@ import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.IStatusHandler;
import org.eclipse.debug.core.Launch;
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate2;
@@ -55,6 +57,8 @@ import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
+import com.ibm.icu.text.MessageFormat;
+
/**
* Launch configuration handle.
*
@@ -82,6 +86,32 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
public static final String ATTR_MAPPED_RESOURCE_TYPES = DebugPlugin.getUniqueIdentifier() + ".MAPPED_RESOURCE_TYPES"; //$NON-NLS-1$
/**
+ * The listing of applicable launch options for this configuration.
+ *
+ * <p>
+ * <strong>EXPERIMENTAL</strong>. This class has been added as
+ * part of a work in progress. There is no guarantee that this API will
+ * remain unchanged during the 3.3 release cycle. Please do not use this API
+ * without consulting with the Platform/Debug team.
+ * </p>
+ * @since 3.3
+ */
+ public static final String ATTR_LAUNCH_OPTIONS = DebugPlugin.getUniqueIdentifier() + ".LAUNCH_OPTIONS"; //$NON-NLS-1$
+
+ /**
+ * Status handler to prompt in the UI thread
+ *
+ * @since 3.3
+ */
+ protected static final IStatus promptStatus = new Status(IStatus.INFO, "org.eclipse.debug.ui", 200, "", null); //$NON-NLS-1$//$NON-NLS-2$
+
+ /**
+ * Status handler to prompt the user to resolve the missing launch delegate issue
+ * @since 3.3
+ */
+ protected static final IStatus delegateNotAvailable = new Status(IStatus.INFO, "org.eclipse.debug.core", 226, "", null); //$NON-NLS-1$ //$NON-NLS-2$
+
+ /**
* Location this configuration is stored in. This
* is the key for a launch configuration handle.
*/
@@ -271,6 +301,13 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
return getInfo().getListAttribute(attributeName, defaultValue);
}
+ /**
+ * @see org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String, java.util.Set)
+ */
+ public Set getAttribute(String attributeName, Set defaultValue) throws CoreException {
+ return getInfo().getSetAttribute(attributeName, defaultValue);
+ }
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String, java.util.Map)
*/
@@ -320,14 +357,13 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/**
* Returns the launch configuration delegate for this
* launch configuration, for the specified launch mode.
- *
* @param mode launch mode
* @return launch configuration delegate
* @exception CoreException if the delegate was unable
* to be created
*/
- protected ILaunchConfigurationDelegate getDelegate(String mode) throws CoreException {
- return getType().getDelegate(mode);
+ protected ILaunchConfigurationDelegate getDelegate(String mode, Set options) throws CoreException {
+ return getType().getDelegate(mode, options);
}
/* (non-Javadoc)
@@ -480,6 +516,14 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
return getLastLocationSegment();
}
+ /**
+ * @see org.eclipse.debug.core.ILaunchConfiguration#getOptions()
+ */
+ public Set getOptions() throws CoreException {
+ Set options = getAttribute(ATTR_LAUNCH_OPTIONS, (Set)null);
+ return (options != null ? new HashSet(options) : new HashSet(0));
+ }
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#getType()
*/
@@ -570,7 +614,19 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
*/
public ILaunch launch(String mode, IProgressMonitor monitor, boolean build, boolean register) throws CoreException {
// bug 28245 - force the delegate to load in case it is interested in launch notifications
- ILaunchConfigurationDelegate delegate= getDelegate(mode);
+ ILaunchConfigurationDelegate delegate = null;
+ Set options = getOptions();
+ try {
+ delegate = getDelegate(mode, options);
+ }
+ catch(CoreException ce) {
+ IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(promptStatus);
+ handler.handleStatus(delegateNotAvailable, new Object[] {this, mode});
+
+ //retry once the problem has been fixed
+ options = getOptions();
+ delegate = getDelegate(mode, options);
+ }
ILaunchConfigurationDelegate2 delegate2 = null;
if (delegate instanceof ILaunchConfigurationDelegate2) {
delegate2 = (ILaunchConfigurationDelegate2) delegate;
@@ -690,5 +746,5 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
return getType().supportsMode(mode);
}
-}//end class
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java
index 6d79ea01c..adee77533 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java
@@ -12,10 +12,10 @@ package org.eclipse.debug.internal.core;
import java.io.IOException;
-import com.ibm.icu.text.MessageFormat;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -34,18 +34,35 @@ import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
+
+import com.ibm.icu.text.MessageFormat;
/**
- * The information associated with a launch configuration
- * handle.
+ * The information associated with a launch configuration handle.
*/
public class LaunchConfigurationInfo {
-
+
/**
- * This configurations attribute table.
- * Keys are <code>String</code>s and values
- * are one of <code>String</code>, <code>Integer</code>,
- * or <code>Boolean</code>.
+ * Constants fo XML element names and attrbiutes
+ */
+ private static final String KEY = "key"; //$NON-NLS-1$
+ private static final String VALUE = "value"; //$NON-NLS-1$
+ private static final String SET_ENTRY = "setEntry"; //$NON-NLS-1$
+ private static final String LAUNCH_CONFIGURATION = "launchConfiguration"; //$NON-NLS-1$
+ private static final String MAP_ENTRY = "mapEntry"; //$NON-NLS-1$
+ private static final String LIST_ENTRY = "listEntry"; //$NON-NLS-1$
+ private static final String SET_ATTRIBUTE = "setAttribute"; //$NON-NLS-1$
+ private static final String MAP_ATTRIBUTE = "mapAttribute"; //$NON-NLS-1$
+ private static final String LIST_ATTRIBUTE = "listAttribute"; //$NON-NLS-1$
+ private static final String BOOLEAN_ATTRIBUTE = "booleanAttribute"; //$NON-NLS-1$
+ private static final String INT_ATTRIBUTE = "intAttribute"; //$NON-NLS-1$
+ private static final String STRING_ATTRIBUTE = "stringAttribute"; //$NON-NLS-1$
+ private static final String TYPE = "type"; //$NON-NLS-1$
+
+ /**
+ * This configurations attribute table. Keys are <code>String</code>s and
+ * values are one of <code>String</code>, <code>Integer</code>, or
+ * <code>Boolean</code>.
*/
private HashMap fAttributes;
@@ -88,7 +105,8 @@ public class LaunchConfigurationInfo {
/**
* Sets this configuration's attribute table.
*
- * @param table attribute table
+ * @param table
+ * attribute table
*/
private void setAttributeTable(HashMap table) {
fAttributes = table;
@@ -115,13 +133,13 @@ public class LaunchConfigurationInfo {
}
/**
- * Returns the <code>String</code> attribute with the
- * given key or the given default value if undefined.
+ * Returns the <code>String</code> attribute with the given key or the
+ * given default value if undefined.
*
- * @return attribute specified by given key or the defaultValue
- * if undefined
- * @throws CoreException if the attribute with the given key exists
- * but is not a <code>String</code>
+ * @return attribute specified by given key or the defaultValue if undefined
+ * @throws CoreException
+ * if the attribute with the given key exists but is not a
+ * <code>String</code>
*/
protected String getStringAttribute(String key, String defaultValue) throws CoreException {
Object attr = getAttributeTable().get(key);
@@ -140,13 +158,13 @@ public class LaunchConfigurationInfo {
}
/**
- * Returns the <code>int</code> attribute with the
- * given key or the given default value if undefined.
+ * Returns the <code>int</code> attribute with the given key or the given
+ * default value if undefined.
*
- * @return attribute specified by given key or the defaultValue
- * if undefined
- * @throws CoreException if the attribute with the given key exists
- * but is not an <code>int</code>
+ * @return attribute specified by given key or the defaultValue if undefined
+ * @throws CoreException
+ * if the attribute with the given key exists but is not an
+ * <code>int</code>
*/
protected int getIntAttribute(String key, int defaultValue) throws CoreException {
Object attr = getAttributeTable().get(key);
@@ -165,13 +183,13 @@ public class LaunchConfigurationInfo {
}
/**
- * Returns the <code>boolean</code> attribute with the
- * given key or the given default value if undefined.
+ * Returns the <code>boolean</code> attribute with the given key or the
+ * given default value if undefined.
*
- * @return attribute specified by given key or the defaultValue
- * if undefined
- * @throws CoreException if the attribute with the given key exists
- * but is not a <code>boolean</code>
+ * @return attribute specified by given key or the defaultValue if undefined
+ * @throws CoreException
+ * if the attribute with the given key exists but is not a
+ * <code>boolean</code>
*/
protected boolean getBooleanAttribute(String key, boolean defaultValue) throws CoreException {
Object attr = getAttributeTable().get(key);
@@ -190,13 +208,13 @@ public class LaunchConfigurationInfo {
}
/**
- * Returns the <code>java.util.List</code> attribute with the
- * given key or the given default value if undefined.
+ * Returns the <code>java.util.List</code> attribute with the given key or
+ * the given default value if undefined.
*
- * @return attribute specified by given key or the defaultValue
- * if undefined
- * @throws CoreException if the attribute with the given key exists
- * but is not a <code>java.util.List</code>
+ * @return attribute specified by given key or the defaultValue if undefined
+ * @throws CoreException
+ * if the attribute with the given key exists but is not a
+ * <code>java.util.List</code>
*/
protected List getListAttribute(String key, List defaultValue) throws CoreException {
Object attr = getAttributeTable().get(key);
@@ -215,13 +233,40 @@ public class LaunchConfigurationInfo {
}
/**
- * Returns the <code>java.util.Map</code> attribute with the
- * given key or the given default value if undefined.
+ * Returns the <code>java.util.Set</code> attribute with the given key or
+ * the given default value if undefined.
*
- * @return attribute specified by given key or the defaultValue
- * if undefined
- * @throws CoreException if the attribute with the given key exists
- * but is not a <code>java.util.Map</code>
+ * @return attribute specified by given key or the defaultValue if undefined
+ * @throws CoreException
+ * if the attribute with the given key exists but is not a
+ * <code>java.util.Set</code>
+ *
+ * @since 3.3 EXPERIMENTAL
+ */
+ protected Set getSetAttribute(String key, Set defaultValue) throws CoreException {
+ Object attr = getAttributeTable().get(key);
+ if (attr != null) {
+ if (attr instanceof Set) {
+ return (Set)attr;
+ }
+ throw new DebugException(
+ new Status(
+ IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
+ DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_35, new String[] {key}), null
+ )
+ );
+ }
+ return defaultValue;
+ }
+
+ /**
+ * Returns the <code>java.util.Map</code> attribute with the given key or
+ * the given default value if undefined.
+ *
+ * @return attribute specified by given key or the defaultValue if undefined
+ * @throws CoreException
+ * if the attribute with the given key exists but is not a
+ * <code>java.util.Map</code>
*/
protected Map getMapAttribute(String key, Map defaultValue) throws CoreException {
Object attr = getAttributeTable().get(key);
@@ -239,16 +284,17 @@ public class LaunchConfigurationInfo {
return defaultValue;
}
- /**
+ /**
* Sets this configuration's type.
*
- * @param type launch configuration type
+ * @param type
+ * launch configuration type
*/
protected void setType(ILaunchConfigurationType type) {
fType = type;
}
- /**
+ /**
* Returns this configuration's type.
*
* @return launch configuration type
@@ -280,11 +326,13 @@ public class LaunchConfigurationInfo {
}
/**
- * Sets the given attribute to the given value. Only
- * working copy's should use this API.
+ * Sets the given attribute to the given value. Only working copy's should
+ * use this API.
*
- * @param key attribute key
- * @param value attribute value
+ * @param key
+ * attribute key
+ * @param value
+ * attribute value
*/
protected void setAttribute(String key, Object value) {
if (value == null) {
@@ -298,18 +346,22 @@ public class LaunchConfigurationInfo {
* Returns the content of this info as XML
*
* @return the content of this info as XML
- * @throws CoreException if a attribute has been set with a null key
- * @throws IOException if an exception occurs creating the XML
- * @throws ParserConfigurationException if an exception occurs creating the XML
- * @throws TransformerException if an exception occurs creating the XML
+ * @throws CoreException
+ * if a attribute has been set with a null key
+ * @throws IOException
+ * if an exception occurs creating the XML
+ * @throws ParserConfigurationException
+ * if an exception occurs creating the XML
+ * @throws TransformerException
+ * if an exception occurs creating the XML
*/
protected String getAsXML() throws CoreException, IOException, ParserConfigurationException, TransformerException {
Document doc = LaunchManager.getDocument();
- Element configRootElement = doc.createElement("launchConfiguration"); //$NON-NLS-1$
+ Element configRootElement = doc.createElement(LAUNCH_CONFIGURATION);
doc.appendChild(configRootElement);
- configRootElement.setAttribute("type", getType().getIdentifier()); //$NON-NLS-1$
+ configRootElement.setAttribute(TYPE, getType().getIdentifier());
Iterator keys = getAttributeTable().keySet().iterator();
while (keys.hasNext()) {
@@ -330,18 +382,20 @@ public class LaunchConfigurationInfo {
String valueString = null;
if (value instanceof String) {
valueString = (String)value;
- element = createKeyValueElement(doc, "stringAttribute", key, valueString); //$NON-NLS-1$
+ element = createKeyValueElement(doc, STRING_ATTRIBUTE, key, valueString);
} else if (value instanceof Integer) {
valueString = ((Integer)value).toString();
- element = createKeyValueElement(doc, "intAttribute", key, valueString); //$NON-NLS-1$
+ element = createKeyValueElement(doc, INT_ATTRIBUTE, key, valueString);
} else if (value instanceof Boolean) {
valueString = ((Boolean)value).toString();
- element = createKeyValueElement(doc, "booleanAttribute", key, valueString); //$NON-NLS-1$
+ element = createKeyValueElement(doc, BOOLEAN_ATTRIBUTE, key, valueString);
} else if (value instanceof List) {
- element = createListElement(doc, "listAttribute", key, (List)value); //$NON-NLS-1$
+ element = createListElement(doc, LIST_ATTRIBUTE, key, (List)value);
} else if (value instanceof Map) {
- element = createMapElement(doc, "mapAttribute", key, (Map)value); //$NON-NLS-1$
- }
+ element = createMapElement(doc, MAP_ATTRIBUTE, key, (Map)value);
+ } else if(value instanceof Set) {
+ element = createSetElement(doc, SET_ATTRIBUTE, key, (Set)value);
+ }
configRootElement.appendChild(element);
}
@@ -349,51 +403,101 @@ public class LaunchConfigurationInfo {
}
/**
- * Helper method that creates a 'key value' element of the specified type with the
- * specified attribute values.
+ * Helper method that creates a 'key value' element of the specified type
+ * with the specified attribute values.
*/
protected Element createKeyValueElement(Document doc, String elementType, String key, String value) {
Element element = doc.createElement(elementType);
- element.setAttribute("key", key); //$NON-NLS-1$
- element.setAttribute("value", value); //$NON-NLS-1$
+ element.setAttribute(KEY, key);
+ element.setAttribute(VALUE, value);
return element;
}
+ /**
+ * Creates a new <code>Element</code> for the specified
+ * <code>java.util.List</code>
+ *
+ * @param doc the doc to add the element to
+ * @param elementType the type of the element
+ * @param setKey the key for the element
+ * @param list the list to fill the new element with
+ * @return the new element
+ */
protected Element createListElement(Document doc, String elementType, String listKey, List list) {
Element listElement = doc.createElement(elementType);
- listElement.setAttribute("key", listKey); //$NON-NLS-1$
+ listElement.setAttribute(KEY, listKey);
Iterator iterator = list.iterator();
while (iterator.hasNext()) {
String value = (String) iterator.next();
- Element element = doc.createElement("listEntry"); //$NON-NLS-1$
- element.setAttribute("value", value); //$NON-NLS-1$
+ Element element = doc.createElement(LIST_ENTRY);
+ element.setAttribute(VALUE, value);
listElement.appendChild(element);
}
return listElement;
}
+ /**
+ * Creates a new <code>Element</code> for the specified
+ * <code>java.util.Set</code>
+ *
+ * @param doc the doc to add the element to
+ * @param elementType the type of the element
+ * @param setKey the key for the element
+ * @param set the set to fill the new element with
+ * @return the new element
+ *
+ * @since 3.3
+ */
+ protected Element createSetElement(Document doc, String elementType, String setKey, Set set) {
+ Element setElement = doc.createElement(elementType);
+ setElement.setAttribute(KEY, setKey);
+ Element element = null;
+ for(Iterator iter = set.iterator(); iter.hasNext();) {
+ element = doc.createElement(SET_ENTRY);
+ element.setAttribute(VALUE, (String) iter.next());
+ setElement.appendChild(element);
+ }
+ return setElement;
+ }
+
+ /**
+ * Creates a new <code>Element</code> for the specified
+ * <code>java.util.Map</code>
+ *
+ * @param doc the doc to add the element to
+ * @param elementType the type of the element
+ * @param setKey the key for the element
+ * @param map the map to fill the new element with
+ * @return the new element
+ *
+ */
protected Element createMapElement(Document doc, String elementType, String mapKey, Map map) {
Element mapElement = doc.createElement(elementType);
- mapElement.setAttribute("key", mapKey); //$NON-NLS-1$
+ mapElement.setAttribute(KEY, mapKey);
Iterator iterator = map.keySet().iterator();
while (iterator.hasNext()) {
String key = (String) iterator.next();
String value = (String) map.get(key);
- Element element = doc.createElement("mapEntry"); //$NON-NLS-1$
- element.setAttribute("key", key); //$NON-NLS-1$
- element.setAttribute("value", value); //$NON-NLS-1$
+ Element element = doc.createElement(MAP_ENTRY);
+ element.setAttribute(KEY, key);
+ element.setAttribute(VALUE, value);
mapElement.appendChild(element);
}
return mapElement;
}
+ /**
+ * Initializes the mapping of attributes from the XML file
+ * @param root the root node from the XML document
+ * @throws CoreException
+ */
protected void initializeFromXML(Element root) throws CoreException {
- if (!root.getNodeName().equalsIgnoreCase("launchConfiguration")) { //$NON-NLS-1$
+ if (!root.getNodeName().equalsIgnoreCase(LAUNCH_CONFIGURATION)) {
throw getInvalidFormatDebugException();
}
// read type
- String id = root.getAttribute("type"); //$NON-NLS-1$
+ String id = root.getAttribute(TYPE);
if (id == null) {
throw getInvalidFormatDebugException();
}
@@ -410,106 +514,174 @@ public class LaunchConfigurationInfo {
setType(type);
NodeList list = root.getChildNodes();
- int length = list.getLength();
- for (int i = 0; i < length; ++i) {
- Node node = list.item(i);
+ Node node = null;
+ Element element = null;
+ String nodeName = null;
+ for (int i = 0; i < list.getLength(); ++i) {
+ node = list.item(i);
short nodeType = node.getNodeType();
if (nodeType == Node.ELEMENT_NODE) {
- Element element = (Element) node;
- String nodeName = element.getNodeName();
-
- if (nodeName.equalsIgnoreCase("stringAttribute")) { //$NON-NLS-1$
+ element = (Element) node;
+ nodeName = element.getNodeName();
+ if (nodeName.equalsIgnoreCase(STRING_ATTRIBUTE)) {
setStringAttribute(element);
- } else if (nodeName.equalsIgnoreCase("intAttribute")) { //$NON-NLS-1$
+ } else if (nodeName.equalsIgnoreCase(INT_ATTRIBUTE)) {
setIntegerAttribute(element);
- } else if (nodeName.equalsIgnoreCase("booleanAttribute")) { //$NON-NLS-1$
+ } else if (nodeName.equalsIgnoreCase(BOOLEAN_ATTRIBUTE)) {
setBooleanAttribute(element);
- } else if (nodeName.equalsIgnoreCase("listAttribute")) { //$NON-NLS-1$
+ } else if (nodeName.equalsIgnoreCase(LIST_ATTRIBUTE)) {
setListAttribute(element);
- } else if (nodeName.equalsIgnoreCase("mapAttribute")) { //$NON-NLS-1$
+ } else if (nodeName.equalsIgnoreCase(MAP_ATTRIBUTE)) {
setMapAttribute(element);
+ } else if(nodeName.equalsIgnoreCase(SET_ATTRIBUTE)) {
+ setSetAttribute(element);
}
}
}
}
+ /**
+ * Loads a <code>String</code> from the specified element into the local attribute mapping
+ * @param element the element to load from
+ * @throws CoreException
+ */
protected void setStringAttribute(Element element) throws CoreException {
- String key = getKeyAttribute(element);
- String value = getValueAttribute(element);
- setAttribute(key, value);
+ setAttribute(getKeyAttribute(element), getValueAttribute(element));
}
+ /**
+ * Loads an <code>Integer</code> from the specified element into the local attribute mapping
+ * @param element the element to load from
+ * @throws CoreException
+ */
protected void setIntegerAttribute(Element element) throws CoreException {
- String key = getKeyAttribute(element);
- String value = getValueAttribute(element);
- setAttribute(key, new Integer(value));
+ setAttribute(getKeyAttribute(element), new Integer(getValueAttribute(element)));
}
+ /**
+ * Loads a <code>Boolean</code> from the specified element into the local attribute mapping
+ * @param element the element to load from
+ * @throws CoreException
+ */
protected void setBooleanAttribute(Element element) throws CoreException {
- String key = getKeyAttribute(element);
- String value = getValueAttribute(element);
- setAttribute(key, Boolean.valueOf(value));
+ setAttribute(getKeyAttribute(element), Boolean.valueOf(getValueAttribute(element)));
}
+ /**
+ * Reads a <code>List</code> attribute from the specified XML node and
+ * loads it into the mapping of attributes
+ *
+ * @param element the element to read the list attribute from
+ * @throws CoreException if the element has an invalid format
+ */
protected void setListAttribute(Element element) throws CoreException {
- String listKey = element.getAttribute("key"); //$NON-NLS-1$
+ String listKey = element.getAttribute(KEY);
NodeList nodeList = element.getChildNodes();
int entryCount = nodeList.getLength();
List list = new ArrayList(entryCount);
+ Node node = null;
+ Element selement = null;
for (int i = 0; i < entryCount; i++) {
- Node node = nodeList.item(i);
- short type = node.getNodeType();
- if (type == Node.ELEMENT_NODE) {
- Element subElement = (Element) node;
- String nodeName = subElement.getNodeName();
- if (!nodeName.equalsIgnoreCase("listEntry")) { //$NON-NLS-1$
+ node = nodeList.item(i);
+ if (node.getNodeType() == Node.ELEMENT_NODE) {
+ selement = (Element) node;
+ if (!selement.getNodeName().equalsIgnoreCase(LIST_ENTRY)) {
throw getInvalidFormatDebugException();
}
- String value = getValueAttribute(subElement);
- list.add(value);
+ list.add(getValueAttribute(selement));
}
}
setAttribute(listKey, list);
}
+ /**
+ * Reads a <code>Set</code> attribute from the specified XML node and
+ * loads it into the mapping of attributes
+ *
+ * @param element the element to read the set attribute from
+ * @throws CoreException if the element has an invalid format
+ *
+ * @since 3.3
+ */
+ protected void setSetAttribute(Element element) throws CoreException {
+ String setKey = element.getAttribute(KEY);
+ NodeList nodeList = element.getChildNodes();
+ int entryCount = nodeList.getLength();
+ Set set = new HashSet(entryCount);
+ Node node = null;
+ Element selement = null;
+ for(int i = 0; i < entryCount; i++) {
+ node = nodeList.item(i);
+ if(node.getNodeType() == Node.ELEMENT_NODE) {
+ selement = (Element)node;
+ if(!selement.getNodeName().equalsIgnoreCase(SET_ENTRY)) {
+ throw getInvalidFormatDebugException();
+ }
+ set.add(getValueAttribute(selement));
+ }
+ }
+ setAttribute(setKey, set);
+ }
+
+ /**
+ * Reads a <code>Map</code> attribute from the specified XML node and
+ * loads it into the mapping of attributes
+ *
+ * @param element the element to read the map attribute from
+ * @throws CoreException if the element has an invalid format
+ */
protected void setMapAttribute(Element element) throws CoreException {
- String mapKey = element.getAttribute("key"); //$NON-NLS-1$
+ String mapKey = element.getAttribute(KEY);
NodeList nodeList = element.getChildNodes();
int entryCount = nodeList.getLength();
Map map = new HashMap(entryCount);
+ Node node = null;
+ Element selement = null;
for (int i = 0; i < entryCount; i++) {
- Node node = nodeList.item(i);
- short type = node.getNodeType();
- if (type == Node.ELEMENT_NODE) {
- Element subElement = (Element) node;
- String nodeName = subElement.getNodeName();
- if (!nodeName.equalsIgnoreCase("mapEntry")) { //$NON-NLS-1$
+ node = nodeList.item(i);
+ if (node.getNodeType() == Node.ELEMENT_NODE) {
+ selement = (Element) node;
+ if (!selement.getNodeName().equalsIgnoreCase(MAP_ENTRY)) {
throw getInvalidFormatDebugException();
}
- String key = getKeyAttribute(subElement);
- String value = getValueAttribute(subElement);
- map.put(key, value);
+ map.put(getKeyAttribute(selement), getValueAttribute(selement));
}
}
setAttribute(mapKey, map);
}
+ /**
+ * Returns the <code>String</code> representation of the 'key' attribute from the specified element
+ * @param element the element to read from
+ * @return the value
+ * @throws CoreException
+ */
protected String getKeyAttribute(Element element) throws CoreException {
- String key = element.getAttribute("key"); //$NON-NLS-1$
+ String key = element.getAttribute(KEY);
if (key == null) {
throw getInvalidFormatDebugException();
}
return key;
}
+ /**
+ * Returns the <code>String</code> representation of the 'value' attribute from the specified element
+ * @param element the element to read from
+ * @return the value
+ * @throws CoreException
+ */
protected String getValueAttribute(Element element) throws CoreException {
- String value = element.getAttribute("value"); //$NON-NLS-1$
+ String value = element.getAttribute(VALUE);
if (value == null) {
throw getInvalidFormatDebugException();
}
return value;
}
+ /**
+ * Returns an invalid format exception for reuse
+ * @return an invalid format exception
+ */
protected DebugException getInvalidFormatDebugException() {
return
new DebugException(
@@ -521,8 +693,9 @@ public class LaunchConfigurationInfo {
}
/**
- * Two <code>LaunchConfigurationInfo</code> objects are equal if and only if they have the
- * same type and they have the same set of attributes with the same values.
+ * Two <code>LaunchConfigurationInfo</code> objects are equal if and only
+ * if they have the same type and they have the same set of attributes with
+ * the same values.
*
* @see Object#equals(Object)
*/
@@ -544,10 +717,10 @@ public class LaunchConfigurationInfo {
}
/**
- * Returns whether the two attribute maps are equal, consulting
- * registered comparator extensions.
+ * Returns whether the two attribute maps are equal, consulting registered
+ * comparator extensions.
*
- * @param map1 attribute map
+ * @param map1 attribute map
* @param map2 attribute map
* @return whether the two attribute maps are equal
*/
@@ -566,8 +739,12 @@ public class LaunchConfigurationInfo {
if (comp == null) {
if (fgIsSun14x) {
if(attr2 instanceof String & attr1 instanceof String) {
- //this is a hack for bug 110215, on SUN 1.4.x, \r is stripped off when the stream is written to the DOM
- //this is not the case for 1.5.x, so to be safe we are stripping \r off all strings before we compare for equality
+ // this is a hack for bug 110215, on SUN 1.4.x, \r
+ // is stripped off when the stream is written to the
+ // DOM
+ // this is not the case for 1.5.x, so to be safe we
+ // are stripping \r off all strings before we
+ // compare for equality
attr1 = ((String)attr1).replaceAll("\\r", ""); //$NON-NLS-1$ //$NON-NLS-2$
attr2 = ((String)attr2).replaceAll("\\r", ""); //$NON-NLS-1$ //$NON-NLS-2$
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java
index 7b0e9237c..14ee00256 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java
@@ -11,14 +11,12 @@
package org.eclipse.debug.internal.core;
-import com.ibm.icu.text.MessageFormat;
+import java.util.Collections;
import java.util.HashSet;
import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.StringTokenizer;
+
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -34,6 +32,8 @@ import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
import org.eclipse.debug.core.sourcelookup.ISourcePathComputer;
+import com.ibm.icu.text.MessageFormat;
+
/**
* A launch configuration type wrappers a configuration
* element for a <code>launchConfigurationType</code>
@@ -41,31 +41,52 @@ import org.eclipse.debug.core.sourcelookup.ISourcePathComputer;
*/
public class LaunchConfigurationType extends PlatformObject implements ILaunchConfigurationType {
- private static String MIGRATION_DELEGATE = "migrationDelegate"; //$NON-NLS-1$
-
/**
* The configuration element of the extension.
*/
private IConfigurationElement fElement;
/**
- * Base modes this type supports.
+ * a listing of modes contributed to this launch configuration type
+ * @since 3.3
+ *
+ * <p>
+ * <strong>EXPERIMENTAL</strong>. This field has been added as
+ * part of a work in progress. There is no guarantee that this API will
+ * remain unchanged during the 3.3 release cycle. Please do not use this API
+ * without consulting with the Platform/Debug team.
+ * </p>
+ */
+ private Set fModes = null;
+
+ /**
+ * the default source path computer for this config type
+ * @since 3.3
+ *
+ * <p>
+ * <strong>EXPERIMENTAL</strong>. This field has been added as
+ * part of a work in progress. There is no guarantee that this API will
+ * remain unchanged during the 3.3 release cycle. Please do not use this API
+ * without consulting with the Platform/Debug team.
+ * </p>
*/
- private Set fBaseModes;
+ private ISourcePathComputer fSourcePathComputer = null;
/**
- * Modes that delegates have been contributed for
+ * The source locator id for this config type
*/
- private Set fContributedModes;
+ private String fSourceLocator = null;
/**
* The delegates for launch configurations of this type.
* Delegates are instantiated lazily as required. There may
* be different delegates for different modes (since 3.0).
- * Map of mode -> delegate
+ * Map of mode to delegate
*/
private Map fDelegates;
+ private LaunchDelegate fSourceProvider;
+
/**
* Constructs a new launch configuration type on the
* given configuration element.
@@ -73,83 +94,25 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
* @param element configuration element
*/
protected LaunchConfigurationType(IConfigurationElement element) {
- setConfigurationElement(element);
+ fElement = element;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationType#getAttribute(java.lang.String)
*/
public String getAttribute(String attributeName) {
- return getConfigurationElement().getAttribute(attributeName);
+ return fElement.getAttribute(attributeName);
}
-
- /**
- * Returns the set of modes specified in the configuration data.
- *
- * @return the set of modes specified in the configuration data
- */
- protected Set getBaseModes() {
- if (fBaseModes == null) {
- String modes= getConfigurationElement().getAttribute("modes"); //$NON-NLS-1$
- if (modes == null) {
- return new HashSet(0);
- }
- StringTokenizer tokenizer= new StringTokenizer(modes, ","); //$NON-NLS-1$
- fBaseModes = new HashSet(tokenizer.countTokens());
- while (tokenizer.hasMoreTokens()) {
- fBaseModes.add(tokenizer.nextToken().trim());
- }
- }
- return fBaseModes;
- }
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationType#getCategory()
*/
public String getCategory() {
- return getConfigurationElement().getAttribute("category"); //$NON-NLS-1$
- }
-
- /**
- * Returns this type's configuration element.
- *
- * @return this type's configuration element
- */
- protected IConfigurationElement getConfigurationElement() {
- return fElement;
- }
-
- /**
- * Returns the set of modes delegates have been contributed for
- *
- * @return the set of modes delegates have been contributed for
- */
- protected Set getContributedModes() {
- if (fContributedModes == null) {
- fContributedModes = new HashSet(0);
- // add modes for contributed delegates
- List delegates = ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getContributedDelegates();
- Iterator iterator = delegates.iterator();
- while (iterator.hasNext()) {
- ContributedDelegate delegate = (ContributedDelegate)iterator.next();
- if (delegate.getLaunchConfigurationType().equals(getIdentifier())) {
- fContributedModes.addAll(delegate.getModes());
- }
- }
- }
- return fContributedModes;
+ return fElement.getAttribute(IConfigurationElementConstants.CATEGORY);
}
/**
- * Returns the launch configuration delegate for launch
- * configurations of this type. The first time this method
- * is called, the delegate is instantiated.
- *
* @see org.eclipse.debug.core.ILaunchConfigurationType#getDelegate()
- * @return launch configuration delegate
- * @exception CoreException if unable to instantiate the
- * delegate
- * @deprecated use <code>getDelegate(String)</code> to specify mode
*/
public ILaunchConfigurationDelegate getDelegate() throws CoreException {
return getDelegate(ILaunchManager.RUN_MODE);
@@ -159,62 +122,47 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
* @see org.eclipse.debug.core.ILaunchConfigurationType#getDelegate(java.lang.String)
*/
public ILaunchConfigurationDelegate getDelegate(String mode) throws CoreException {
+ return getDelegate(mode, Collections.EMPTY_SET);
+ }
+
+ /**
+ * @see org.eclipse.debug.core.ILaunchConfigurationType#getDelegate(java.lang.String, java.lang.String[])
+ */
+ public ILaunchConfigurationDelegate getDelegate(String mode, Set options) throws CoreException {
if (!supportsMode(mode)) {
throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_9, new String[] {mode, getIdentifier()}), null));
}
if (fDelegates == null) {
// initialize delegate table with base modes
- fDelegates = new Hashtable(3);
+ fDelegates = new Hashtable();
}
ILaunchConfigurationDelegate delegate = (ILaunchConfigurationDelegate)fDelegates.get(mode);
if (delegate == null) {
- Set modes = getBaseModes();
- if (modes.contains(mode)) {
- Object object = getConfigurationElement().createExecutableExtension("delegate"); //$NON-NLS-1$
- if (object instanceof ILaunchConfigurationDelegate) {
- Iterator iter = modes.iterator();
- while (iter.hasNext()) {
- fDelegates.put(iter.next(), object);
- }
- return (ILaunchConfigurationDelegate)object;
- }
- 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));
- }
- // contributed modes
- List contributed = ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getContributedDelegates();
- Iterator iterator = contributed.iterator();
- while (iterator.hasNext()) {
- ContributedDelegate contributedDelegate = (ContributedDelegate)iterator.next();
- if (getIdentifier().equals(contributedDelegate.getLaunchConfigurationType())) {
- modes = contributedDelegate.getModes();
- if (modes.contains(mode)) {
- delegate = contributedDelegate.getDelegate();
- Iterator modesIterator = modes.iterator();
- while (modesIterator.hasNext()) {
- fDelegates.put(modesIterator.next(), delegate);
- }
- return delegate;
- }
+ if(fModes.contains(mode)) {
+ LaunchDelegate[] delegates = ((LaunchManager) DebugPlugin.getDefault().getLaunchManager()).getLaunchDelegates(getIdentifier(), mode, options);
+ if(delegates.length > 0) {
+ return delegates[0].getDelegate();
}
}
- } else {
+ }
+ else {
return delegate;
}
- throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_10, new String[] {getIdentifier(), mode}), null));
+ throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_10, new String[] {getIdentifier(), mode}), null));
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationType#getIdentifier()
*/
public String getIdentifier() {
- return getConfigurationElement().getAttribute("id"); //$NON-NLS-1$
+ return fElement.getAttribute(IConfigurationElementConstants.ID);
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationType#getName()
*/
public String getName() {
- return getConfigurationElement().getAttribute("name"); //$NON-NLS-1$
+ return fElement.getAttribute(IConfigurationElementConstants.NAME);
}
/* (non-Javadoc)
@@ -228,50 +176,78 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
* @see org.eclipse.debug.core.ILaunchConfigurationType#getSourceLocatorId()
*/
public String getSourceLocatorId() {
- String id = getAttribute("sourceLocatorId"); //$NON-NLS-1$
- if (id == null) {
- // check for specification by mode specific delegate
- List delegates = ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getContributedDelegates();
- Iterator iterator = delegates.iterator();
- while (iterator.hasNext() && id == null) {
- ContributedDelegate delegate = (ContributedDelegate)iterator.next();
- if (delegate.getLaunchConfigurationType().equals(getIdentifier())) {
- id = delegate.getSourceLocaterId();
+ if(fSourceLocator == null) {
+ fSourceLocator = getAttribute(IConfigurationElementConstants.SOURCE_LOCATOR);
+ //see if the cached source provider knows about it
+ if(fSourceProvider != null) {
+ fSourceLocator = fSourceProvider.getSourceLocatorId();
+ }
+ //if not provided check all the applicable delegates for one and record the delegate if found,
+ //so it can be reused to try and find the source path computer
+ if(fSourceLocator == null) {
+ LaunchDelegate[] delegates = ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getLaunchDelegates(getIdentifier());
+ for(int i = 0; i < delegates.length; i++) {
+ fSourceLocator = delegates[i].getSourceLocatorId();
+ if(fSourceLocator != null) {
+ fSourceProvider = delegates[i];
+ return fSourceLocator;
+ }
}
+ fSourceProvider = null;
}
}
- return id;
+ return fSourceLocator;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationType#getSourcePathComputer()
*/
public ISourcePathComputer getSourcePathComputer() {
- String id = getConfigurationElement().getAttribute("sourcePathComputerId"); //$NON-NLS-1$
- if (id == null) {
- // check for specification by mode specific delegate
- List delegates = ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getContributedDelegates();
- Iterator iterator = delegates.iterator();
- while (iterator.hasNext() && id == null) {
- ContributedDelegate delegate = (ContributedDelegate)iterator.next();
- if (delegate.getLaunchConfigurationType().equals(getIdentifier())) {
- id = delegate.getSourcePathComputerId();
+ if(fSourcePathComputer == null) {
+ //get the id
+ String id = fElement.getAttribute(IConfigurationElementConstants.SOURCE_PATH_COMPUTER);
+ //ask if the source provider knows about it
+ if(fSourceProvider != null) {
+ id = fSourceProvider.getSourcePathComputerId();
+ }
+ if(id != null) {
+ fSourcePathComputer = DebugPlugin.getDefault().getLaunchManager().getSourcePathComputer(id);
+ }
+ else {
+ //if not provided check all the applicable delegates for one and record the delegate if found,
+ //so it can be reused to try and find the source path computer
+ LaunchDelegate[] delegates = ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getLaunchDelegates(getIdentifier());
+ for(int i = 0; i < delegates.length; i++) {
+ id = delegates[i].getSourcePathComputerId();
+ if(id != null) {
+ fSourceProvider = delegates[i];
+ fSourcePathComputer = DebugPlugin.getDefault().getLaunchManager().getSourcePathComputer(id);
+ if(fSourcePathComputer != null) {
+ return fSourcePathComputer;
+ }
+ }
}
+ fSourceProvider = null;
}
+
}
- if (id != null && id.length() > 0) {
- return DebugPlugin.getDefault().getLaunchManager().getSourcePathComputer(id);
- }
- return null;
+ return fSourcePathComputer;
}
- /* (non-Javadoc)
+ /**
* @see org.eclipse.debug.core.ILaunchConfigurationType#getSupportedModes()
*/
public Set getSupportedModes() {
- HashSet modes = new HashSet(getBaseModes());
- modes.addAll(getContributedModes());
- return modes;
+ if(fModes == null) {
+ fModes = new HashSet();
+ LaunchDelegate[] delegates = ((LaunchManager) DebugPlugin.getDefault().getLaunchManager()).getLaunchDelegates();
+ for(int i= 0; i < delegates.length; i++) {
+ if(delegates[i].appliesTo(getIdentifier())) {
+ fModes.addAll(delegates[i].getModes());
+ }
+ }
+ }
+ return fModes;
}
/**
@@ -283,14 +259,14 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
* @since 3.2
*/
public boolean isMigrationCandidate(ILaunchConfiguration candidate) throws CoreException {
- if(getAttribute(MIGRATION_DELEGATE) != null) {
+ if(getAttribute(IConfigurationElementConstants.MIGRATION_DELEGATE) != null) {
if(fDelegates == null) {
fDelegates = new Hashtable();
}
- Object delegate = fDelegates.get(MIGRATION_DELEGATE);
+ Object delegate = fDelegates.get(IConfigurationElementConstants.MIGRATION_DELEGATE);
if(delegate == null) {
- delegate = getConfigurationElement().createExecutableExtension(MIGRATION_DELEGATE);
- fDelegates.put(MIGRATION_DELEGATE, delegate);
+ delegate = fElement.createExecutableExtension(IConfigurationElementConstants.MIGRATION_DELEGATE);
+ fDelegates.put(IConfigurationElementConstants.MIGRATION_DELEGATE, delegate);
}
if(delegate instanceof ILaunchConfigurationMigrationDelegate) {
return ((ILaunchConfigurationMigrationDelegate)delegate).isCandidate(candidate);
@@ -303,7 +279,7 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
* @see org.eclipse.debug.core.ILaunchConfigurationType#isPublic()
*/
public boolean isPublic() {
- String publicString = getConfigurationElement().getAttribute("public"); //$NON-NLS-1$
+ String publicString = fElement.getAttribute(IConfigurationElementConstants.PUBLIC);
if (publicString != null) {
if (publicString.equalsIgnoreCase("false")) { //$NON-NLS-1$
return false;
@@ -320,14 +296,14 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
* @since 3.2
*/
public void migrate(ILaunchConfiguration candidate) throws CoreException {
- if(getAttribute(MIGRATION_DELEGATE) != null) {
+ if(getAttribute(IConfigurationElementConstants.MIGRATION_DELEGATE) != null) {
if(fDelegates == null) {
fDelegates = new Hashtable();
}
- Object delegate = fDelegates.get(MIGRATION_DELEGATE);
+ Object delegate = fDelegates.get(IConfigurationElementConstants.MIGRATION_DELEGATE);
if(delegate == null) {
- delegate = getConfigurationElement().createExecutableExtension(MIGRATION_DELEGATE);
- fDelegates.put(MIGRATION_DELEGATE, delegate);
+ delegate = fElement.createExecutableExtension(IConfigurationElementConstants.MIGRATION_DELEGATE);
+ fDelegates.put(IConfigurationElementConstants.MIGRATION_DELEGATE, delegate);
}
if(delegate instanceof ILaunchConfigurationMigrationDelegate) {
((ILaunchConfigurationMigrationDelegate)delegate).migrate(candidate);
@@ -339,23 +315,28 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
* @see org.eclipse.debug.core.ILaunchConfigurationType#newInstance(org.eclipse.core.resources.IContainer, java.lang.String)
*/
public ILaunchConfigurationWorkingCopy newInstance(IContainer container, String name) {
- return new LaunchConfigurationWorkingCopy(container, name, this);
+ return new LaunchConfigurationWorkingCopy(container, name, this);
}
/**
- * Sets this type's configuration element.
- *
- * @param element this type's configuration element
+ * @see org.eclipse.debug.core.ILaunchConfigurationType#supportsMode(java.lang.String)
*/
- private void setConfigurationElement(IConfigurationElement element) {
- fElement = element;
+ public boolean supportsMode(String mode) {
+ return getSupportedModes().contains(mode);
}
-
- /**
- * @see ILaunchConfigurationType#supportsMode(String)
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchConfigurationType#getContributorName()
*/
- public boolean supportsMode(String mode) {
- return getBaseModes().contains(mode) || getContributedModes().contains(mode);
+ public String getContributorName() {
+ return fElement.getContributor().getName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchConfigurationType#getImageDescriptorId()
+ */
+ public String getImageDescriptorPath() {
+ return fElement.getAttribute(IConfigurationElementConstants.ICON);
}
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java
index 005b7653f..9de1c0dca 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java
@@ -16,10 +16,10 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
-import com.ibm.icu.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;
@@ -40,6 +40,8 @@ import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import com.ibm.icu.text.MessageFormat;
+
/**
* A working copy launch configuration
*/
@@ -194,7 +196,7 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
}
// write the new file
writeNewFile();
- resetDirty();
+ fDirty = false;
}
/**
@@ -369,7 +371,7 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
LaunchConfigurationInfo info = original.getInfo();
setInfo(info.getCopy());
setContainer(original.getContainer());
- resetDirty();
+ fDirty = false;
}
/**
@@ -421,14 +423,47 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
getLaunchManager().getConfigurationNotifier().notify(this, LaunchManager.CHANGED);
}
}
+
+ /**
+ * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#setOptions(java.util.List)
+ */
+ public void setOptions(Set options) {
+ getInfo().setAttribute(ATTR_LAUNCH_OPTIONS, (options.size() > 0 ? options : null));
+ setDirty();
+ }
+
+ /**
+ * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#addOptions(java.util.Set)
+ */
+ public void addOptions(Set options) {
+ try {
+ Set opts = getOptions();
+ if(opts.addAll(options)) {
+ getInfo().setAttribute(ATTR_LAUNCH_OPTIONS, opts);
+ setDirty();
+ }
+ }
+ catch (CoreException e) {
+ DebugPlugin.log(e);
+ }
+ }
/**
- * Sets this working copy's state to not dirty.
+ * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#removeOptions(java.util.Set)
*/
- private void resetDirty() {
- fDirty = false;
- }
-
+ public void removeOptions(Set options) {
+ try {
+ Set opts = getOptions();
+ if(opts.removeAll(options)) {
+ getInfo().setAttribute(ATTR_LAUNCH_OPTIONS, opts);
+ setDirty();
+ }
+ }
+ catch (CoreException e) {
+ DebugPlugin.log(e);
+ }
+ }
+
/**
* @see ILaunchConfigurationWorkingCopy#rename(String)
*/
@@ -593,7 +628,7 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
}
setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_PATHS, paths);
setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_TYPES, types);
- }//end setResource
+ }
-}//end class
+}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
index 2fd936943..33edeb9fb 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
@@ -148,7 +148,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
* @since 3.2
*/
protected static final IStatus deleteAssociatedLaunchConfigs = new Status(IStatus.INFO, DEBUG_CORE, 225, EMPTY_STRING, null);
-
/**
@@ -507,17 +506,14 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
* @throws IOException if the encoding attempted to be used is not supported
*/
public static String serializeDocument(Document doc) throws TransformerException, IOException {
- ByteArrayOutputStream s= new ByteArrayOutputStream();
-
- TransformerFactory factory= TransformerFactory.newInstance();
- Transformer transformer= factory.newTransformer();
+ ByteArrayOutputStream s = new ByteArrayOutputStream();
+ TransformerFactory factory = TransformerFactory.newInstance();
+ Transformer transformer = factory.newTransformer();
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
-
- DOMSource source= new DOMSource(doc);
- StreamResult outputTarget= new StreamResult(s);
+ DOMSource source = new DOMSource(doc);
+ StreamResult outputTarget = new StreamResult(s);
transformer.transform(source, outputTarget);
-
return s.toString("UTF8"); //$NON-NLS-1$
}
@@ -564,10 +560,14 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
private HashMap fLaunchOptions = null;
/**
- * List of contributed launch delegates (delegates contributed for existing
- * launch configuration types).
+ * A map of LaunchDelegate objects stored by id of delegate, or launch config type
*/
- private List fContributedDelegates = null;
+ private HashMap fLaunchDelegates = null;
+
+ /**
+ * A map of duplicate delegates arranged by config type id
+ */
+ private HashMap fDuplicateDelegates = null;
/**
* Collection of launches
@@ -581,7 +581,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
/**
* Collection of listeners
*/
- private ListenerList fListeners= new ListenerList();
+ private ListenerList fListeners = new ListenerList();
/**
* Collection of "plural" listeners.
@@ -630,7 +630,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
* and values are associated configuration elements.
*/
private Map sourcePathComputers;
-
+
/**
* @see ILaunchManager#addLaunch(ILaunch)
*/
@@ -739,16 +739,37 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
} else {
//read process directly on other platforms
- BufferedReader reader= new BufferedReader(new InputStreamReader(process.getInputStream()));
- String line= reader.readLine();
+ //we need to parse out matching '{' and '}' for function declarations in .bash environments
+ // pattern is [func name]=() { and we must find the '}' on its own line with no trailing ';'
+ InputStream stream = process.getInputStream();
+ InputStreamReader isreader = new InputStreamReader(stream);
+ BufferedReader reader = new BufferedReader(isreader);
+ String line = reader.readLine();
+ String key = null;
+ String value = null;
while (line != null) {
- int separator= line.indexOf('=');
- if (separator > 0) {
- String key= line.substring(0, separator);
- String value= line.substring(separator + 1);
- cache.put(key, value);
+ int func = line.indexOf("=()"); //$NON-NLS-1$
+ if(func > 0) {
+ key = line.substring(0, func);
+ //scan until we find the closing '}' with no following chars
+ value = line.substring(func+1);
+ while(line != null && !line.equals("}")) { //$NON-NLS-1$
+ line = reader.readLine();
+ if(line != null) {
+ value += line;
+ }
+ }
+ }
+ else {
+ int separator = line.indexOf('=');
+ if (separator > 0) {
+ key = line.substring(0, separator);
+ value = line.substring(separator + 1);
+
+ }
}
- line= reader.readLine();
+ cache.put(key, value);
+ line = reader.readLine();
}
reader.close();
}
@@ -830,8 +851,9 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
Iterator iter = list.iterator();
List configs = new ArrayList(list.size());
+ IFile file = null;
while (iter.hasNext()) {
- IFile file = (IFile)iter.next();
+ file = (IFile)iter.next();
configs.add(getLaunchConfiguration(file));
}
return configs;
@@ -856,8 +878,9 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
};
String[] files = directory.list(filter);
+ LaunchConfiguration config = null;
for (int i = 0; i < files.length; i++) {
- LaunchConfiguration config = new LaunchConfiguration(containerPath.append(files[i]));
+ config = new LaunchConfiguration(containerPath.append(files[i]));
configs.add(config);
}
}
@@ -893,13 +916,13 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
try {
index = Integer.parseInt(trailer);
baseName = baseName.substring(0, copyIndex);
- } catch (NumberFormatException nfe) {
- }
+ }
+ catch (NumberFormatException nfe) {}
}
}
String newName = baseName;
- StringBuffer buffer= null;
+ StringBuffer buffer = null;
while (isExistingLaunchConfigurationName(newName)) {
buffer = new StringBuffer(baseName);
buffer.append(" ("); //$NON-NLS-1$
@@ -995,16 +1018,18 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
List configs = new ArrayList(4);
NodeList list = root.getChildNodes();
int length = list.getLength();
+ Node node = null;
+ Element entry = null;
+ String memento = null;
for (int i = 0; i < length; ++i) {
- Node node = list.item(i);
+ node = list.item(i);
short type = node.getNodeType();
if (type == Node.ELEMENT_NODE) {
- Element entry = (Element) node;
- String nodeName = entry.getNodeName();
- if (!nodeName.equals("launchConfiguration")) { //$NON-NLS-1$
+ entry = (Element) node;
+ if (!entry.getNodeName().equals("launchConfiguration")) { //$NON-NLS-1$
throw invalidFormat;
}
- String memento = entry.getAttribute("memento"); //$NON-NLS-1$
+ memento = entry.getAttribute("memento"); //$NON-NLS-1$
if (memento == null) {
throw invalidFormat;
}
@@ -1016,18 +1041,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
protected ConfigurationNotifier getConfigurationNotifier() {
return new ConfigurationNotifier();
- }
-
- /**
- * Returns a list of launch delegates contributed for existing launch configuration
- * types.
- *
- * @return list of ContributedDelegate
- */
- protected List getContributedDelegates() {
- initializeContributedDelegates();
- return fContributedDelegates;
- }
+ }
/**
* @see ILaunchManager#getDebugTargets()
@@ -1036,9 +1050,10 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
synchronized (fLaunches) {
List allTargets= new ArrayList(fLaunches.size());
if (fLaunches.size() > 0) {
- Iterator e= fLaunches.iterator();
+ Iterator e = fLaunches.iterator();
+ IDebugTarget[] targets = null;
while (e.hasNext()) {
- IDebugTarget[] targets= ((ILaunch) e.next()).getDebugTargets();
+ targets = ((ILaunch) e.next()).getDebugTargets();
for (int i = 0; i < targets.length; i++) {
allTargets.add(targets[i]);
}
@@ -1073,10 +1088,9 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
if (configEnv == null) {
return null;
}
- Map env = null;
+ Map env = new HashMap();
// build base environment
- env= new HashMap();
- boolean append= configuration.getAttribute(ATTR_APPEND_ENVIRONMENT_VARIABLES, true);
+ boolean append = configuration.getAttribute(ATTR_APPEND_ENVIRONMENT_VARIABLES, true);
if (append) {
env.putAll(getNativeEnvironmentCasePreserved());
}
@@ -1084,10 +1098,17 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
// Add variables from config
Iterator iter= configEnv.entrySet().iterator();
boolean win32= Platform.getOS().equals(Constants.OS_WIN32);
+ Map.Entry entry = null;
+ String key = null;
+ String value = null;
+ Object nativeValue = null;
+ Iterator envIter = null;
+ Map.Entry nativeEntry = null;
+ String nativeKey = null;
while (iter.hasNext()) {
- Map.Entry entry= (Map.Entry) iter.next();
- String key= (String) entry.getKey();
- String value = (String) entry.getValue();
+ entry = (Map.Entry) iter.next();
+ key = (String) entry.getKey();
+ value = (String) entry.getValue();
// translate any string substitution variables
if (value != null) {
value = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(value);
@@ -1095,7 +1116,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
boolean added= false;
if (win32) {
// First, check if the key is an exact match for an existing key.
- Object nativeValue= env.get(key);
+ nativeValue = env.get(key);
if (nativeValue != null) {
// If an exact match is found, just replace the value
env.put(key, value);
@@ -1103,13 +1124,13 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
// Win32 vars are case-insensitive. If an exact match isn't found, iterate to
// check for a case-insensitive match. We maintain the key's case (see bug 86725),
// but do a case-insensitive comparison (for example, "pAtH" will still override "PATH").
- Iterator envIter= env.entrySet().iterator();
+ envIter = env.entrySet().iterator();
while (envIter.hasNext()) {
- Map.Entry nativeEntry = (Map.Entry) envIter.next();
- String nativeKey= (String) (nativeEntry).getKey();
+ nativeEntry = (Map.Entry) envIter.next();
+ nativeKey = (String) (nativeEntry).getKey();
if (nativeKey.equalsIgnoreCase(key)) {
nativeEntry.setValue(value);
- added= true;
+ added = true;
break;
}
}
@@ -1120,11 +1141,12 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
}
- iter= env.entrySet().iterator();
- List strings= new ArrayList(env.size());
+ iter = env.entrySet().iterator();
+ List strings = new ArrayList(env.size());
+ StringBuffer buffer = null;
while (iter.hasNext()) {
- Map.Entry entry = (Map.Entry) iter.next();
- StringBuffer buffer= new StringBuffer((String) entry.getKey());
+ entry = (Map.Entry) iter.next();
+ buffer = new StringBuffer((String) entry.getKey());
buffer.append('=').append((String) entry.getValue());
strings.add(buffer.toString());
}
@@ -1215,8 +1237,9 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
public ILaunchConfiguration[] getLaunchConfigurations(ILaunchConfigurationType type) throws CoreException {
Iterator iter = getAllLaunchConfigurations().iterator();
List configs = new ArrayList();
+ ILaunchConfiguration config = null;
while (iter.hasNext()) {
- ILaunchConfiguration config = (ILaunchConfiguration)iter.next();
+ config = (ILaunchConfiguration)iter.next();
if (config.getType().equals(type)) {
configs.add(config);
}
@@ -1224,7 +1247,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
return (ILaunchConfiguration[])configs.toArray(new ILaunchConfiguration[configs.size()]);
}
-
/**
* Returns all launch configurations that are stored as resources
* in the given project.
@@ -1236,9 +1258,11 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
protected List getLaunchConfigurations(IProject project) {
Iterator iter = getAllLaunchConfigurations().iterator();
List configs = new ArrayList();
+ ILaunchConfiguration config = null;
+ IFile file = null;
while (iter.hasNext()) {
- ILaunchConfiguration config = (ILaunchConfiguration)iter.next();
- IFile file = config.getFile();
+ config = (ILaunchConfiguration)iter.next();
+ file = config.getFile();
if (file != null && file.getProject().equals(project)) {
configs.add(config);
}
@@ -1276,7 +1300,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
}
- /* (non-Javadoc)
+ /**)
* @see org.eclipse.debug.core.ILaunchManager#getLaunchMode(java.lang.String)
*/
public ILaunchMode getLaunchMode(String mode) {
@@ -1284,7 +1308,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
return (ILaunchMode) fLaunchModes.get(mode);
}
- /* (non-Javadoc)
+ /**
* @see org.eclipse.debug.core.ILaunchManager#getLaunchModes()
*/
public ILaunchMode[] getLaunchModes() {
@@ -1309,7 +1333,216 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
Collection col = fLaunchOptions.values();
return (ILaunchOption[])col.toArray(new ILaunchOption[col.size()]);
}
-
+
+ /**
+ * Initializes the listing of registered launch options. Does no work if the mapping is already populated.
+ *
+ * <p>
+ * <strong>EXPERIMENTAL</strong>. This method has been added as
+ * part of a work in progress. There is no guarantee that this API will
+ * remain unchanged during the 3.3 release cycle. Please do not use this API
+ * without consulting with the Platform/Debug team.
+ * </p>
+ * @since 3.3
+ */
+ private synchronized void initializeLaunchOptions() {
+ if(fLaunchOptions == null) {
+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_OPTIONS);
+ IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
+ fLaunchOptions = new HashMap();
+ ILaunchOption option = null;
+ for(int i = 0; i < infos.length; i++) {
+ option = new LaunchOption(infos[i]);
+ fLaunchOptions.put(option.getIdentifier(), option);
+ }
+ }
+ }
+
+ /**
+ * Returns all of the launch delegates. The rturned listing of delegates cannot be directly used to launch,
+ * instead the method <code>IlaunchDelegate.getDelegate</code> must be used to acquire an executable form of
+ * the delegate, allowing us to maintain lazy loading of the delegates themselves.
+ * @return all of the launch delegates
+ * @since 3.3
+ * <p>
+ * <strong>EXPERIMENTAL</strong>. This method has been added as
+ * part of a work in progress. There is no guarantee that this API will
+ * remain unchanged during the 3.3 release cycle. Please do not use this API
+ * without consulting with the Platform/Debug team.
+ * </p>
+ */
+ public LaunchDelegate[] getLaunchDelegates() {
+ initializeLaunchDelegates();
+ Collection col = fLaunchDelegates.values();
+ return (LaunchDelegate[]) col.toArray(new LaunchDelegate[col.size()]);
+ }
+
+ /** Returns the launch delegates that applies to the specified options for the specified mode and type id
+ * @param typeid the <code>ILaunchConfigurationType</code> id
+ * @param the mode id
+ * @param options the options to find the delegate for
+ * @return the delegates that apply to the specified launch options for the specified mode and type id
+ *
+ * <p>
+ * <strong>EXPERIMENTAL</strong>. This method has been added as
+ * part of a work in progress. There is no guarantee that this API will
+ * remain unchanged during the 3.3 release cycle. Please do not use this API
+ * without consulting with the Platform/Debug team.
+ * </p>
+ * @since 3.3
+ */
+ public LaunchDelegate[] getLaunchDelegates(String typeid, String mode, Set options) {
+ initializeLaunchDelegates();
+ LaunchDelegate ld = null;
+ boolean applies = true;
+ ArrayList list = new ArrayList();
+ Object[] aoptions = options.toArray();
+ Set doptions = null;
+ for(Iterator iter = fLaunchDelegates.keySet().iterator(); iter.hasNext();) {
+ ld = (LaunchDelegate) fLaunchDelegates.get(iter.next());
+ doptions = ld.getOptions();
+ if(ld.appliesTo(typeid, mode)) {
+ if(options != null) {
+ if(doptions.size() > 0 & aoptions.length == 0) {
+ applies = false;
+ }
+ for(int i = 0; i < aoptions.length; i++) {
+ applies &= doptions.contains(aoptions[i]);
+ }
+ }
+ else if(doptions.size() > 0) {
+ applies = false;
+ }
+ if(applies) {
+ list.add(ld);
+ }
+ applies = true;
+ }
+ }
+ return (LaunchDelegate[]) list.toArray(new LaunchDelegate[list.size()]);
+ }
+
+ /**
+ * Returns the listing of launch delegates that apply to the specified
+ * <code>ILaunchConfigurationType</code> id
+ * @param typeid the id of the launch configuration type to get delegates for
+ * @return An array of <code>LaunchDelegate</code>s that apply to the specified launch configuration
+ * type, or an empty array, never <code>null</code>
+ *
+ * @since 3.3
+ *
+ * EXPERIMENTAL
+ */
+ public LaunchDelegate[] getLaunchDelegates(String typeid) {
+ initializeLaunchDelegates();
+ ArrayList list = new ArrayList();
+ LaunchDelegate ld = null;
+ for(Iterator iter = fLaunchDelegates.keySet().iterator(); iter.hasNext();) {
+ ld = (LaunchDelegate) fLaunchDelegates.get(iter.next());
+ if(ld.appliesTo(typeid)) {
+ list.add(ld);
+ }
+ }
+ return (LaunchDelegate[]) list.toArray(new LaunchDelegate[list.size()]);
+ }
+
+ /**
+ * Returns the listing of duplicate launch delegates in the form of a <code>HashMap</code>, with the
+ * object arrangement:
+ * <p>
+ * <pre>
+ * HashMap<ILaunchConfigurationType, HashMap<string, LaunchDelegate[]>>
+ * </pre>
+ * </p>
+ * <p>
+ * Where the first map is keyed based on <code>ILaunchConfigurationType</code> ids and the inner map
+ * is keyed by mode.
+ * </p>
+ * @return the map of <code>LaunchDelegate</code>s that are in conflict for type, mode and options
+ *
+ * @since 3.3
+ *
+ * EXPERIMENTAL
+ */
+ public HashMap getDuplicateLaunchDelegates() {
+ initializeDuplicateLaunchDelegates();
+ return fDuplicateDelegates;
+ }
+
+ /**
+ * Lazily initializes the listing of duplicate launch delegates
+ *
+ * @since 3.3
+ *
+ * EXPERIMENTAL
+ */
+ private synchronized void initializeDuplicateLaunchDelegates() {
+ if(fDuplicateDelegates == null) {
+ fDuplicateDelegates = new HashMap();
+ //for each delegate get the delegates[]
+ LaunchDelegate[] delegates = getLaunchDelegates();
+ LaunchDelegate[] dupes = null;
+ ILaunchConfigurationType type = null;
+ Set modes = null;
+ Iterator iter = null;
+ Set options = null;
+ HashMap tmp = null;
+ String mode = null;
+ for(int i = 0; i < delegates.length; i++) {
+ type = getLaunchConfigurationType(delegates[i].getLaunchConfigurationType());
+ options = delegates[i].getOptions();
+ modes = type.getSupportedModes();
+ for(iter = modes.iterator(); iter.hasNext();) {
+ mode = (String) iter.next();
+ dupes = getLaunchDelegates(type.getIdentifier(), mode, options);
+ if(dupes.length > 1) {
+ tmp = (HashMap) fDuplicateDelegates.get(type);
+ if(tmp == null) {
+ tmp = new HashMap(dupes.length);
+ }
+ tmp.put(mode, dupes);
+ fDuplicateDelegates.put(type, tmp);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Initializes the listing of delegates available to the launching framework
+ *
+ * <p>
+ * <strong>EXPERIMENTAL</strong>. This method has been added as
+ * part of a work in progress. There is no guarantee that this API will
+ * remain unchanged during the 3.3 release cycle. Please do not use this API
+ * without consulting with the Platform/Debug team.
+ * </p>
+ * @since 3.3
+ */
+ private synchronized void initializeLaunchDelegates() {
+ if(fLaunchDelegates == null) {
+ fLaunchDelegates = new HashMap();
+ //get all launch delegate contributions
+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_DELEGATES);
+ IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
+ LaunchDelegate delegate = null;
+ for(int i = 0; i < infos.length; i++) {
+ delegate = new LaunchDelegate(infos[i]);
+ fLaunchDelegates.put(delegate.getIdentifier(), delegate);
+ }
+ //get all delegates from launch configuration type contributions
+ extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES);
+ infos = extensionPoint.getConfigurationElements();
+ for(int i = 0; i < infos.length; i++) {
+ //must check to see if delegate is provided in contribution
+ if(infos[i].getAttribute(IConfigurationElementConstants.DELEGATE) != null) {
+ delegate = new LaunchDelegate(infos[i]);
+ fLaunchDelegates.put(delegate.getIdentifier(), delegate);
+ }
+ }
+ }
+ }
+
/**
* Returns all launch configurations that are stored locally.
*
@@ -1397,9 +1630,11 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
if (Platform.getOS().equals(Constants.OS_WIN32)) {
fgNativeEnv= new HashMap();
Iterator entries = casePreserved.entrySet().iterator();
+ Map.Entry entry = null;
+ String key = null;
while (entries.hasNext()) {
- Map.Entry entry = (Entry) entries.next();
- String key = ((String)entry.getKey()).toUpperCase();
+ entry = (Entry) entries.next();
+ key = ((String)entry.getKey()).toUpperCase();
fgNativeEnv.put(key, entry.getValue());
}
} else {
@@ -1425,10 +1660,11 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
*/
public IProcess[] getProcesses() {
synchronized (fLaunches) {
- List allProcesses= new ArrayList(fLaunches.size());
- Iterator e= fLaunches.iterator();
+ List allProcesses = new ArrayList(fLaunches.size());
+ Iterator e = fLaunches.iterator();
+ IProcess[] processes = null;
while (e.hasNext()) {
- IProcess[] processes= ((ILaunch) e.next()).getProcesses();
+ processes = ((ILaunch) e.next()).getProcesses();
for (int i= 0; i < processes.length; i++) {
allProcesses.add(processes[i]);
}
@@ -1494,9 +1730,11 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_COMPARATORS);
IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
fComparators = new HashMap(infos.length);
+ IConfigurationElement configurationElement = null;
+ String attr = null;
for (int i= 0; i < infos.length; i++) {
- IConfigurationElement configurationElement = infos[i];
- String attr = configurationElement.getAttribute("attribute"); //$NON-NLS-1$
+ configurationElement = infos[i];
+ attr = configurationElement.getAttribute("attribute"); //$NON-NLS-1$
if (attr != null) {
fComparators.put(attr, new LaunchConfigurationComparator(configurationElement));
} else {
@@ -1508,32 +1746,18 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
}
}
-
+
/**
- * Initializes contributed launch delegates (i.e. delegates contributed
- * to an existing launch configuration type).
+ * Initializes the listing of <code>LaunchConfigurationType</code>s.
*/
- private synchronized void initializeContributedDelegates() {
- if (fContributedDelegates == null) {
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_DELEGATES);
- IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
- fContributedDelegates = new ArrayList(infos.length);
- for (int i= 0; i < infos.length; i++) {
- fContributedDelegates.add(new ContributedDelegate(infos[i]));
- }
- }
- }
-
private synchronized void initializeLaunchConfigurationTypes() {
if (fLaunchConfigurationTypes == null) {
hookResourceChangeListener();
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES);
- IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
- fLaunchConfigurationTypes= new ArrayList(infos.length);
- for (int i= 0; i < infos.length; i++) {
- IConfigurationElement configurationElement = infos[i];
- LaunchConfigurationType configType = new LaunchConfigurationType(configurationElement);
- fLaunchConfigurationTypes.add(configType);
+ IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
+ fLaunchConfigurationTypes = new ArrayList(infos.length);
+ for (int i= 0; i < infos.length; i++) {
+ fLaunchConfigurationTypes.add(new LaunchConfigurationType(infos[i]));
}
}
}
@@ -1543,6 +1767,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
*
* @exception CoreException if an exception occurs reading
* the extensions
+ *
*/
private synchronized void initializeLaunchModes() {
if (fLaunchModes == null) {
@@ -1559,26 +1784,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
catch (CoreException e) {DebugPlugin.log(e);}
}
}
-
- /**
- * Initializes the listing of registered launch options. Does no work if the mapping is already populated.
- * @since 3.3
- */
- private synchronized void initializeLaunchOptions() {
- if(fLaunchOptions == null) {
- try {
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_OPTIONS);
- IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
- fLaunchOptions = new HashMap();
- ILaunchOption option = null;
- for(int i = 0; i < infos.length; i++) {
- option = new LaunchOption(infos[i]);
- fLaunchOptions.put(option.getIdentifier(), option);
- }
- }
- catch(CoreException ce) {DebugPlugin.log(ce);}
- }
- }
/**
* Initializes source container type and source path computer extensions.
@@ -1615,9 +1820,11 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_SOURCE_LOCATORS);
IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
fSourceLocators= new HashMap(infos.length);
+ IConfigurationElement configurationElement = null;
+ String id = null;
for (int i= 0; i < infos.length; i++) {
- IConfigurationElement configurationElement = infos[i];
- String id = configurationElement.getAttribute("id"); //$NON-NLS-1$
+ configurationElement = infos[i];
+ id = configurationElement.getAttribute("id"); //$NON-NLS-1$
if (id != null) {
fSourceLocators.put(id,configurationElement);
} else {
@@ -1812,8 +2019,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
if (!configs.isEmpty()) {
Iterator iterator = configs.iterator();
while (iterator.hasNext()) {
- ILaunchConfiguration configuration = (ILaunchConfiguration)iterator.next();
- launchConfigurationDeleted(configuration);
+ launchConfigurationDeleted((ILaunchConfiguration)iterator.next());
}
}
//bug 12134
@@ -1832,8 +2038,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
if (!configs.isEmpty()) {
Iterator iterator = configs.iterator();
while (iterator.hasNext()) {
- ILaunchConfiguration config = (ILaunchConfiguration) iterator.next();
- launchConfigurationAdded(config);
+ launchConfigurationAdded((ILaunchConfiguration) iterator.next());
}
}
}
@@ -1953,8 +2158,9 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
fLaunchesListeners = new ListenerList();
fLaunchConfigurationListeners = new ListenerList();
ILaunch[] launches = getLaunches();
+ ILaunch launch = null;
for (int i= 0; i < launches.length; i++) {
- ILaunch launch= launches[i];
+ launch = launches[i];
try {
if (launch instanceof IDisconnect) {
IDisconnect disconnect = (IDisconnect)launch;
@@ -2014,8 +2220,9 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
*/
protected void verifyConfigurations(List verify, List valid) {
Iterator configs = verify.iterator();
+ ILaunchConfiguration config = null;
while (configs.hasNext()) {
- ILaunchConfiguration config = (ILaunchConfiguration)configs.next();
+ config = (ILaunchConfiguration)configs.next();
if (isValid(config)) {
valid.add(config);
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchOption.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchOption.java
index eee0e5325..17d05c89c 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchOption.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchOption.java
@@ -10,26 +10,15 @@
*******************************************************************************/
package org.eclipse.debug.internal.core;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchOption;
-import com.ibm.icu.text.MessageFormat;
-
/**
* Proxy to a launch option extension
*
* @since 3.3
*/
public class LaunchOption implements ILaunchOption {
-
- //constants for attribute names
- private static final String ID = "id"; //$NON-NLS-1$
- private static final String LABEL = "label"; //$NON-NLS-1$
- private static final String OPTION = "option"; //$NON-NLS-1$
/**
* The associated configuration element
@@ -40,58 +29,21 @@ public class LaunchOption implements ILaunchOption {
* Constructor
* @param element the element to associate this launch option with
*/
- public LaunchOption(IConfigurationElement element) throws CoreException {
+ public LaunchOption(IConfigurationElement element) {
fElement = element;
- verifyAttributesExist();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchOption#getIdentifier()
*/
public String getIdentifier() {
- return fElement.getAttribute(ID);
+ return fElement.getAttribute(IConfigurationElementConstants.ID);
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchOption#getLabel()
*/
public String getLabel() {
- return fElement.getAttribute(LABEL);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchOption#getOption()
- */
- public String getOption() {
- return fElement.getAttribute(OPTION);
- }
-
- /**
- * Checks to ensure that all of the required attributes are present in the <code>IConfigurationElement</code>
- * @return true if all attributes are present, throws <code>CoreException</code> otherwise
- * @throws CoreException
- */
- private void verifyAttributesExist() throws CoreException {
- if(fElement != null) {
- if(fElement.getAttribute(ID) == null) {
- missingAttribute(ID);
- }
- if(fElement.getAttribute(LABEL) == null) {
- missingAttribute(LABEL);
- }
- if(fElement.getAttribute(OPTION) == null) {
- missingAttribute(OPTION);
- }
- }
- }
-
- /**
- * Throws a <code>CoreException</code> indicating the specified attribute is missing from the extension
- * point definition
- * @param attrName the attribute name that is missing
- * @throws CoreException
- */
- private void missingAttribute(String attrName) throws CoreException {
- throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.LaunchOption_0, new String[]{attrName}), null));
+ return fElement.getAttribute(IConfigurationElementConstants.LABEL);
}
}
diff --git a/org.eclipse.debug.core/plugin.xml b/org.eclipse.debug.core/plugin.xml
index f622ecbb1..112f1c579 100644
--- a/org.eclipse.debug.core/plugin.xml
+++ b/org.eclipse.debug.core/plugin.xml
@@ -161,13 +161,5 @@
id="org.eclipse.debug.core.sourceLocatorMementoComparator">
</launchConfigurationComparator>
</extension>
- <extension
- point="org.eclipse.debug.core.launchOptions">
- <launchOption
- id="org.eclipse.debug.core.debug"
- label="Debug"
- option="debug">
- </launchOption>
- </extension>
</plugin>
diff --git a/org.eclipse.debug.core/schema/launchConfigurationTypes.exsd b/org.eclipse.debug.core/schema/launchConfigurationTypes.exsd
index 150cc2253..d63f389a2 100644
--- a/org.eclipse.debug.core/schema/launchConfigurationTypes.exsd
+++ b/org.eclipse.debug.core/schema/launchConfigurationTypes.exsd
@@ -60,21 +60,21 @@ As of 3.2 the types can also define a migration delegate that can be used to set
</documentation>
</annotation>
</attribute>
- <attribute name="delegate" type="string" use="required">
+ <attribute name="delegate" type="string">
<annotation>
<documentation>
specifies the fully qualified name of the Java class that implements &lt;code&gt;ILaunchConfigurationDelegate&lt;/code&gt;.
-Launch configuration instances of this type will delegate to instances of this class to perform launching.
+Launch configuration instances of this type will delegate to instances of this class to perform launching. Launch delegates can also be contributed for a launch configuration type via the &lt;code&gt;launchDelegates&lt;/code&gt; extension.
</documentation>
<appInfo>
<meta.attribute kind="java" basedOn="org.eclipse.debug.core.model.ILaunchConfigurationDelegate"/>
</appInfo>
</annotation>
</attribute>
- <attribute name="modes" type="string" use="required">
+ <attribute name="modes" type="string">
<annotation>
<documentation>
- specifies a comma-separated list of the modes this type of lauch configuration supports - &quot;run&quot; and/or &quot;debug&quot;.
+ specifies a comma-separated list of the modes this type of lauch configuration supports - &quot;run&quot; and/or &quot;debug&quot;. Launch modes can also be contributed for a launch configuration type via the &lt;code&gt;launchDelegates&lt;/code&gt; extension.
</documentation>
</annotation>
</attribute>
@@ -106,6 +106,8 @@ Launch configuration instances of this type will delegate to instances of this c
<annotation>
<documentation>
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.
+
+With new API changes for 3.3M3 the sourcePathComputer id should be contributed via the &lt;code&gt;launchDelegates&lt;/code&gt; extension point
</documentation>
</annotation>
</attribute>
@@ -113,6 +115,8 @@ Launch configuration instances of this type will delegate to instances of this c
<annotation>
<documentation>
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.
+
+With new API changes for 3.3M3 the sourceLocatorId id should be contributed via the &lt;code&gt;launchDelegates&lt;/code&gt; extension point
</documentation>
</annotation>
</attribute>
@@ -126,6 +130,25 @@ Launch configuration instances of this type will delegate to instances of this c
</appInfo>
</annotation>
</attribute>
+ <attribute name="icon" type="string">
+ <annotation>
+ <documentation>
+ The id of the icon for this launch configuraiton type.
+
+since 3.3
+
+&lt;p&gt;
+&lt;strong&gt;EXPERIMENTAL&lt;/strong&gt;. This element has been added as
+part of a work in progress. There is no guarantee that this API will
+remain unchanged during the 3.3 release cycle. Please do not use this API
+without consulting with the Platform/Debug team.
+&lt;/p&gt;
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="resource"/>
+ </appInfo>
+ </annotation>
+ </attribute>
</complexType>
</element>
diff --git a/org.eclipse.debug.core/schema/launchDelegates.exsd b/org.eclipse.debug.core/schema/launchDelegates.exsd
index f2771cf3a..45a428e4a 100644
--- a/org.eclipse.debug.core/schema/launchDelegates.exsd
+++ b/org.eclipse.debug.core/schema/launchDelegates.exsd
@@ -46,7 +46,7 @@
</appInfo>
</annotation>
<complexType>
- <sequence>
+ <sequence minOccurs="0" maxOccurs="unbounded">
</sequence>
<attribute name="id" type="string" use="required">
<annotation>
@@ -55,6 +55,23 @@
</documentation>
</annotation>
</attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+ A human readable name for this delegate. This attribute was added in the 3.3. release.
+
+&lt;p&gt;
+&lt;strong&gt;EXPERIMENTAL&lt;/strong&gt;. This attribute has been added as
+part of a work in progress. There is no guarantee that this API will
+remain unchanged during the 3.3 release cycle. Please do not use this API
+without consulting with the Platform/Debug team.
+&lt;/p&gt;
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
<attribute name="delegate" type="string" use="required">
<annotation>
<documentation>
@@ -66,14 +83,14 @@ Launch configuration instances of this delegate&apos;s type will delegate to ins
</appInfo>
</annotation>
</attribute>
- <attribute name="modes" type="string" use="required">
+ <attribute name="modes" type="string">
<annotation>
<documentation>
- specifies a comma-separated list of the modes this lauch delegate supports.
+ A comma-separated list of the launch modes this lauch delegate supports.
</documentation>
</annotation>
</attribute>
- <attribute name="type" type="string" use="required">
+ <attribute name="type" type="string">
<annotation>
<documentation>
identifier of an existing launch configuration type that this launch delegate is capable of launching.
@@ -94,6 +111,20 @@ Launch configuration instances of this delegate&apos;s type will delegate to ins
</documentation>
</annotation>
</attribute>
+ <attribute name="options" type="string">
+ <annotation>
+ <documentation>
+ A comma-separated list of the launch options this launch delegate supports. This attribute was added in the 3.3 release.
+
+&lt;p&gt;
+&lt;strong&gt;EXPERIMENTAL&lt;/strong&gt;. This attribute has been added as
+part of a work in progress. There is no guarantee that this API will
+remain unchanged during the 3.3 release cycle. Please do not use this API
+without consulting with the Platform/Debug team.
+&lt;/p&gt;
+ </documentation>
+ </annotation>
+ </attribute>
</complexType>
</element>
@@ -127,6 +158,23 @@ Launch configuration instances of this delegate&apos;s type will delegate to ins
&lt;/p&gt;
In the example above, the specified launch delegate is contributed to launch Java applications in profile mode.
+
+The previous example has been deprecated as of 3.3M3, but left in for brevity. See the following example for new usage.
+
+&lt;p&gt;
+&lt;pre&gt;
+&lt;extension point=&quot;org.eclipse.debug.core.launchDelegates&quot;&gt;
+ &lt;launchDelegate
+ delegate=&quot;org.eclipse.jdt.launching.JavaLaunchDelegate&quot;
+ id=&quot;org.eclipse.jdt.launching.JavaLaunchDelegate&quot;
+ type=&quot;org.eclipse.jdt.launching.localJavaApplication&quot;
+ modes=&quot;profile&quot;&gt;
+ &lt;/launchDelegate&gt;
+ &lt;/extension&gt;
+&lt;/pre&gt;
+&lt;/p&gt;
+
+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.
</documentation>
</annotation>
diff --git a/org.eclipse.debug.core/schema/launchModes.exsd b/org.eclipse.debug.core/schema/launchModes.exsd
index a14503655..f9135c652 100644
--- a/org.eclipse.debug.core/schema/launchModes.exsd
+++ b/org.eclipse.debug.core/schema/launchModes.exsd
@@ -22,20 +22,6 @@
</documentation>
</annotation>
</attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
</complexType>
</element>
diff --git a/org.eclipse.debug.core/schema/launchOptions.exsd b/org.eclipse.debug.core/schema/launchOptions.exsd
index f9029829a..0e829c97e 100644
--- a/org.eclipse.debug.core/schema/launchOptions.exsd
+++ b/org.eclipse.debug.core/schema/launchOptions.exsd
@@ -8,6 +8,11 @@
<documentation>
This extension point is used to contribute launch options to the launch manager.
Launch options are used as modifiers when executing a launch configuration.
+
+&lt;p&gt;&lt;strong&gt;EXPERIMENTAL&lt;/strong&gt;. This method has been added as
+part of a work in progress. There is no guarantee that this API will
+remain unchanged during the 3.3 release cycle. Please do not use this API
+without consulting with the Platform/Debug team.&lt;/p&gt;
</documentation>
</annotation>
@@ -67,13 +72,6 @@ Launch options are used as modifiers when executing a launch configuration.
</documentation>
</annotation>
</attribute>
- <attribute name="option" type="string" use="required">
- <annotation>
- <documentation>
- the name of the option itself, described as one word all lowercase e.g. debug
- </documentation>
- </annotation>
- </attribute>
</complexType>
</element>
@@ -82,7 +80,7 @@ Launch options are used as modifiers when executing a launch configuration.
<meta.section type="since"/>
</appInfo>
<documentation>
- Eclipse 3.3 M2
+ 3.3
</documentation>
</annotation>
@@ -95,13 +93,12 @@ Launch options are used as modifiers when executing a launch configuration.
&lt;pre&gt;
&lt;extension point=&quot;org.eclipse.debug.core.launchOptions&quot;&gt;
&lt;launchOption
- id=&quot;org.eclipse.debug.core.debug&quot;
- label=&quot;Debug&quot;
- option=&quot;debug&quot;&gt;
+ id=&quot;trace&quot;
+ label=&quot;Trace&quot;&gt;
&lt;/launchOption&gt;
&lt;/extension&gt;
&lt;/pre&gt;
-&lt;/p&gt;
+&lt;/p&gt;
</documentation>
</annotation>
@@ -110,7 +107,7 @@ Launch options are used as modifiers when executing a launch configuration.
<meta.section type="apiInfo"/>
</appInfo>
<documentation>
- The name of a launch option must be a human readable form, as well the option attribute must be a single word all lowercase.
+
</documentation>
</annotation>
@@ -128,7 +125,7 @@ Launch options are used as modifiers when executing a launch configuration.
<meta.section type="copyright"/>
</appInfo>
<documentation>
- Copyright (c) 2003, 2005 IBM Corporation and others.&lt;br&gt;
+ Copyright (c) 2006 IBM Corporation and others.&lt;br&gt;
All rights reserved. This program and the accompanying materials are made
available under the terms of the Eclipse Public License v1.0 which
accompanies this distribution, and is available at

Back to the top