Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2003-05-14 16:59:13 -0400
committerDarin Wright2003-05-14 16:59:13 -0400
commitb141fc6fdf71e7599f9b9034f0a41ae8c09be697 (patch)
tree257babc28a6cf766afaeba184af9264071f87033
parent25b9e045fbdcff430080068d5888e8fe40211e23 (diff)
downloadeclipse.platform.debug-b141fc6fdf71e7599f9b9034f0a41ae8c09be697.tar.gz
eclipse.platform.debug-b141fc6fdf71e7599f9b9034f0a41ae8c09be697.tar.xz
eclipse.platform.debug-b141fc6fdf71e7599f9b9034f0a41ae8c09be697.zip
bug 34514 - Define New Launch Mode other than Run or Debug
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java16
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationType.java20
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchManager.java10
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ContributedDelegate.java120
-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.java9
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java109
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java76
-rw-r--r--org.eclipse.debug.core/doc/org_eclipse_debug_core.html2
-rw-r--r--org.eclipse.debug.core/doc/org_eclipse_debug_core_launchDelegates.html67
-rw-r--r--org.eclipse.debug.core/doc/org_eclipse_debug_core_launchModes.html56
-rw-r--r--org.eclipse.debug.core/plugin.properties2
-rw-r--r--org.eclipse.debug.core/plugin.xml7
-rw-r--r--org.eclipse.debug.core/schema/launchDelegates.exsd133
-rw-r--r--org.eclipse.debug.core/schema/launchModes.exsd105
15 files changed, 710 insertions, 25 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
index dc51d8a55..6fcdf732a 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
@@ -93,6 +93,22 @@ public class DebugPlugin extends Plugin {
* @since 2.0
*/
public static final String EXTENSION_POINT_SOURCE_LOCATORS= "sourceLocators"; //$NON-NLS-1$
+
+ /**
+ * Simple identifier constant (value <code>"launchModes"</code>) for the
+ * source modes extension point.
+ *
+ * @since 3.0
+ */
+ public static final String EXTENSION_POINT_LAUNCH_MODES= "launchModes"; //$NON-NLS-1$
+
+ /**
+ * Simple identifier constant (value <code>"launchDelegates"</code>) for the
+ * launch delegates extension point.
+ *
+ * @since 3.0
+ */
+ public static final String EXTENSION_POINT_LAUNCH_DELEGATES= "launchDelegates"; //$NON-NLS-1$
/**
* Status code indicating an unexpected internal error.
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 d1bd65a9c..cab83f98a 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
@@ -127,16 +127,32 @@ public interface ILaunchConfigurationType extends IAdaptable {
/**
* Returns the launch configuration delegate for launch
- * configurations of this type. The first time this method
- * is called, the delegate is instantiated.
+ * configurations of this type, for <code>run</code> mode.
+ * The first time this method is called, the delegate is instantiated.
*
* @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;
/**
+ * Returns the launch configuration delegate for launch
+ * configurations of this type, for the specified mode. The first time
+ * this method is called for a mode, the delegate is instantiated.
+ * Launch delegates may be contributed to a launch configuration type
+ * via the extension point <code>org.eclipse.debug.core.launchDelegates</code>
+ *
+ * @param mode launch mode
+ * @return launch configuration delegate
+ * @exception CoreException if unable to instantiate the
+ * delegate
+ * @since 3.0
+ */
+ public ILaunchConfigurationDelegate getDelegate(String mode) throws CoreException;
+
+ /**
* Returns this launch configuration type's category, or <code>null</code>
* if unspecified. This corresponds to the category attribute specified in
* the extension definition.
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 9069256b1..b4ebed099 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
@@ -290,7 +290,15 @@ public interface ILaunchManager {
* result of a move
* @since 2.1
*/
- public ILaunchConfiguration getMovedTo(ILaunchConfiguration removedConfiguration);
+ public ILaunchConfiguration getMovedTo(ILaunchConfiguration removedConfiguration);
+
+ /**
+ * Returns all registered launch modes.
+ *
+ * @return all registered launch modes
+ * @since 3.0
+ */
+ public String[] getLaunchModes();
}
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
new file mode 100644
index 000000000..260143578
--- /dev/null
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ContributedDelegate.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.core;
+
+import java.text.MessageFormat;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+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);
+ }
+ StringTokenizer tokenizer= new StringTokenizer(modes, ","); //$NON-NLS-1$
+ fModes = new HashSet(tokenizer.countTokens());
+ while (tokenizer.hasMoreTokens()) {
+ fModes.add(tokenizer.nextToken().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.getString("LaunchConfigurationType.Launch_delegate_for_{0}_does_not_implement_required_interface_ILaunchConfigurationDelegate._1"), new String[]{getIdentifier()}), null)); //$NON-NLS-1$
+ }
+ }
+ return fDelegate;
+ }
+
+ /**
+ * Returns the identifier of this extension point.
+ */
+ protected String getIdentifier() {
+ return getConfigurationElement().getAttribute("id"); //$NON-NLS-1$
+ }
+}
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 fed348257..8f5eccc01 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
@@ -63,6 +63,7 @@ LaunchManager.Invalid_launch_configuration_comparator_extension_defined_by_plug-
LaunchManager.An_exception_occurred_during_launch_change_notification._1=An exception occurred during launch change notification.
LaunchManager.An_exception_occurred_during_launch_change_notification._2=An exception occurred during launch change notification.
LaunchManager.An_exception_occurred_during_launch_configuration_change_notification._3=An exception occurred during launch configuration change notification.
+LaunchManager.27=Invalid launch mode extension defined by plug-in {0} - mode not specified
OutputStreamMonitor.label=Output Stream Monitor
@@ -75,3 +76,5 @@ ExpressionManager.An_exception_occurred_during_expression_change_notification._1
ExpressionManager.An_exception_occurred_during_expression_change_notification._2=An exception occurred during expression change notification.
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}
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 3df5694e2..64b2bd972 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
@@ -144,7 +144,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
*/
public ILaunch launch(String mode, IProgressMonitor monitor) throws CoreException {
// bug 28245 - force the delegate to load in case it is interested in launch notifications
- ILaunchConfigurationDelegate delegate= getDelegate();
+ ILaunchConfigurationDelegate delegate= getDelegate(mode);
ILaunch launch = new Launch(this, mode, null);
getLaunchManager().addLaunch(launch);
@@ -358,14 +358,15 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/**
* Returns the launch configuration delegate for this
- * launch configuration.
+ * 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() throws CoreException {
- return ((LaunchConfigurationType)getType()).getDelegate();
+ protected ILaunchConfigurationDelegate getDelegate(String mode) throws CoreException {
+ return getType().getDelegate(mode);
}
/**
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 8ad13f48a..eb1eb1e06 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
@@ -13,6 +13,10 @@ package org.eclipse.debug.internal.core;
import java.text.MessageFormat;
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;
@@ -25,6 +29,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
/**
@@ -40,15 +45,22 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
private IConfigurationElement fElement;
/**
- * Modes this type supports.
+ * Base modes this type supports.
*/
- private Set fModes;
+ private Set fBaseModes;
/**
- * The delegate for launch configurations of this type.
- * Delegates are instantiated lazily as required.
+ * Modes that delegates have been contributed for
*/
- private ILaunchConfigurationDelegate fDelegate;
+ private Set fContributedModes;
+
+ /**
+ * 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
+ */
+ private Map fDelegates;
/**
* Constructs a new launch configuration type on the
@@ -83,7 +95,7 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
* @see ILaunchConfigurationType#supportsMode(String)
*/
public boolean supportsMode(String mode) {
- return getModes().contains(mode);
+ return getBaseModes().contains(mode) || getContributedModes().contains(mode);
}
/**
@@ -91,22 +103,43 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
*
* @return the set of modes specified in the configuration data
*/
- protected Set getModes() {
- if (fModes == null) {
+ 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$
- fModes = new HashSet(tokenizer.countTokens());
+ fBaseModes = new HashSet(tokenizer.countTokens());
while (tokenizer.hasMoreTokens()) {
- fModes.add(tokenizer.nextToken().trim());
+ fBaseModes.add(tokenizer.nextToken().trim());
}
}
- return fModes;
+ return fBaseModes;
}
/**
+ * 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;
+ }
+
+ /**
* @see ILaunchConfigurationType#getName()
*/
public String getName() {
@@ -167,15 +200,57 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
* delegate
*/
public ILaunchConfigurationDelegate getDelegate() throws CoreException {
- if (fDelegate == null) {
- Object delegate = getConfigurationElement().createExecutableExtension("delegate"); //$NON-NLS-1$
- if (delegate instanceof ILaunchConfigurationDelegate) {
- fDelegate = (ILaunchConfigurationDelegate)delegate;
+ return getDelegate(ILaunchManager.RUN_MODE);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchConfigurationType#getDelegate(java.lang.String)
+ */
+ public ILaunchConfigurationDelegate getDelegate(String mode) throws CoreException {
+ if (!supportsMode(mode)) {
+ throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.getString("LaunchConfigurationType.9"), new String[] {mode, getIdentifier()}), null)); //$NON-NLS-1$
+ }
+ if (fDelegates == null) {
+ // initialize delegate table with base modes
+ fDelegates = new Hashtable(3);
+ }
+ 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;
+ } else {
+ throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.getString("LaunchConfigurationType.Launch_delegate_for_{0}_does_not_implement_required_interface_ILaunchConfigurationDelegate._1"), new String[]{getName()}), null)); //$NON-NLS-1$
+ }
} else {
- throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.getString("LaunchConfigurationType.Launch_delegate_for_{0}_does_not_implement_required_interface_ILaunchConfigurationDelegate._1"), new String[]{getName()}), null)); //$NON-NLS-1$
+ // 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 = (ILaunchConfigurationDelegate)contributedDelegate.getDelegate();
+ Iterator modesIterator = modes.iterator();
+ while (modesIterator.hasNext()) {
+ fDelegates.put(modesIterator.next(), delegate);
+ }
+ return delegate;
+ }
+ }
+ }
}
+ } else {
+ return delegate;
}
- return fDelegate;
+ throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.getString("LaunchConfigurationType.10"), new String[] {getIdentifier(), mode}), null)); //$NON-NLS-1$
}
}
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 0703316c3..066dd8c83 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
@@ -114,6 +114,17 @@ public class LaunchManager implements ILaunchManager, IResourceChangeListener {
private Map fComparators = null;
/**
+ * Registered launch modes, or <code>null</code> if not initialized.
+ */
+ private String[] fLaunchModes = null;
+
+ /**
+ * List of contributed launch delegates (delegates contributed for existing
+ * launch configuration types).
+ */
+ private List fContributedDelegates = null;
+
+ /**
* Types of notifications
*/
public static final int ADDED = 0;
@@ -619,6 +630,34 @@ public class LaunchManager implements ILaunchManager, IResourceChangeListener {
}
/**
+ * Initializes contributed launch delegates (i.e. delegates contributed
+ * to an existing launch configuration type).
+ */
+ private void initializeContributedDelegates() {
+ IPluginDescriptor descriptor= DebugPlugin.getDefault().getDescriptor();
+ IExtensionPoint extensionPoint= descriptor.getExtensionPoint(DebugPlugin.EXTENSION_POINT_LAUNCH_DELEGATES);
+ IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
+ fContributedDelegates= new ArrayList(infos.length);
+ for (int i= 0; i < infos.length; i++) {
+ IConfigurationElement configurationElement = infos[i];
+ ContributedDelegate delegate = new ContributedDelegate(configurationElement);
+ fContributedDelegates.add(delegate);
+ }
+ }
+
+ /**
+ * Returns a list of launch delegates contributed for existing launch configuration
+ * types.
+ *
+ * @return list of ContributedDelegate
+ */
+ protected List getContributedDelegates() {
+ if (fContributedDelegates == null) {
+ initializeContributedDelegates();
+ }
+ return fContributedDelegates;
+ }
+ /**
* Notifies the launch manager that a launch configuration
* has been deleted. The configuration is removed from the
* cache of info's and from the index of configurations by
@@ -1406,5 +1445,40 @@ public class LaunchManager implements ILaunchManager, IResourceChangeListener {
fConfiguration = null;
fListener = null;
}
- }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchManager#getLaunchModes()
+ */
+ public String[] getLaunchModes() {
+ if (fLaunchModes == null) {
+ initializeLaunchModes();
+ }
+ return fLaunchModes;
+ }
+
+ /**
+ * Load comparator extensions.
+ *
+ * @exception CoreException if an exception occurrs reading
+ * the extensions
+ */
+ private void initializeLaunchModes() {
+ IPluginDescriptor descriptor= DebugPlugin.getDefault().getDescriptor();
+ IExtensionPoint extensionPoint= descriptor.getExtensionPoint(DebugPlugin.EXTENSION_POINT_LAUNCH_MODES);
+ IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
+ fLaunchModes = new String[infos.length];
+ for (int i= 0; i < infos.length; i++) {
+ IConfigurationElement configurationElement = infos[i];
+ String mode = configurationElement.getAttribute("mode"); //$NON-NLS-1$
+ if (mode != null) {
+ fLaunchModes[i]= mode;
+ } else {
+ // invalid lauch mode
+ IStatus s = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.INTERNAL_ERROR,
+ MessageFormat.format(DebugCoreMessages.getString("LaunchManager.27"), new String[] {configurationElement.getDeclaringExtension().getDeclaringPluginDescriptor().getUniqueIdentifier()}), null); //$NON-NLS-1$
+ DebugPlugin.log(s);
+ }
+ }
+ }
}
diff --git a/org.eclipse.debug.core/doc/org_eclipse_debug_core.html b/org.eclipse.debug.core/doc/org_eclipse_debug_core.html
index 577598207..a8c77929a 100644
--- a/org.eclipse.debug.core/doc/org_eclipse_debug_core.html
+++ b/org.eclipse.debug.core/doc/org_eclipse_debug_core.html
@@ -30,6 +30,8 @@ breakpoint management, expression management, and program launching.<br>
<li><a href="org_eclipse_debug_core_breakpoints.html">org.eclipse.debug.core.breakpoints</a></li>
<li><a href="org_eclipse_debug_core_launchConfigurationComparators.html">org.eclipse.debug.core.launchConfigurationComparators</a></li>
<li><a href="org_eclipse_debug_core_launchConfigurationTypes.html">org.eclipse.debug.core.launchConfigurationTypes</a></li>
+ <li><a href="org_eclipse_debug_core_launchDelegates.html">org.eclipse.debug.core.launchDelegates</a></li>
+ <li><a href="org_eclipse_debug_core_launchModes.html">org.eclipse.debug.core.launchModes</a></li>
<li><a href="org_eclipse_debug_core_sourceLocators.html">org.eclipse.debug.core.sourceLocators</a></li>
<li><a href="org_eclipse_debug_core_statusHandlers.html">org.eclipse.debug.core.statusHandlers</a></li>
</ul>
diff --git a/org.eclipse.debug.core/doc/org_eclipse_debug_core_launchDelegates.html b/org.eclipse.debug.core/doc/org_eclipse_debug_core_launchDelegates.html
new file mode 100644
index 000000000..59ea6cc77
--- /dev/null
+++ b/org.eclipse.debug.core/doc/org_eclipse_debug_core_launchDelegates.html
@@ -0,0 +1,67 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HEAD><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<STYLE type="text/css">
+div.dtd-fragment {
+ width: 100%;
+ border: none;
+ background-color: #eee;
+}
+</STYLE>
+</HEAD>
+<HTML>
+<BODY>
+<H1><CENTER>Launch Delegates</CENTER></H1>
+<b><i>Identifier: </i></b>org.eclipse.debug.core.launchDelegates<p>
+<b><i>Description: </i></b>This extension point provides a mechanism for contributing a launch delegate to an existing launch configuration type for one or more launch mode. Since launch modes are extensisble, it may be neccessary to contribute additional launch delegates to an existing launch configuration type. Each launch delegate is contributed for a specific launch configuration type. A launch delegate supports one or more launch modes, and specifies a delegate responsible for the implementation of launching.<p><b><i>Configuration Markup:</i></b><p>
+<p><samp><font color="#800000">&nbsp;&nbsp; &lt;!ELEMENT <a name="e.extension">extension</a> (<a href="#e.launchDelegate">launchDelegate</a>*)&gt;</font></samp>
+<br><br><samp><font color="#800000">&nbsp;&nbsp; &lt;!ATTLIST extension</samp>
+<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;point&nbsp;CDATA #REQUIRED</samp>
+<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</samp>
+<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name&nbsp;&nbsp;CDATA #IMPLIED</samp>
+<br><samp>&nbsp;&nbsp; &gt;</font></samp>
+<ul>
+<li><b>point</b> - a fully qualified identifier of the target extension point</li>
+<li><b>id</b> - an optional identifier of the extension instance</li>
+<li><b>name</b> - an optional name of the extension instance</li>
+</ul>
+<p><samp><font color="#800000">&nbsp;&nbsp; &lt;!ELEMENT <a name="e.launchDelegate">launchDelegate</a> EMPTY&gt;</font></samp>
+<br><br><samp><font color="#800000">&nbsp;&nbsp; &lt;!ATTLIST launchDelegate</samp>
+<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</samp>
+<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;delegate&nbsp;CDATA #REQUIRED</samp>
+<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;modes&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</samp>
+<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</samp>
+<br><samp>&nbsp;&nbsp; &gt;</font></samp>
+<ul>
+<li><b>id</b> - specifies a unique identifier for this launch delegate.</li>
+<li><b>delegate</b> - specifies the fully qualified name of the Java class that implements <samp>ILaunchConfigurationDelegate</samp>.
+Launch configuration instances of this delegate's type will delegate to instances of this class to perform launching.</li>
+<li><b>modes</b> - specifies a comma-separated list of the modes this lauch delegate supports.</li>
+<li><b>type</b> - identifier of an existing launch configuration type that this launch delegate is capable of launching.</li>
+</ul>
+<b><i>Examples: </i></b>The following is an example of a launch delegate extension point:
+
+<p>
+<pre>
+ <font color="#000080">&lt;extension point=<font color="#008000">&quot;org.eclipse.debug.core.launchDelegates&quot;</font>&gt;</font>
+ <font color="#000080">&lt;launchDelegate
+ id=<font color="#008000">&quot;com.example.ExampleProfileDelegate&quot;</font>
+ delegate=<font color="#008000">&quot;com.example.ExampleProfileDelegate&quot;</font>
+ type=<font color="#008000">&quot;org.eclipse.jdt.launching.localJavaApplication&quot;</font>
+ modes=<font color="#008000">&quot;profile&quot;</font>&gt;</font>
+ <font color="#000080">&lt;/launchDelegate&gt;</font>
+ <font color="#000080">&lt;/extension&gt;</font>
+</pre>
+</p>
+
+In the example above, the specified launch delegate is contributed to launch Java applications in profile mode.<p>
+<b><i>API Information: </i></b>Value of the attribute <b>delegate</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.debug.core.model.ILaunchConfigurationDelegate</b>.<p>
+<font size="-1" color="#336699">
+<p>
+<a href="hglegal.htm">
+ <img SRC="ngibmcpy.gif"
+ ALT="Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved."
+ BORDER=0 height=14 width=324></a>
+</p><p>
+</font>
+</BODY>
+</HTML>
diff --git a/org.eclipse.debug.core/doc/org_eclipse_debug_core_launchModes.html b/org.eclipse.debug.core/doc/org_eclipse_debug_core_launchModes.html
new file mode 100644
index 000000000..c8f65472f
--- /dev/null
+++ b/org.eclipse.debug.core/doc/org_eclipse_debug_core_launchModes.html
@@ -0,0 +1,56 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HEAD><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<STYLE type="text/css">
+div.dtd-fragment {
+ width: 100%;
+ border: none;
+ background-color: #eee;
+}
+</STYLE>
+</HEAD>
+<HTML>
+<BODY>
+<H1><CENTER>Launch Modes</CENTER></H1>
+<b><i>Identifier: </i></b>org.eclipse.debug.core.launchModes<p>
+<b><i>Description: </i></b>This extension point provides a mechanism for contributing launch modes to the debug platform. The debug platform defines modes for "run", "debug", and "profile".<p><b><i>Configuration Markup:</i></b><p>
+<p><samp><font color="#800000">&nbsp;&nbsp; &lt;!ELEMENT <a name="e.extension">extension</a> (<a href="#e.launchMode">launchMode</a>*)&gt;</font></samp>
+<br><br><samp><font color="#800000">&nbsp;&nbsp; &lt;!ATTLIST extension</samp>
+<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;point&nbsp;CDATA #REQUIRED</samp>
+<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</samp>
+<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name&nbsp;&nbsp;CDATA #IMPLIED</samp>
+<br><samp>&nbsp;&nbsp; &gt;</font></samp>
+<ul>
+<li><b>point</b> - a fully qualified identifier of the target extension point</li>
+<li><b>id</b> - an optional identifier of the extension instance</li>
+<li><b>name</b> - an optional name of the extension instance</li>
+</ul>
+<p><samp><font color="#800000">&nbsp;&nbsp; &lt;!ELEMENT <a name="e.launchMode">launchMode</a> EMPTY&gt;</font></samp>
+<br><br><samp><font color="#800000">&nbsp;&nbsp; &lt;!ATTLIST launchMode</samp>
+<br><samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mode&nbsp;CDATA #REQUIRED</samp>
+<br><samp>&nbsp;&nbsp; &gt;</font></samp>
+<ul>
+<li><b>mode</b> - specifies a unique identifier for this launch mode. The launch modes contributed by the debug plaform are "run", "debug", and "profile".</li>
+</ul>
+<b><i>Examples: </i></b>The following is an example of a launch delegate extension point:
+
+<p>
+<pre>
+ <font color="#000080">&lt;extension point=<font color="#008000">&quot;org.eclipse.debug.core.launchModes&quot;</font>&gt;</font>
+ <font color="#000080">&lt;launchMode
+ mode=<font color="#008000">&quot;profile&quot;</font>&gt;</font>
+ <font color="#000080">&lt;/launchMode&gt;</font>
+ <font color="#000080">&lt;/extension&gt;</font>
+</pre>
+</p>
+
+In the example above, the profile launch mode is contributed.<p>
+<font size="-1" color="#336699">
+<p>
+<a href="hglegal.htm">
+ <img SRC="ngibmcpy.gif"
+ ALT="Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved."
+ BORDER=0 height=14 width=324></a>
+</p><p>
+</font>
+</BODY>
+</HTML>
diff --git a/org.eclipse.debug.core/plugin.properties b/org.eclipse.debug.core/plugin.properties
index a32a8f461..370c25eef 100644
--- a/org.eclipse.debug.core/plugin.properties
+++ b/org.eclipse.debug.core/plugin.properties
@@ -17,3 +17,5 @@ launchConfigurationTypeNameExtensionPointName=Launch Configuration Type
launchConfigurationComparatorsExtensionPointName=Launch Configuration Comparators
statusHandlerExtensionPointName=Status Handler
sourceLocatorsExtensionPointName=Source Locator
+launchModesExtensionPointName=Launch Modes
+launchDelegatesExtensionPointName=Launch Delegates
diff --git a/org.eclipse.debug.core/plugin.xml b/org.eclipse.debug.core/plugin.xml
index e529f6df1..aa43462e3 100644
--- a/org.eclipse.debug.core/plugin.xml
+++ b/org.eclipse.debug.core/plugin.xml
@@ -24,6 +24,8 @@
<extension-point id="breakpoints" name="%breakpointExtensionPointName" schema= "schema/breakpoints.exsd"/>
<extension-point id="launchConfigurationComparators" name="%launchConfigurationComparatorsExtensionPointName" schema= "schema/launchConfigurationComparators.exsd"/>
<extension-point id="launchConfigurationTypes" name="%launchConfigurationTypeNameExtensionPointName" schema= "schema/launchConfigurationTypes.exsd"/>
+<extension-point id="launchModes" name="%launchModesExtensionPointName" schema= "schema/launchModes.exsd"/>
+<extension-point id="launchDelegates" name="%launchDelegatesExtensionPointName" schema= "schema/launchDelegates.exsd"/>
<extension-point id="launchers" name="%launcherExtensionPointName" schema= "schema/launchers.exsd"/>
<extension-point id="sourceLocators" name="%sourceLocatorsExtensionPointName" schema= "schema/sourceLocators.exsd"/>
<extension-point id="statusHandlers" name="%statusHandlerExtensionPointName" schema= "schema/statusHandlers.exsd"/>
@@ -47,4 +49,9 @@
<fileTypes extension="launch" type="text"/>
</extension>
+<extension point="org.eclipse.debug.core.launchModes">
+ <launchMode mode="run"/>
+ <launchMode mode="debug"/>
+</extension>
+
</plugin>
diff --git a/org.eclipse.debug.core/schema/launchDelegates.exsd b/org.eclipse.debug.core/schema/launchDelegates.exsd
new file mode 100644
index 000000000..65c56670a
--- /dev/null
+++ b/org.eclipse.debug.core/schema/launchDelegates.exsd
@@ -0,0 +1,133 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.debug.core">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.debug.core" id="launchDelegates" name="Launch Delegates"/>
+ </appInfo>
+ <documentation>
+ This extension point provides a mechanism for contributing a launch delegate to an existing launch configuration type for one or more launch mode. Since launch modes are extensisble, it may be neccessary to contribute additional launch delegates to an existing launch configuration type. Each launch delegate is contributed for a specific launch configuration type. A launch delegate supports one or more launch modes, and specifies a delegate responsible for the implementation of launching.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence>
+ <element ref="launchDelegate" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+ a fully qualified identifier of the target extension point
+ </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>
+
+ <element name="launchDelegate">
+ <annotation>
+ <appInfo>
+ <meta.element labelAttribute="name"/>
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ </sequence>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ specifies a unique identifier for this launch delegate.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="delegate" type="string" use="required">
+ <annotation>
+ <documentation>
+ specifies the fully qualified name of the Java class that implements &lt;samp&gt;ILaunchConfigurationDelegate&lt;/samp&gt;.
+Launch configuration instances of this delegate&apos;s type will delegate to instances of this class to perform launching.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.debug.core.model.ILaunchConfigurationDelegate"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="modes" type="string" use="required">
+ <annotation>
+ <documentation>
+ specifies a comma-separated list of the modes this lauch delegate supports.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="type" type="string" use="required">
+ <annotation>
+ <documentation>
+ identifier of an existing launch configuration type that this launch delegate is capable of launching.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ The following is an example of a launch delegate extension point:
+
+&lt;p&gt;
+&lt;pre&gt;
+ &lt;extension point=&quot;org.eclipse.debug.core.launchDelegates&quot;&gt;
+ &lt;launchDelegate
+ id=&quot;com.example.ExampleProfileDelegate&quot;
+ delegate=&quot;com.example.ExampleProfileDelegate&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 the example above, the specified launch delegate is contributed to launch Java applications in profile mode.
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ Value of the attribute &lt;b&gt;delegate&lt;/b&gt; must be a fully qualified name of a Java class that implements the interface &lt;b&gt;org.eclipse.debug.core.model.ILaunchConfigurationDelegate&lt;/b&gt;.
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ &lt;p&gt;
+&lt;a href=&quot;hglegal.htm&quot;&gt;
+ &lt;img SRC=&quot;ngibmcpy.gif&quot;
+ ALT=&quot;Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved.&quot;
+ BORDER=0 height=14 width=324&gt;&lt;/a&gt;
+&lt;/p&gt;
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/org.eclipse.debug.core/schema/launchModes.exsd b/org.eclipse.debug.core/schema/launchModes.exsd
new file mode 100644
index 000000000..e82bdefe6
--- /dev/null
+++ b/org.eclipse.debug.core/schema/launchModes.exsd
@@ -0,0 +1,105 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.debug.core">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.debug.core" id="launchModes" name="Launch Modes"/>
+ </appInfo>
+ <documentation>
+ This extension point provides a mechanism for contributing launch modes to the debug platform. The debug platform defines modes for &quot;run&quot;, &quot;debug&quot;, and &quot;profile&quot;.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence>
+ <element ref="launchMode" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+ a fully qualified identifier of the target extension point
+ </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>
+
+ <element name="launchMode">
+ <annotation>
+ <appInfo>
+ <meta.element labelAttribute="name"/>
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ </sequence>
+ <attribute name="mode" type="string" use="required">
+ <annotation>
+ <documentation>
+ specifies a unique identifier for this launch mode. The launch modes contributed by the debug plaform are &quot;run&quot;, &quot;debug&quot;, and &quot;profile&quot;.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ The following is an example of a launch delegate extension point:
+
+&lt;p&gt;
+&lt;pre&gt;
+ &lt;extension point=&quot;org.eclipse.debug.core.launchModes&quot;&gt;
+ &lt;launchMode
+ mode=&quot;profile&quot;&gt;
+ &lt;/launchMode&gt;
+ &lt;/extension&gt;
+&lt;/pre&gt;
+&lt;/p&gt;
+
+In the example above, the profile launch mode is contributed.
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ &lt;p&gt;
+&lt;a href=&quot;hglegal.htm&quot;&gt;
+ &lt;img SRC=&quot;ngibmcpy.gif&quot;
+ ALT=&quot;Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved.&quot;
+ BORDER=0 height=14 width=324&gt;&lt;/a&gt;
+&lt;/p&gt;
+ </documentation>
+ </annotation>
+
+</schema>

Back to the top