Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2006-10-19 21:37:53 +0000
committerDarin Wright2006-10-19 21:37:53 +0000
commit3deb7efd0af505da4f7e7fc2d6f1bc410dcefc06 (patch)
tree897a6d639fd1035eaa8fd7a408a95a06f313ac5a
parentaa6dc4adb3144ae3f32efe69fd2026d5a14aeb03 (diff)
downloadeclipse.platform.debug-3deb7efd0af505da4f7e7fc2d6f1bc410dcefc06.tar.gz
eclipse.platform.debug-3deb7efd0af505da4f7e7fc2d6f1bc410dcefc06.tar.xz
eclipse.platform.debug-3deb7efd0af505da4f7e7fc2d6f1bc410dcefc06.zip
Bug 157059 [launching] extensible launch options
-rw-r--r--org.eclipse.debug.core/component.xml1
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfiguration.java12
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationType.java48
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java39
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchManager.java29
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchOption.java49
-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.properties1
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java55
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java118
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java25
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchDelegate.java64
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java192
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchOption.java49
-rw-r--r--org.eclipse.debug.core/plugin.properties1
-rw-r--r--org.eclipse.debug.core/plugin.xml1
-rw-r--r--org.eclipse.debug.core/schema/launchDelegates.exsd23
-rw-r--r--org.eclipse.debug.core/schema/launchOptions.exsd136
-rw-r--r--org.eclipse.debug.ui/component.xml2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java27
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java29
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchOptionsDialog.java)11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchModeConfigurationTab.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractOptionLaunchConfigurationTab.java)22
25 files changed, 350 insertions, 596 deletions
diff --git a/org.eclipse.debug.core/component.xml b/org.eclipse.debug.core/component.xml
index 71f9b8953..3fe9c5c8a 100644
--- a/org.eclipse.debug.core/component.xml
+++ b/org.eclipse.debug.core/component.xml
@@ -29,7 +29,6 @@
<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 06504c866..5590f7999 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
@@ -326,9 +326,13 @@ public interface ILaunchConfiguration extends IAdaptable {
public String getName();
/**
- * Returns this configuration's launch options.
- *
- * @return this configuration's launch options
+ * Returns the launch modes that have been set on this configuration.
+ * <p>
+ * Setting launch modes on a configuration allows a launch to be
+ * performed in mixed mode - for example, debug and profile at the
+ * same time.
+ * </p>
+ * @return this configuration's launch modes
*
* <p>
* <strong>EXPERIMENTAL</strong>. This method has been added as
@@ -338,7 +342,7 @@ public interface ILaunchConfiguration extends IAdaptable {
* </p>
* @since 3.3
*/
- public Set getOptions() throws CoreException;
+ public Set getModes() throws CoreException;
/**
* Returns the type of this launch configuration. This is a
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 6422ce71d..92df3b660 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,19 +126,18 @@ 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.
- *
+ * @deprecated since 3.3, the method <code>getDelegates(Set)</code> should be used
+ * instead, as there can be more than one capable delegate per mode or combination
+ * of modes
*/
public ILaunchConfigurationDelegate getDelegate(String mode) throws CoreException;
/**
- * Returns the launch delegate for the specified mode and options.
+ * Returns the launch delegates capable of launching in the specified modes.
*
- * @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
+ * @param modes set of launch modes
+ * @return the <code>ILaunchConfigurationDelegate</code>s capable of launching
+ * in the specified modes or an empty collection if none
* @throws CoreException
* @since 3.3
*
@@ -149,7 +148,38 @@ public interface ILaunchConfigurationType extends IAdaptable {
* without consulting with the Platform/Debug team.
* </p>
*/
- public ILaunchConfigurationDelegate getDelegate(String mode, Set options) throws CoreException;
+ public ILaunchConfigurationDelegate[] getDelegates(Set modes) throws CoreException;
+
+ /**
+ * Returns a collection of all supported launch mode combinations for
+ * this launch configuration type.
+ *
+ * @return all supported launch mode combinations
+ * @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 Set[] getSupportedModeCombinations();
+
+ /**
+ * Returns whether this launch configuration supports the specified launch
+ * mode combination.
+ *
+ * @param modes launch mode combination
+ * @return whether the launch mode combination is supported
+ * @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 boolean supportsModeCombination(Set modes);
/**
* Returns the unique identifier for this type of launch configuration
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 7770c4105..232ac1ef4 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
@@ -183,13 +183,14 @@ public interface ILaunchConfigurationWorkingCopy extends ILaunchConfiguration, I
public void setMappedResources(IResource[] resources);
/**
- * Set the launch options for this configuration.
- * Over-writes existing launch options.
+ * Set the launch modes for this configuration.
+ * Over-writes existing launch modes.
* <p>
- * If the specified list of options is empty or <code>null</code>,
- * the 'options' attribute is removed from the launch configuration altogether
+ * Setting launch modes on a configuration allows the configuration to
+ * be launched in a mixed mode - for example, debug and profile.
* </p>
- * @param new launch options or <code>null</code>
+ * @param modes launch mode identifiers to set on this configuration
+ * or <code>null</code> to clear mode settings
*
* <p>
* <strong>EXPERIMENTAL</strong>. This method has been added as
@@ -199,13 +200,16 @@ public interface ILaunchConfigurationWorkingCopy extends ILaunchConfiguration, I
* </p>
* @since 3.3
*/
- public void setOptions(Set options);
+ public void setModes(Set modes);
/**
- * 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
+ * Adds the specified launch modes to this configuration's settings.
+ * <p>
+ * Setting launch modes on a configuration allows the configuration to
+ * be launched in a mixed mode - for example, debug and profile.
+ * </p>
+ * @param modes launch mode identifiers to append to the current set of
+ * launch modes set on this configuration
*
* <p>
* <strong>EXPERIMENTAL</strong>. This method has been added as
@@ -215,13 +219,16 @@ public interface ILaunchConfigurationWorkingCopy extends ILaunchConfiguration, I
* </p>
* @since 3.3
*/
- public void addOptions(Set options);
+ public void addModes(Set modes);
/**
- * Removes the specified options from this configuration's existing options.
- *
- * @param options options to remove specified as a set of launch option
- * identifiers
+ * Removes the specified launch modes from this configuration's settings.
+ * <p>
+ * Setting launch modes on a configuration allows the configuration to
+ * be launched in a mixed mode - for example, debug and profile.
+ * </p>
+ * @param modes launch mode identifiers to remove from the current set of
+ * launch modes set on this configuration
*
* <p>
* <strong>EXPERIMENTAL</strong>. This method has been added as
@@ -231,5 +238,5 @@ public interface ILaunchConfigurationWorkingCopy extends ILaunchConfiguration, I
* </p>
* @since 3.3
*/
- public void removeOptions(Set options);
+ public void removeModes(Set modes);
}
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 9d8196f89..7cbf24ba6 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,35 +225,6 @@ public interface ILaunchManager {
public ILaunchMode[] getLaunchModes();
/**
- * 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
- * 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 ILaunchOption getLaunchOption(String optionId);
-
- /**
- * Returns all registered launch options.
- *
- * @return all registered 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 ILaunchOption[] getLaunchOptions();
-
- /**
* Returns a collection of launch configurations that required migration to be
* compatible with current tooling.
*
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
deleted file mode 100644
index 44a12bd87..000000000
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchOption.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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.core;
-
-/**
- * This interface describes a launch option.
- * Clients can contribute launch options via the <code>launchOptions</code> extension point.
- *
- * Example contribution of the debug launch option:
- * <pre>
- * &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>
- * <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
- * without consulting with the Platform/Debug team.
- * </p>
- * @since 3.3
- *
- */
-public interface ILaunchOption {
-
-
- /**
- * @return the human readable label for this launch option e.g. 'Debug'
- */
- public String getLabel();
-
- /**
- * @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/DebugCoreMessages.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java
index 4759d366a..7be1f3990 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
@@ -29,6 +29,8 @@ public class DebugCoreMessages extends NLS {
public static String LaunchConfigurationInfo_35;
+ public static String LaunchConfigurationType_7;
+
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 eae94f5df..1bbd21cae 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
@@ -64,6 +64,7 @@ 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_7=Launch mode not supported: {0}
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 1c11df460..9a8794336 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
@@ -45,7 +45,6 @@ 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;
@@ -86,17 +85,17 @@ 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.
+ * The launch modes set on this configuration.
*
* <p>
- * <strong>EXPERIMENTAL</strong>. This class has been added as
+ * <strong>EXPERIMENTAL</strong>. 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.
* </p>
* @since 3.3
*/
- public static final String ATTR_LAUNCH_OPTIONS = DebugPlugin.getUniqueIdentifier() + ".LAUNCH_OPTIONS"; //$NON-NLS-1$
+ public static final String ATTR_LAUNCH_MODES = DebugPlugin.getUniqueIdentifier() + ".LAUNCH_MODES"; //$NON-NLS-1$
/**
* Status handler to prompt in the UI thread
@@ -354,18 +353,6 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
return null;
}
- /**
- * 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, Set options) throws CoreException {
- return getType().getDelegate(mode, options);
- }
-
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#getFile()
*/
@@ -516,11 +503,8 @@ 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);
+ public Set getModes() throws CoreException {
+ Set options = getAttribute(ATTR_LAUNCH_MODES, (Set)null);
return (options != null ? new HashSet(options) : new HashSet(0));
}
@@ -614,19 +598,26 @@ 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
+ Set modes = getModes();
+ modes.add(mode);
+ ILaunchConfigurationDelegate[] delegates = getType().getDelegates(modes);
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);
+ if (delegates.length == 1) {
+ delegate = delegates[0];
+ } else if (delegates.length == 0) {
+ //IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(promptStatus);
+ //handler.handleStatus(delegateNotAvailable, new Object[] {this, mode});
+ // no delegates TODO:
+ IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
+ DebugPlugin.INTERNAL_ERROR, "No launch delegate", null); //$NON-NLS-1$
+ throw new CoreException(status);
+ } else {
+ // multiple delegates TODO:
+ IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
+ DebugPlugin.INTERNAL_ERROR, "Duplicate launch delegates", null); //$NON-NLS-1$
+ throw new CoreException(status);
}
+
ILaunchConfigurationDelegate2 delegate2 = null;
if (delegate instanceof ILaunchConfigurationDelegate2) {
delegate2 = (ILaunchConfigurationDelegate2) delegate;
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 14ee00256..e425c3dba 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,9 +11,12 @@
package org.eclipse.debug.internal.core;
+import java.util.ArrayList;
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;
@@ -29,6 +32,7 @@ import org.eclipse.debug.core.ILaunchConfigurationMigrationDelegate;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.core.ILaunchMode;
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
import org.eclipse.debug.core.sourcelookup.ISourcePathComputer;
@@ -81,7 +85,7 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
* 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 to delegate
+ * Map of modes (Set of modes) to list of delegates
*/
private Map fDelegates;
@@ -122,33 +126,80 @@ 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);
+ Set modes = new HashSet();
+ modes.add(mode);
+ ILaunchConfigurationDelegate[] delegates = getDelegates(modes);
+ if (delegates.length > 0) {
+ return delegates[0];
+ }
+ IStatus status = null;
+ ILaunchMode launchMode = DebugPlugin.getDefault().getLaunchManager().getLaunchMode(mode);
+ if (launchMode == null) {
+ status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
+ MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_7,
+ new String[]{mode}));
+ } else {
+ status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
+ MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_7,
+ new String[]{((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getLaunchModeName(mode)}));
+ }
+ throw new CoreException(status);
}
- /**
- * @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));
+ public ILaunchConfigurationDelegate[] getDelegates(Set modes) throws CoreException {
+ initializeDelegates();
+ Object[] theModes = modes.toArray();
+ for (int i = 0; i < theModes.length; i++) {
+ String mode = (String) theModes[i];
+ 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));
+ }
}
+ List delegates = (List) fDelegates.get(modes);
+ if (delegates == null) {
+ delegates = Collections.EMPTY_LIST;
+ }
+ ILaunchConfigurationDelegate[] result = new ILaunchConfigurationDelegate[delegates.size()];
+ for (int i = 0; i < result.length; i++) {
+ result[i] = ((LaunchDelegate)delegates.get(i)).getDelegate();
+ }
+ return result;
+ }
+
+ private synchronized void initializeDelegates() {
if (fDelegates == null) {
- // initialize delegate table with base modes
+ // initialize delegate
fDelegates = new Hashtable();
- }
- ILaunchConfigurationDelegate delegate = (ILaunchConfigurationDelegate)fDelegates.get(mode);
- if (delegate == null) {
- if(fModes.contains(mode)) {
- LaunchDelegate[] delegates = ((LaunchManager) DebugPlugin.getDefault().getLaunchManager()).getLaunchDelegates(getIdentifier(), mode, options);
- if(delegates.length > 0) {
- return delegates[0].getDelegate();
+ LaunchDelegate[] launchDelegates = getLaunchDelegateExtensions();
+ for (int i = 0; i < launchDelegates.length; i++) {
+ LaunchDelegate delegate = launchDelegates[i];
+ List combintaions = delegate.getModeCombinations();
+ Iterator iterator = combintaions.iterator();
+ while (iterator.hasNext()) {
+ Set combination = (Set) iterator.next();
+ registerDelegate(delegate, combination);
}
}
- }
- else {
- return delegate;
+ }
+ }
+
+ /**
+ * Returns all launch delegate extensions registered for this configuration type.
+ *
+ * @return all launch delegate extensions
+ */
+ private LaunchDelegate[] getLaunchDelegateExtensions() {
+ return ((LaunchManager) DebugPlugin.getDefault().getLaunchManager()).getLaunchDelegates(getIdentifier());
+ }
+
+ private void registerDelegate(LaunchDelegate delegate, Set modes) {
+ List delegatesForModes = (List) fDelegates.get(modes);
+ if (delegatesForModes == null) {
+ delegatesForModes = new ArrayList();
+ fDelegates.put(modes, delegatesForModes);
}
- throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_10, new String[] {getIdentifier(), mode}), null));
+ delegatesForModes.add(delegate);
}
/* (non-Javadoc)
@@ -185,7 +236,7 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
//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());
+ LaunchDelegate[] delegates = getLaunchDelegateExtensions();
for(int i = 0; i < delegates.length; i++) {
fSourceLocator = delegates[i].getSourceLocatorId();
if(fSourceLocator != null) {
@@ -216,7 +267,7 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
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());
+ LaunchDelegate[] delegates = getLaunchDelegateExtensions();
for(int i = 0; i < delegates.length; i++) {
id = delegates[i].getSourcePathComputerId();
if(id != null) {
@@ -240,11 +291,9 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
public Set getSupportedModes() {
if(fModes == null) {
fModes = new HashSet();
- LaunchDelegate[] delegates = ((LaunchManager) DebugPlugin.getDefault().getLaunchManager()).getLaunchDelegates();
+ LaunchDelegate[] delegates = getLaunchDelegateExtensions();
for(int i= 0; i < delegates.length; i++) {
- if(delegates[i].appliesTo(getIdentifier())) {
- fModes.addAll(delegates[i].getModes());
- }
+ fModes.addAll(delegates[i].getModes());
}
}
return fModes;
@@ -338,5 +387,22 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
public String getImageDescriptorPath() {
return fElement.getAttribute(IConfigurationElementConstants.ICON);
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchConfigurationType#getSupportedModeCombinations()
+ */
+ public Set[] getSupportedModeCombinations() {
+ initializeDelegates();
+ Set combinations = fDelegates.keySet();
+ return (Set[])combinations.toArray(new Set[combinations.size()]);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchConfigurationType#supportsModeCombination(java.util.Set)
+ */
+ public boolean supportsModeCombination(Set modes) {
+ initializeDelegates();
+ return fDelegates.containsKey(modes);
+ }
}
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 9de1c0dca..3ce3a3ad7 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
@@ -424,22 +424,16 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
}
}
- /**
- * @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));
+ public void setModes(Set options) {
+ getInfo().setAttribute(ATTR_LAUNCH_MODES, (options.size() > 0 ? options : null));
setDirty();
}
- /**
- * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#addOptions(java.util.Set)
- */
- public void addOptions(Set options) {
+ public void addModes(Set options) {
try {
- Set opts = getOptions();
+ Set opts = getModes();
if(opts.addAll(options)) {
- getInfo().setAttribute(ATTR_LAUNCH_OPTIONS, opts);
+ getInfo().setAttribute(ATTR_LAUNCH_MODES, opts);
setDirty();
}
}
@@ -448,14 +442,11 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
}
}
- /**
- * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#removeOptions(java.util.Set)
- */
- public void removeOptions(Set options) {
+ public void removeModes(Set options) {
try {
- Set opts = getOptions();
+ Set opts = getModes();
if(opts.removeAll(options)) {
- getInfo().setAttribute(ATTR_LAUNCH_OPTIONS, opts);
+ getInfo().setAttribute(ATTR_LAUNCH_MODES, opts);
setDirty();
}
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchDelegate.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchDelegate.java
index c9cd7081c..0e2907813 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchDelegate.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchDelegate.java
@@ -10,7 +10,11 @@
*******************************************************************************/
package org.eclipse.debug.internal.core;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
import java.util.Set;
import org.eclipse.core.runtime.CoreException;
@@ -75,9 +79,10 @@ public final class LaunchDelegate {
if(fDelegate == null) {
Object obj = fElement.createExecutableExtension(IConfigurationElementConstants.DELEGATE);
if(obj instanceof ILaunchConfigurationDelegate) {
- return (ILaunchConfigurationDelegate)obj;
+ fDelegate = (ILaunchConfigurationDelegate)obj;
+ } 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));
}
- 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;
}
@@ -169,22 +174,53 @@ public final class LaunchDelegate {
}
/**
- * Determines if the delegate applies to the specified launch configuration type via its id only (no expression evaluation is done)
- * @param configtypeId the id of the <code>ILaunchConfigurationType</code>.
- * @return true if the delegate applies to the associated config type, false otherwise
+ * Returns all combinations of supported options.
+ *
+ * @return combinations of supported options
*/
- public boolean appliesTo(String configtypeId) {
- return getLaunchConfigurationType().equals(configtypeId);
+ private Collection getOptionSets() {
+ Set optionSets = new HashSet();
+ optionSets.add(new HashSet()); // seed with the empty option set
+ Object[] options = getOptions().toArray();
+ boolean grew = false;
+ do {
+ grew = false;
+ Set[] sets = (Set[]) optionSets.toArray(new Set[optionSets.size()]);
+ for (int i = 0; i < sets.length; i++) {
+ Set optionSet = sets[i];
+ for (int j = 0; j < options.length; j++) {
+ Object option = options[j];
+ Set newOptionSet = new HashSet(optionSet);
+ if (newOptionSet.add(option)) {
+ if (optionSets.add(newOptionSet)) {
+ grew = true;
+ }
+ }
+ }
+ }
+ } while (grew);
+ return optionSets;
}
/**
- * Determines if the delegate applies to the specified launch configuration type via its id and mode (no expression evaluation is done)
- * @param configtypeId the id of the <code>ILaunchConfigurationType</code>.
- * @param mode the mode
- * @return true if the delegate applies to the associated config type, false otherwise
+ * Returns all supported launch mode combinations as sets of modes.
+ *
+ * @return all supported launch mode combinations
*/
- public boolean appliesTo(String configtypeId, String mode) {
- return getLaunchConfigurationType().equals(configtypeId) & getModes().contains(mode);
+ List getModeCombinations() {
+ Collection optionSets = getOptionSets();
+ Object[] modes = getModes().toArray();
+ List combinations = new ArrayList(optionSets.size() * modes.length);
+ Iterator iterator = optionSets.iterator();
+ while (iterator.hasNext()) {
+ Set optionSet = (Set) iterator.next();
+ for (int i = 0; i < modes.length; i++) {
+ Object mode = modes[i];
+ Set set = new HashSet(optionSet);
+ set.add(mode);
+ combinations.add(set);
+ }
+ }
+ return combinations;
}
-
}
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 33edeb9fb..ec0733905 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
@@ -79,7 +79,6 @@ import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchListener;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.core.ILaunchMode;
-import org.eclipse.debug.core.ILaunchOption;
import org.eclipse.debug.core.ILaunchesListener;
import org.eclipse.debug.core.ILaunchesListener2;
import org.eclipse.debug.core.IStatusHandler;
@@ -1317,47 +1316,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
return (ILaunchMode[]) collection.toArray(new ILaunchMode[collection.size()]);
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchManager#getLaunchOption(java.lang.String)
- */
- public ILaunchOption getLaunchOption(String optionId) {
- initializeLaunchOptions();
- return (ILaunchOption)fLaunchOptions.get(optionId);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchManager#getLaunchOptions()
- */
- public ILaunchOption[] getLaunchOptions() {
- initializeLaunchOptions();
- 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
@@ -1377,51 +1335,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
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
@@ -1439,7 +1352,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
LaunchDelegate ld = null;
for(Iterator iter = fLaunchDelegates.keySet().iterator(); iter.hasNext();) {
ld = (LaunchDelegate) fLaunchDelegates.get(iter.next());
- if(ld.appliesTo(typeid)) {
+ if(ld.getLaunchConfigurationType().equals(typeid)) {
list.add(ld);
}
}
@@ -1447,68 +1360,6 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
/**
- * 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>
@@ -2229,5 +2080,44 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
}
-
+ /**
+ * Returns the name of the given launch mode with accelerators removed,
+ * or <code>null</code> if none.
+ *
+ * @param id
+ */
+ public String getLaunchModeName(String id) {
+ ILaunchMode launchMode = getLaunchMode(id);
+ if (launchMode != null) {
+ return removeAccelerators(launchMode.getLabel());
+ }
+ return null;
+ }
+ /**
+ * Returns the label with any accelerators removed.
+ *
+ * @return label without accelerators
+ */
+ public static String removeAccelerators(String label) {
+ String title = label;
+ if (title != null) {
+ // strip out any '&' (accelerators)
+ int index = title.indexOf('&');
+ if (index == 0) {
+ title = title.substring(1);
+ } else if (index > 0) {
+ //DBCS languages use "(&X)" format
+ if (title.charAt(index - 1) == '(' && title.length() >= index + 3 && title.charAt(index + 2) == ')') {
+ String first = title.substring(0, index - 1);
+ String last = title.substring(index + 3);
+ title = first + last;
+ } else if (index < (title.length() - 1)) {
+ String first = title.substring(0, index);
+ String last = title.substring(index + 1);
+ title = first + last;
+ }
+ }
+ }
+ return title;
+ }
}
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
deleted file mode 100644
index 17d05c89c..000000000
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchOption.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 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 org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.debug.core.ILaunchOption;
-
-/**
- * Proxy to a launch option extension
- *
- * @since 3.3
- */
-public class LaunchOption implements ILaunchOption {
-
- /**
- * The associated configuration element
- */
- private IConfigurationElement fElement = null;
-
- /**
- * Constructor
- * @param element the element to associate this launch option with
- */
- public LaunchOption(IConfigurationElement element) {
- fElement = element;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchOption#getIdentifier()
- */
- public String getIdentifier() {
- return fElement.getAttribute(IConfigurationElementConstants.ID);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchOption#getLabel()
- */
- public String getLabel() {
- return fElement.getAttribute(IConfigurationElementConstants.LABEL);
- }
-}
diff --git a/org.eclipse.debug.core/plugin.properties b/org.eclipse.debug.core/plugin.properties
index 7a75466cb..732d0f776 100644
--- a/org.eclipse.debug.core/plugin.properties
+++ b/org.eclipse.debug.core/plugin.properties
@@ -25,7 +25,6 @@ logicalStructureTypesExtensionPointName=Logical Structure Types
logicalStructureProvidersExtensionPointName=Logical Structure Providers
sourceContainerTypesName = Source Container Types
sourcePathComputersName = Source Path Computers
-launchOptionsExtensionpointName=Launch Options
run=&Run
debug=&Debug
diff --git a/org.eclipse.debug.core/plugin.xml b/org.eclipse.debug.core/plugin.xml
index 112f1c579..3d927fd01 100644
--- a/org.eclipse.debug.core/plugin.xml
+++ b/org.eclipse.debug.core/plugin.xml
@@ -18,7 +18,6 @@
<extension-point id="sourceContainerTypes" name="%sourceContainerTypesName" schema="schema/sourceContainerTypes.exsd"/>
<extension-point id="sourcePathComputers" name="%sourcePathComputersName" schema="schema/sourcePathComputers.exsd"/>
<extension-point id="logicalStructureProviders" name="%logicalStructureProvidersExtensionPointName" schema="schema/logicalStructureProviders.exsd"/>
- <extension-point id="launchOptions" name="%launchOptionsExtensionpointName" schema="schema/launchOptions.exsd"/>
<!-- Extensions -->
<extension
diff --git a/org.eclipse.debug.core/schema/launchDelegates.exsd b/org.eclipse.debug.core/schema/launchDelegates.exsd
index 45a428e4a..06f39c46d 100644
--- a/org.eclipse.debug.core/schema/launchDelegates.exsd
+++ b/org.eclipse.debug.core/schema/launchDelegates.exsd
@@ -114,7 +114,7 @@ Launch configuration instances of this delegate&apos;s type will delegate to ins
<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.
+ A comma-separated list of launch modes this launch delegate supports in combination with its supported modes. This attribute was added in the 3.3 release to allow configurations to be launched in a mixed mode.
&lt;p&gt;
&lt;strong&gt;EXPERIMENTAL&lt;/strong&gt;. This attribute has been added as
@@ -151,30 +151,15 @@ without consulting with the Platform/Debug team.
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;
+ modes=&quot;profile&quot;
+ options&quot;run, debug&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.
+In the example above, the specified launch delegate is contributed to launch Java applications in profile mode. The delegate supports mixed mode launching. The delegate supports profiling when launching in run or debug 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/launchOptions.exsd b/org.eclipse.debug.core/schema/launchOptions.exsd
deleted file mode 100644
index 0e829c97e..000000000
--- a/org.eclipse.debug.core/schema/launchOptions.exsd
+++ /dev/null
@@ -1,136 +0,0 @@
-<?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="launchOptions" name="Launch Options"/>
- </appInfo>
- <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>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="launchOption" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="launchOption">
- <annotation>
- <appInfo>
- <meta.element translatable="true"/>
- </appInfo>
- </annotation>
- <complexType>
- <attribute name="label" type="string" use="required">
- <annotation>
- <documentation>
- A human readable label for the option e.g. Debug
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- this is a unique id for the launch option e.g. org.eclipse.debug.debugLaunchOption
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 3.3
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- &lt;p&gt;
-&lt;pre&gt;
- &lt;extension point=&quot;org.eclipse.debug.core.launchOptions&quot;&gt;
- &lt;launchOption
- id=&quot;trace&quot;
- label=&quot;Trace&quot;&gt;
- &lt;/launchOption&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
-&lt;/p&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- 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
-&lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/org.eclipse.debug.ui/component.xml b/org.eclipse.debug.ui/component.xml
index 5323d258b..67282f82b 100644
--- a/org.eclipse.debug.ui/component.xml
+++ b/org.eclipse.debug.ui/component.xml
@@ -10,7 +10,7 @@
<type name="AbstractDebugView" />
<type name="AbstractLaunchConfigurationTab" />
<type name="AbstractLaunchConfigurationTabGroup" />
- <type name="AbstractOptionLaunchConfigurationTab" />
+ <type name="AbstractLaunchModeConfigurationTab" />
<type name="BreakpointTypeCategory" />
<type name="CommonTab" subclass="false" />
<type name="DebugElementWorkbenchAdapter" />
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java
index 2d54570c6..7dbe5571f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java
@@ -12,8 +12,10 @@ package org.eclipse.debug.internal.ui.launchConfigurations;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Hashtable;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -23,7 +25,10 @@ import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.core.ILaunchMode;
import org.eclipse.debug.internal.core.IConfigurationElementConstants;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.LaunchConfigurationTabExtension;
@@ -252,5 +257,27 @@ public class LaunchConfigurationPresentationManager {
return (extension != null ? extension.getDescription(mode) : null);
}
+ /**
+ * Returns a sorted list of launch mode names corresponding to the given identifiers.
+ *
+ * @param modes set of launch mode identifiers
+ * @return sorted list of launch mode names
+ */
+ public List getLaunchModeNames(Set modes) {
+ List names = new ArrayList();
+ Iterator iterator = modes.iterator();
+ ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
+ while (iterator.hasNext()) {
+ String id = (String) iterator.next();
+ ILaunchMode mode = manager.getLaunchMode(id);
+ if (mode == null) {
+ names.add(id);
+ } else {
+ names.add(DebugUIPlugin.removeAccelerators(mode.getLabel()));
+ }
+ }
+ Collections.sort(names);
+ return names;
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
index 3bc87c9ca..1db34a2f1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
@@ -12,6 +12,7 @@ package org.eclipse.debug.internal.ui.launchConfigurations;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
import org.eclipse.core.resources.IResource;
@@ -294,7 +295,7 @@ public class LaunchConfigurationTabGroupViewer extends Viewer {
fOptionsLink.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
//collect the options available
- SelectLaunchOptionsDialog sld = new SelectLaunchOptionsDialog(getShell(),
+ SelectLaunchModesDialog sld = new SelectLaunchModesDialog(getShell(),
getLaunchConfigurationDialog().getMode(),
((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getLaunchDelegates(fTabType.getIdentifier()));
if(sld.open() == IDialogConstants.OK_ID) {
@@ -306,7 +307,7 @@ public class LaunchConfigurationTabGroupViewer extends Viewer {
list.add(res[i]);
}
ILaunchConfigurationWorkingCopy wc = getWorkingCopy();
- wc.setOptions(list);
+ wc.setModes(list);
refresh();
refreshStatus();
}
@@ -1040,14 +1041,11 @@ public class LaunchConfigurationTabGroupViewer extends Viewer {
try {
ILaunchConfigurationWorkingCopy wc = getWorkingCopy();
if(wc != null) {
- Set options = wc.getOptions();
- if(options.size() > 0) {
- return ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getLaunchDelegates(fTabType.getIdentifier(), getLaunchConfigurationDialog().getMode(), options).length > 0;
- }
+ Set modes = wc.getModes();
+ modes.add(getLaunchConfigurationDialog().getMode());
+ return wc.getType().supportsModeCombination(modes);
}
- }
- catch (CoreException e) {
- e.printStackTrace();
+ } catch (CoreException e) {
}
return true;
}
@@ -1103,15 +1101,12 @@ public class LaunchConfigurationTabGroupViewer extends Viewer {
}
if(!canLaunchWithOptions()) {
try {
- Object o = getInput();
- String name = null;
- if(o instanceof ILaunchConfiguration) {
- ILaunchConfiguration lc = (ILaunchConfiguration) o;
- name = LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_14+lc.getName();
- }
- return (name == null ? LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_10 : name) + LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_11+getLaunchConfigurationDialog().getMode()+LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_12+getWorkingCopy().getOptions().toString();
+ Set modes = getWorkingCopy().getModes();
+ modes.add(getLaunchConfigurationDialog().getMode());
+ List names = LaunchConfigurationPresentationManager.getDefault().getLaunchModeNames(modes);
+ return MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_14, new String[]{names.toString()});
} catch (CoreException e) {
- e.printStackTrace();
+ return e.getMessage();
}
}
return null;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java
index 53d710230..797eec9c1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java
@@ -96,9 +96,6 @@ public class LaunchConfigurationsMessages extends NLS {
public static String LaunchConfigurationTabGroupViewer_14;
public static String LaunchConfigurationTabGroupViewer_9;
- public static String LaunchConfigurationTabGroupViewer_10;
- public static String LaunchConfigurationTabGroupViewer_11;
- public static String LaunchConfigurationTabGroupViewer_12;
public static String LaunchConfigurationTabGroupViewer_13;
public static String PerspectiveManager_Error_1;
public static String PerspectiveManager_Unable_to_switch_perpsectives_as_specified_by_launch___0__4;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
index 7a8502a43..7af00dd95 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
@@ -54,11 +54,8 @@ LaunchConfigurationTabGroupViewer_6=- Press the 'Duplicate' button to copy the s
LaunchConfigurationTabGroupViewer_5=Configure launch perspective settings from the <a>Perspectives</a> preference page.
LaunchConfigurationTabGroupViewer_8=- Press the 'Filter' button to configure filtering options.
LaunchConfigurationTabGroupViewer_9=The file associated with this launch configuration is read-only and cannot be modified.\n
-LaunchConfigurationTabGroupViewer_10=The selected configuration
-LaunchConfigurationTabGroupViewer_11=\ cannot be launched with the set of options:
-LaunchConfigurationTabGroupViewer_12=\ and
-LaunchConfigurationTabGroupViewer_13=Select a supported set of <a>launch options</a> for this mode.
-LaunchConfigurationTabGroupViewer_14=Configuration
+LaunchConfigurationTabGroupViewer_13=Select a supported <a>launch mode</a>.
+LaunchConfigurationTabGroupViewer_14=Mixed launch mode not supported: {0}
LaunchConfigurationDialog_Create__manage__and_run_launch_configurations_8=Create, manage, and run configurations
LaunchConfigurationDialog_Dele_te_14=De&lete
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchOptionsDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java
index c025d932f..b21102257 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchOptionsDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java
@@ -38,24 +38,25 @@ import org.eclipse.ui.dialogs.SelectionDialog;
/**
* This class provides a dialog to present the user with a list of of viable launch options in the event
- * the plugin that provides either a launch option or a contributed launch delegate is no longer available.
- * The user can select one of the launch mode/option configuration sform this dialog and repair the option
+ * the plug-in that provides either a launch option or a contributed launch delegate is no longer available.
+ * The user can select one of the launch mode/option configuration from this dialog and repair the option
* configuration state of the the current launch configuration
*
* @since 3.3
*
* EXPERIMENTAL
*/
-public class SelectLaunchOptionsDialog extends SelectionDialog {
+public class SelectLaunchModesDialog extends SelectionDialog {
/**
- * Builds labels for list control of the form: Mode + (no options) | [optionslist]
+ * Builds labels for list control of the form: Mode + (no options) | [options list]
*/
class OptionsLabelProvider implements ILabelProvider {
public Image getImage(Object element) {return null;}
public String getText(Object element) {
LaunchDelegate del = (LaunchDelegate) element;
Set set = del.getOptions();
+ // TODO: illegal NLS
return del.getName() + LaunchConfigurationsMessages.SelectLaunchOptionsDialog_5 + fMode + (set.isEmpty() ? LaunchConfigurationsMessages.SelectLaunchOptionsDialog_0 : LaunchConfigurationsMessages.SelectLaunchOptionsDialog_1 + set);
}
public void addListener(ILabelProviderListener listener) {}
@@ -78,7 +79,7 @@ public class SelectLaunchOptionsDialog extends SelectionDialog {
* @param message the message for the dialog
* @param options the listing of arrays of options (each entry in the list must be an <code>Set</code> of options)
*/
- public SelectLaunchOptionsDialog(Shell parentShell, String mode, LaunchDelegate[] delegates) {
+ public SelectLaunchModesDialog(Shell parentShell, String mode, LaunchDelegate[] delegates) {
super(parentShell);
super.setMessage(LaunchConfigurationsMessages.SelectLaunchOptionsDialog_2);
super.setTitle(LaunchConfigurationsMessages.SelectLaunchOptionsDialog_3);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractOptionLaunchConfigurationTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchModeConfigurationTab.java
index 7256fb953..f7a031183 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractOptionLaunchConfigurationTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchModeConfigurationTab.java
@@ -20,10 +20,10 @@ import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.swt.widgets.Composite;
/**
- * Common function for a launch tab that edits a launch option.
+ * Common function for a launch tab that edits a launch mode.
* <p>
* This class is intended to be subclassed by clients contributing launch tabs
- * that modify launch options.
+ * that modify launch modes on a launch configuration.
* </p>
* @since 3.3
*
@@ -34,23 +34,23 @@ import org.eclipse.swt.widgets.Composite;
* without consulting with the Platform/Debug team.
* </p>
*/
-public abstract class AbstractOptionLaunchConfigurationTab extends AbstractLaunchConfigurationTab implements ILaunchConfigurationListener {
+public abstract class AbstractLaunchModeConfigurationTab extends AbstractLaunchConfigurationTab implements ILaunchConfigurationListener {
/**
- * Returns the set of the options this tab modifies.
+ * Returns the set of the modes this tab modifies.
*
- * @return set of the options this tab modifies
+ * @return set of the modes this tab modifies
*/
- public abstract Set getOptions();
+ public abstract Set getModes();
/**
- * Updates the controls associated with this tab's launch options.
+ * Updates the controls associated with this tab's launch modes.
* Called when a launch configuration has changed, which can occur when a tab
- * is de-activated, or if an option is modified outside of the tabs' control.
+ * is de-activated. Launch modes may have been modified outside of this tab's control.
*
- * @param options the current set of options specified by the working copy being edited
+ * @param modes the current set of modes specified by the working copy being edited
*/
- public abstract void updateOptionControls(Set options);
+ public abstract void updateLaunchModeControls(Set modes);
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
@@ -82,7 +82,7 @@ public abstract class AbstractOptionLaunchConfigurationTab extends AbstractLaunc
*/
public void launchConfigurationChanged(ILaunchConfiguration configuration) {
try {
- updateOptionControls(configuration.getOptions());
+ updateLaunchModeControls(configuration.getModes());
}
catch (CoreException e) {DebugUIPlugin.log(e);}
}

Back to the top