Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 51964 Details for
Bug 157059
[launching] extensible launch options
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
further
launching_phase_5b.txt (text/plain), 234.63 KB, created by
Michael Rennie
on 2006-10-13 13:57:14 EDT
(
hide
)
Description:
further
Filename:
MIME Type:
Creator:
Michael Rennie
Created:
2006-10-13 13:57:14 EDT
Size:
234.63 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.launching >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.launching/plugin.xml,v >retrieving revision 1.61 >diff -u -r1.61 plugin.xml >--- plugin.xml 5 Sep 2006 14:06:35 -0000 1.61 >+++ plugin.xml 13 Oct 2006 17:49:59 -0000 >@@ -27,28 +27,22 @@ > <extension > point="org.eclipse.debug.core.launchConfigurationTypes"> > <launchConfigurationType >- delegate="org.eclipse.jdt.launching.JavaLaunchDelegate" > id="org.eclipse.jdt.launching.localJavaApplication" > migrationDelegate="org.eclipse.jdt.internal.launching.JavaMigrationDelegate" >- modes="run, debug" > name="%localJavaApplication" > sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector" > sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer"> > </launchConfigurationType> > <launchConfigurationType >- delegate="org.eclipse.jdt.internal.launching.JavaRemoteApplicationLaunchConfigurationDelegate" > id="org.eclipse.jdt.launching.remoteJavaApplication" > migrationDelegate="org.eclipse.jdt.internal.launching.JavaMigrationDelegate" >- modes="debug" > name="%remoteJavaApplication" > sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector" > sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer"> > </launchConfigurationType> > <launchConfigurationType >- delegate="org.eclipse.jdt.internal.launching.JavaAppletLaunchConfigurationDelegate" > id="org.eclipse.jdt.launching.javaApplet" > migrationDelegate="org.eclipse.jdt.internal.launching.JavaMigrationDelegate" >- modes="run, debug" > name="%appletLabel" > sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector" > sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer"> >@@ -189,5 +183,29 @@ > name= "%jreContainerMarkerProblemName"> > <super type="org.eclipse.core.resources.problemmarker"/> > <persistent value="true"/> >+ </extension> >+ <extension >+ point="org.eclipse.debug.core.launchDelegates"> >+ <launchDelegate >+ delegate="org.eclipse.jdt.launching.JavaLaunchDelegate" >+ id="org.eclipse.jdt.launching.localJavaApplicationDelegate" >+ modes="run, debug" >+ name="%localJavaApplication" >+ type="org.eclipse.jdt.launching.localJavaApplication"> >+ </launchDelegate> >+ <launchDelegate >+ delegate="org.eclipse.jdt.internal.launching.JavaRemoteApplicationLaunchConfigurationDelegate" >+ id="org.eclipse.jdt.launching.remoteJavaApplicationDelegate" >+ modes="debug" >+ name="%remoteJavaApplication" >+ type="org.eclipse.jdt.launching.remoteJavaApplication"> >+ </launchDelegate> >+ <launchDelegate >+ delegate="org.eclipse.jdt.internal.launching.JavaAppletLaunchConfigurationDelegate" >+ id="org.eclipse.jdt.launching.javaAppletDelegate" >+ modes="run, debug" >+ name="%appletLabel" >+ type="org.eclipse.jdt.launching.javaApplet"> >+ </launchDelegate> > </extension> > </plugin> >#P org.eclipse.debug.ui >Index: schema/launchConfigurationTypeImages.exsd >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/schema/launchConfigurationTypeImages.exsd,v >retrieving revision 1.6 >diff -u -r1.6 launchConfigurationTypeImages.exsd >--- schema/launchConfigurationTypeImages.exsd 20 Apr 2005 15:30:45 -0000 1.6 >+++ schema/launchConfigurationTypeImages.exsd 13 Oct 2006 17:50:01 -0000 >@@ -2,13 +2,13 @@ > <!-- Schema file written by PDE --> > <schema targetNamespace="org.eclipse.debug.ui"> > <annotation> >- <appInfo> >- <meta.schema plugin="org.eclipse.debug.ui" id="launchConfigurationTypeImages" name="Launch Configuration Type Images"/> >- </appInfo> >- <documentation> >- This extension point provides a way to associate an image with a launch configuration type. >- </documentation> >-</annotation> >+ <appInfo> >+ <meta.schema plugin="org.eclipse.debug.ui" id="launchConfigurationTypeImages" name="Launch Configuration Type Images"/> >+ </appInfo> >+ <documentation> >+ This extension point provides a way to associate an image with a launch configuration type. >+ </documentation> >+ </annotation> > > <element name="extension"> > <complexType> >@@ -22,24 +22,15 @@ > </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="launchConfigurationTypeImage"> >+ <annotation> >+ <documentation> >+ <p>In 3.3, if possible, the image for a launch configuration type should be moved to the launch configuration type extension contribution</p> >+ </documentation> >+ </annotation> > <complexType> > <attribute name="id" type="string" use="required"> > <annotation> >@@ -51,7 +42,7 @@ > <attribute name="configTypeID" type="string" use="required"> > <annotation> > <documentation> >- specifies the fully qualified ID of a launch configuration type.(in 2.1, this attribute can also be specified using the "type" attribute, to be consistent with the launchConfigurationTabGroups extension point). >+ specifies the fully qualified ID of a launch configuration type.(in 2.1, this attribute can also be specified using the "type" attribute, to be consistent with the launchConfigurationTabGroups extension point). > </documentation> > </annotation> > </attribute> >@@ -77,24 +68,24 @@ > > <p> > <pre> >- <extension point="org.eclipse.debug.ui.launchConfigurationTypeImages"> >- <launchConfigurationTypeImage >- id="com.example.FirstLaunchConfigurationTypeImage" >- configTypeID="com.example.FirstLaunchConfigurationType" >- icon="icons/FirstLaunchConfigurationType.gif"> >- </launchConfigurationTypeImage> >- </extension> >+ <extension point="org.eclipse.debug.ui.launchConfigurationTypeImages"> >+ <launchConfigurationTypeImage >+ id="com.example.FirstLaunchConfigurationTypeImage" >+ configTypeID="com.example.FirstLaunchConfigurationType" >+ icon="icons/FirstLaunchConfigurationType.gif"> >+ </launchConfigurationTypeImage> >+ </extension> > </pre> > </p> > </documentation> > </annotation> >- >+ > <annotation> > <appInfo> > <meta.section type="copyright"/> > </appInfo> > <documentation> >-Copyright (c) 2000, 2005 IBM Corporation and others.<br> >+ Copyright (c) 2000, 2005 IBM Corporation and others.<br> > 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 >Index: ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTab.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTab.java,v >retrieving revision 1.36 >diff -u -r1.36 AbstractLaunchConfigurationTab.java >--- ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTab.java 16 May 2006 16:23:31 -0000 1.36 >+++ ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTab.java 13 Oct 2006 17:50:02 -0000 >@@ -29,7 +29,7 @@ > /** > * Common function for launch configuration tabs. > * <p> >- * Clients may subclass this class. >+ * Clients s subclass this class. > * </p> > * @see ILaunchConfigurationTab > * @since 2.0 >Index: ui/org/eclipse/debug/ui/DebugUITools.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java,v >retrieving revision 1.96 >diff -u -r1.96 DebugUITools.java >--- ui/org/eclipse/debug/ui/DebugUITools.java 16 Aug 2006 22:07:49 -0000 1.96 >+++ ui/org/eclipse/debug/ui/DebugUITools.java 13 Oct 2006 17:50:02 -0000 >@@ -35,6 +35,7 @@ > import org.eclipse.debug.internal.ui.LazyModelPresentation; > import org.eclipse.debug.internal.ui.contexts.DebugContextManager; > import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog; >+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationEditDialog; > import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager; > import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog; > import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog; >@@ -458,7 +459,39 @@ > > return Window.CANCEL; > } >- >+ >+ /** >+ * Open the launch configuration dialog on the specified launch >+ * configuration. The dialog displays the tabs for a single configuration >+ * only (a tree of launch configuration is not displayed) >+ * <p> >+ * If a status is specified, a status handler is consulted to handle the >+ * status. The status handler is passed the instance of the launch >+ * configuration dialog that is opened. This gives the status handler an >+ * opportunity to perform error handling/initialization as required. >+ * </p> >+ * @param shell the parent shell for the launch configuration dialog >+ * @param configuration the configuration to display >+ * @param groupIdentifier group identifier of the launch group the launch configuration >+ * belongs to >+ * @param status the status to display, or <code>null</code> if none >+ * @return the return code from opening the launch configuration dialog - >+ * one of <code>Window.OK</code> or <code>Window.CANCEL</code> >+ * >+ * @since 3.3 >+ * >+ * EXPERIMENTAL >+ */ >+ public static int openLaunchConfigurationEditDialog(Shell shell, ILaunchConfiguration configuration, String groupIdentifier, IStatus status) { >+ LaunchGroupExtension group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(groupIdentifier); >+ if (group != null) { >+ LaunchConfigurationEditDialog dialog = new LaunchConfigurationEditDialog(shell, configuration, group); >+ dialog.setInitialStatus(status); >+ return dialog.open(); >+ } >+ return Window.CANCEL; >+ } >+ > /** > * Saves all dirty editors and builds the workspace according to current > * preference settings, and returns whether a launch should proceed. >Index: ui/org/eclipse/debug/ui/IDebugUIConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java,v >retrieving revision 1.166 >diff -u -r1.166 IDebugUIConstants.java >--- ui/org/eclipse/debug/ui/IDebugUIConstants.java 5 Jul 2006 19:27:42 -0000 1.166 >+++ ui/org/eclipse/debug/ui/IDebugUIConstants.java 13 Oct 2006 17:50:02 -0000 >@@ -927,6 +927,20 @@ > public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_TAB_GROUPS= "launchConfigurationTabGroups"; //$NON-NLS-1$ > > /** >+ * Contributed Launch Configuration Tab extension point indentifier >+ * >+ * <p> >+ * <strong>EXPERIMENTAL</strong>. This constant 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 EXTENSION_POINT_CONTRIBUTED_LAUNCH_TABS = "launchConfigurationTabs"; //$NON-NLS-1$ >+ >+ /** > * Launch shortcuts extension point identifier > * (value <code>"launchShortcuts"</code>). > * >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/plugin.properties,v >retrieving revision 1.219 >diff -u -r1.219 plugin.properties >--- plugin.properties 1 Aug 2006 17:37:21 -0000 1.219 >+++ plugin.properties 13 Oct 2006 17:50:00 -0000 >@@ -43,6 +43,8 @@ > DebugLaunchGroup.title=Select or configure an application to debug > DebugModelPresentationExtensionName=Debug Model Presentation > >+LaunchConfigurationTabsExtension.name=Launch Configuration Tabs >+ > DebugPerspective.name=Debug > DebugPerspective.description=This Debug perspective is designed to support application debugging. It incorporates views for displaying the debug stack, variables and breakpoint management. > >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/plugin.xml,v >retrieving revision 1.376 >diff -u -r1.376 plugin.xml >--- plugin.xml 25 Sep 2006 14:45:45 -0000 1.376 >+++ plugin.xml 13 Oct 2006 17:50:00 -0000 >@@ -18,6 +18,7 @@ > <extension-point id="memoryRenderings" name="%memoryRenderingsExtensionPointName" schema="schema/memoryRenderings.exsd"/> > <extension-point id="breakpointOrganizers" name="%BreakpointOrganizersName" schema="schema/breakpointOrganizers.exsd"/> > <extension-point id="variableValueEditors" name="%VariableValueEditorsName" schema="schema/variableValueEditors.exsd"/> >+ <extension-point id="launchConfigurationTabs" name="%LaunchConfigurationTabsExtension.name" schema="schema/launchConfigurationTabs.exsd"/> > > <!-- Extensions --> > <extension >@@ -1338,7 +1339,13 @@ > class="org.eclipse.debug.internal.ui.launchConfigurations.DeleteLaunchConfigurationStatusHandler" > code="225" > id="org.eclipse.debug.ui.deleteAssociatedLaunchConfigs" >- plugin="org.eclipse.debug.core"/> >+ plugin="org.eclipse.debug.core"/> >+ <statusHandler >+ class="org.eclipse.debug.internal.ui.launchConfigurations.LaunchDelegateNotAvailableHandler" >+ code="226" >+ id="org.eclipse.debug.ui.statusHandler.launchDelegateNotAvailable" >+ plugin="org.eclipse.debug.core"> >+ </statusHandler> > </extension> > <extension > point="org.eclipse.debug.ui.launchGroups"> >Index: ui/org/eclipse/debug/internal/ui/actions/EditLaunchConfigurationAction.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/EditLaunchConfigurationAction.java,v >retrieving revision 1.14 >diff -u -r1.14 EditLaunchConfigurationAction.java >--- ui/org/eclipse/debug/internal/ui/actions/EditLaunchConfigurationAction.java 8 May 2006 20:07:20 -0000 1.14 >+++ ui/org/eclipse/debug/internal/ui/actions/EditLaunchConfigurationAction.java 13 Oct 2006 17:50:01 -0000 >@@ -36,7 +36,8 @@ > public class EditLaunchConfigurationAction extends SelectionListenerAction { > > private ILaunchConfiguration fConfiguration = null; >- private String fMode =null; >+ private String fMode = null; >+ private boolean fTerminated = false; > > /** > * Constructs a new action. >@@ -87,6 +88,7 @@ > } > setLaunchConfiguration(configuration); > setMode(launch.getLaunchMode()); >+ setIsTerminated(launch.isTerminated()); > setText(MessageFormat.format(ActionMessages.EditLaunchConfigurationAction_1, new String[]{configuration.getName()})); > ImageDescriptor descriptor = null; > try { >@@ -123,15 +125,30 @@ > return fMode; > } > >+ protected boolean isTerminated() { >+ return fTerminated; >+ } >+ >+ protected void setIsTerminated(boolean terminated) { >+ fTerminated = terminated; >+ } >+ > /** > * @see org.eclipse.jface.action.IAction#run() > */ > public void run() { > ILaunchGroup group = DebugUITools.getLaunchGroup(getLaunchConfiguration(), getMode()); > if (group != null) { >- DebugUITools.openLaunchConfigurationDialog( >- DebugUIPlugin.getShell(), getLaunchConfiguration(), >- group.getIdentifier(), null); >+ if(isTerminated()) { >+ DebugUITools.openLaunchConfigurationDialog( >+ DebugUIPlugin.getShell(), getLaunchConfiguration(), >+ group.getIdentifier(), null); >+ } >+ else { >+ DebugUITools.openLaunchConfigurationEditDialog( >+ DebugUIPlugin.getShell(), getLaunchConfiguration(), >+ group.getIdentifier(), null); >+ } > } > } > >Index: ui/org/eclipse/debug/internal/ui/DebugPluginImages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java,v >retrieving revision 1.94 >diff -u -r1.94 DebugPluginImages.java >--- ui/org/eclipse/debug/internal/ui/DebugPluginImages.java 9 Jun 2006 13:40:02 -0000 1.94 >+++ ui/org/eclipse/debug/internal/ui/DebugPluginImages.java 13 Oct 2006 17:50:01 -0000 >@@ -14,12 +14,17 @@ > > > import java.net.URL; >+import java.util.HashSet; >+import java.util.Set; > > import org.eclipse.core.runtime.FileLocator; > import org.eclipse.core.runtime.IConfigurationElement; > import org.eclipse.core.runtime.IExtensionPoint; > import org.eclipse.core.runtime.Path; > import org.eclipse.core.runtime.Platform; >+import org.eclipse.debug.core.DebugPlugin; >+import org.eclipse.debug.core.ILaunchConfigurationType; >+import org.eclipse.debug.internal.core.IConfigurationElementConstants; > import org.eclipse.debug.ui.IDebugUIConstants; > import org.eclipse.jface.resource.ImageDescriptor; > import org.eclipse.jface.resource.ImageRegistry; >@@ -230,20 +235,37 @@ > declareRegistryImage(IInternalDebugUIConstants.IMG_EDIT_SRC_DIR_WIZ, WIZBAN + "editdir_wiz.png"); //$NON-NLS-1$ > > // launch configuration types >- IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPE_IMAGES); >- IConfigurationElement[] configElements= extensionPoint.getConfigurationElements(); >- for (int i = 0; i < configElements.length; i++) { >- IConfigurationElement configElement = configElements[i]; >- ImageDescriptor descriptor = DebugUIPlugin.getImageDescriptor(configElement, ATTR_LAUNCH_CONFIG_TYPE_ICON); >- if (descriptor == null) { >- descriptor = ImageDescriptor.getMissingImageDescriptor(); >+ //try to get the images from the config types themselves, cache those that could not be found >+ ILaunchConfigurationType[] types = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes(); >+ String path = null; >+ Set missing = new HashSet(); >+ ImageDescriptor descriptor = null; >+ for (int i = 0; i < types.length; i++) { >+ path = types[i].getImageDescriptorPath(); >+ if(path == null) { >+ missing.add(types[i].getIdentifier()); >+ } >+ else { >+ descriptor = DebugUIPlugin.getImageDescriptor(types[i].getContributorName(), path); >+ imageRegistry.put(types[i].getIdentifier(), (descriptor == null ? ImageDescriptor.getMissingImageDescriptor() : descriptor)); >+ } >+ } >+ if(missing.size() > 0) { >+ //if we are missing some images try to find them in the deprecated extension point >+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPE_IMAGES); >+ IConfigurationElement[] configElements = extensionPoint.getConfigurationElements(); >+ String configTypeID = null; >+ for (int i = 0; i < configElements.length; i++) { >+ configTypeID = configElements[i].getAttribute(ATTR_LAUNCH_CONFIG_TYPE_ID); >+ if (configTypeID == null) { >+ // bug 12652 >+ configTypeID = configElements[i].getAttribute(IConfigurationElementConstants.TYPE); >+ } >+ if(missing.contains(configTypeID)) { >+ descriptor = DebugUIPlugin.getImageDescriptor(configElements[i], ATTR_LAUNCH_CONFIG_TYPE_ICON); >+ imageRegistry.put(configTypeID, (descriptor == null ? ImageDescriptor.getMissingImageDescriptor() : descriptor)); >+ } > } >- String configTypeID = configElement.getAttribute(ATTR_LAUNCH_CONFIG_TYPE_ID); >- if (configTypeID == null) { >- // bug 12652 >- configTypeID = configElement.getAttribute("type"); //$NON-NLS-1$ >- } >- imageRegistry.put(configTypeID, descriptor); > } > } > >Index: ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java,v >retrieving revision 1.275 >diff -u -r1.275 DebugUIPlugin.java >--- ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java 8 May 2006 20:07:20 -0000 1.275 >+++ ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java 13 Oct 2006 17:50:01 -0000 >@@ -1037,6 +1037,26 @@ > } > > /** >+ * Returns an image descriptor for the icon referenced by the given path >+ * and contributor name, or <code>null</code> if none. >+ * >+ * @param name the name of the contributor >+ * @param path the path of the icon (from the configuration element) >+ * @return image descriptor or <code>null</code> >+ * @since 3.3 >+ */ >+ public static ImageDescriptor getImageDescriptor(String name, String path) { >+ Bundle bundle = Platform.getBundle(name); >+ if (path != null) { >+ URL iconURL = FileLocator.find(bundle , new Path(path), null); >+ if (iconURL != null) { >+ return ImageDescriptor.createFromURL(iconURL); >+ } >+ } >+ return null; >+ } >+ >+ /** > * Performs extra filtering for launch configurations based on the prefs set on the > * Launch Configurations page > * @param config the config to filter >Index: ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java,v >retrieving revision 1.57 >diff -u -r1.57 IDebugHelpContextIds.java >--- ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java 22 Sep 2006 17:42:38 -0000 1.57 >+++ ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java 13 Oct 2006 17:50:01 -0000 >@@ -97,6 +97,7 @@ > public static final String MAX_DETAILS_LENGTH_DIALOG = PREFIX + "max_details_length_dialog_context"; //$NON-NLS-1$ > public static final String SELECT_DEFAULT_WORKINGSET_DIALOG = PREFIX + "select_breakpoint_workingset_dialog"; //$NON-NLS-1$ > public static final String DELETE_ASSOCIATED_LAUNCH_CONFIGS_DIALOG = PREFIX + "delete_associated_launch_configs_dialog"; //$NON-NLS-1$ >+ public static final String SELECT_LAUNCH_OPTIONS_DIALOG = PREFIX + "select_launch_options_dialog"; //$NON-NLS-1$ > > // Property pages > public static final String PROCESS_PROPERTY_PAGE = PREFIX + "process_property_page_context"; //$NON-NLS-1$ >Index: ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPropertiesDialog.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPropertiesDialog.java,v >retrieving revision 1.22 >diff -u -r1.22 LaunchConfigurationPropertiesDialog.java >--- ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPropertiesDialog.java 10 Apr 2006 13:53:27 -0000 1.22 >+++ ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPropertiesDialog.java 13 Oct 2006 17:50:01 -0000 >@@ -11,8 +11,6 @@ > package org.eclipse.debug.internal.ui.launchConfigurations; > > >-import com.ibm.icu.text.MessageFormat; >- > import org.eclipse.core.runtime.IStatus; > import org.eclipse.debug.core.DebugPlugin; > import org.eclipse.debug.core.ILaunchConfiguration; >@@ -26,6 +24,8 @@ > import org.eclipse.swt.layout.GridLayout; > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Shell; >+ >+import com.ibm.icu.text.MessageFormat; > > > /** >@@ -108,18 +108,17 @@ > topLayout.marginWidth = 5; > topComp.setLayout(topLayout); > topComp.setFont(dialogComp.getFont()); >- >+ > // Set the things that TitleAreaDialog takes care of > setTitle(getTitleAreaTitle()); > setMessage(""); //$NON-NLS-1$ > setModeLabelState(); >- >+ > // Build the launch configuration edit area and put it into the composite. > Composite editAreaComp = createLaunchConfigurationEditArea(topComp); > gd = new GridData(GridData.FILL_BOTH); > editAreaComp.setLayoutData(gd); > editAreaComp.setFont(dialogComp.getFont()); >- > dialogComp.layout(true); > applyDialogFont(dialogComp); > } >Index: ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java,v >retrieving revision 1.17 >diff -u -r1.17 LaunchConfigurationTabGroupExtension.java >--- ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java 18 Mar 2005 19:45:27 -0000 1.17 >+++ ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java 13 Oct 2006 17:50:01 -0000 >@@ -18,6 +18,7 @@ > > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IConfigurationElement; >+import org.eclipse.debug.internal.core.IConfigurationElementConstants; > import org.eclipse.debug.ui.ILaunchConfigurationTabGroup; > > >@@ -84,15 +85,18 @@ > */ > protected Set getModes() { > if (fModes == null) { >- IConfigurationElement[] modes= getConfigurationElement().getChildren("launchMode"); //$NON-NLS-1$ >+ IConfigurationElement[] modes= getConfigurationElement().getChildren(IConfigurationElementConstants.LAUNCH_MODE); > if (modes.length > 0) { > fModes = new HashSet(modes.length); > fPerspectives = new Hashtable(modes.length); >+ IConfigurationElement element = null; >+ String perspective = null; >+ String mode = null; > for (int i = 0; i < modes.length; i++) { >- IConfigurationElement element = modes[i]; >- String mode = element.getAttribute("mode"); //$NON-NLS-1$ >+ element = modes[i]; >+ mode = element.getAttribute(IConfigurationElementConstants.MODE); > fModes.add(mode); >- String perspective = element.getAttribute("perspective"); //$NON-NLS-1$ >+ perspective = element.getAttribute(IConfigurationElementConstants.PERSPECTIVE); > if (perspective != null) { > fPerspectives.put(mode, perspective); > } >@@ -127,7 +131,7 @@ > * tab group is associated with > */ > protected String getTypeIdentifier() { >- return getConfigurationElement().getAttribute("type"); //$NON-NLS-1$ >+ return getConfigurationElement().getAttribute(IConfigurationElementConstants.TYPE); > } > > /** >@@ -139,7 +143,17 @@ > * @since 2.1 > */ > protected String getHelpContextId() { >- return getConfigurationElement().getAttribute("helpContextId"); //$NON-NLS-1$ >+ return getConfigurationElement().getAttribute(IConfigurationElementConstants.HELP_CONTEXT_ID); >+ } >+ >+ /** >+ * Returns the identifier of the tab group >+ * @return the id of the tab group >+ * >+ * @since 3.3 >+ */ >+ protected String getIdentifier() { >+ return getConfigurationElement().getAttribute(IConfigurationElementConstants.ID); > } > > /** >@@ -150,7 +164,7 @@ > * the tab group > */ > public ILaunchConfigurationTabGroup newTabGroup() throws CoreException { >- return (ILaunchConfigurationTabGroup)getConfigurationElement().createExecutableExtension("class"); //$NON-NLS-1$ >+ return (ILaunchConfigurationTabGroup)getConfigurationElement().createExecutableExtension(IConfigurationElementConstants.CLASS); > } > > /** >@@ -163,17 +177,18 @@ > public String getDescription(String mode) { > String description = null; > >- IConfigurationElement[] children = fConfig.getChildren("launchMode"); //$NON-NLS-1$ >+ IConfigurationElement[] children = fConfig.getChildren(IConfigurationElementConstants.LAUNCH_MODE); > if (children!= null && children.length != 0) { >+ IConfigurationElement child = null; > for (int i=0; i<children.length; i++) { >- IConfigurationElement child = children[i]; >+ child = children[i]; > if (child.getAttribute("mode").equals(mode)) { //$NON-NLS-1$ >- description = child.getAttribute("description"); //$NON-NLS-1$ >+ description = child.getAttribute(IConfigurationElementConstants.DESCRIPTION); > } > } > } > if (description == null){ >- description = fConfig.getAttribute("description"); //$NON-NLS-1$ >+ description = fConfig.getAttribute(IConfigurationElementConstants.DESCRIPTION); > } > > if (description == null) >Index: ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java,v >retrieving revision 1.65 >diff -u -r1.65 LaunchConfigurationTabGroupViewer.java >--- ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java 2 Aug 2006 18:52:40 -0000 1.65 >+++ ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java 13 Oct 2006 17:50:01 -0000 >@@ -11,6 +11,9 @@ > package org.eclipse.debug.internal.ui.launchConfigurations; > > >+import java.util.HashSet; >+import java.util.Set; >+ > import org.eclipse.core.resources.IResource; > import org.eclipse.core.resources.ResourcesPlugin; > import org.eclipse.core.runtime.CoreException; >@@ -20,6 +23,7 @@ > import org.eclipse.debug.core.ILaunchConfiguration; > import org.eclipse.debug.core.ILaunchConfigurationType; > import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; >+import org.eclipse.debug.internal.core.LaunchManager; > import org.eclipse.debug.internal.ui.DebugUIPlugin; > import org.eclipse.debug.internal.ui.IInternalDebugUIConstants; > import org.eclipse.debug.internal.ui.SWTUtil; >@@ -29,6 +33,7 @@ > import org.eclipse.debug.ui.ILaunchConfigurationTabGroup; > import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.jface.dialogs.ErrorDialog; >+import org.eclipse.jface.dialogs.IDialogConstants; > import org.eclipse.jface.viewers.ISelection; > import org.eclipse.jface.viewers.IStructuredSelection; > import org.eclipse.jface.viewers.SelectionChangedEvent; >@@ -69,7 +74,7 @@ > * buttons. > */ > public class LaunchConfigurationTabGroupViewer extends Viewer { >- >+ > private final String EMPTY_STRING = ""; //$NON-NLS-1$ > /** > * Containing launch dialog >@@ -162,6 +167,13 @@ > private Composite fTabPlaceHolder = null; > > /** >+ * A link to allow users to select a valid set of launch options for the specified mode >+ * @since 3.3 >+ * EXPERIMENTAL >+ */ >+ private Link fOptionsLink = null; >+ >+ /** > * A new composite replacing the perspectives tab > * @since 3.2 > */ >@@ -239,7 +251,6 @@ > fTabPlaceHolder = new Composite(mainComp, SWT.NONE); > fTabPlaceHolder.setLayout(new StackLayout()); > gd = new GridData(GridData.FILL_BOTH); >- gd.horizontalSpan = 2; > fTabPlaceHolder.setLayoutData(gd); > > fGettingStarted = new Composite(fTabPlaceHolder, SWT.NONE); >@@ -256,7 +267,7 @@ > fTabComposite.setLayout(layout); > gd = new GridData(GridData.FILL_BOTH); > fTabComposite.setLayoutData(gd); >- >+ > fNameLabel = new Label(fTabComposite, SWT.HORIZONTAL | SWT.LEFT); > fNameLabel.setText(LaunchConfigurationsMessages.LaunchConfigurationDialog__Name__16); > fNameLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING)); >@@ -272,14 +283,46 @@ > > createTabFolder(fTabComposite); > >- Composite buttonComp = new Composite(mainComp, SWT.NONE); >+ Composite blComp = SWTUtil.createComposite(mainComp, mainComp.getFont(), 2, 1, GridData.FILL_HORIZONTAL); >+ Composite linkComp = SWTUtil.createComposite(blComp, blComp.getFont(), 1, 1, GridData.FILL_HORIZONTAL); >+// a link for launch options >+ fOptionsLink = new Link(linkComp, SWT.NONE); >+ fOptionsLink.setText(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_13); >+ fOptionsLink.setFont(linkComp.getFont()); >+ gd = new GridData(GridData.BEGINNING); >+ fOptionsLink.setLayoutData(gd); >+ fOptionsLink.addSelectionListener(new SelectionListener() { >+ public void widgetSelected(SelectionEvent e) { >+ //collect the options available >+ SelectLaunchOptionsDialog sld = new SelectLaunchOptionsDialog(getShell(), >+ getLaunchConfigurationDialog().getMode(), >+ ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getLaunchDelegates(fTabType.getIdentifier())); >+ if(sld.open() == IDialogConstants.OK_ID) { >+ //set the options to the config >+ Object[] res = sld.getResult(); >+ if(res != null) { >+ HashSet list = new HashSet(); >+ for(int i = 0; i < res.length; i++) { >+ list.add(res[i]); >+ } >+ ILaunchConfigurationWorkingCopy wc = getWorkingCopy(); >+ wc.setOptions(list); >+ refresh(); >+ refreshStatus(); >+ } >+ } >+ } >+ public void widgetDefaultSelected(SelectionEvent e) {} >+ }); >+ fOptionsLink.setVisible(false); >+ >+ Composite buttonComp = new Composite(blComp, SWT.NONE); > GridLayout buttonCompLayout = new GridLayout(); > buttonCompLayout.numColumns = 2; > buttonComp.setLayout(buttonCompLayout); > gd = new GridData(GridData.HORIZONTAL_ALIGN_END); >- gd.horizontalSpan = 2; > buttonComp.setLayoutData(gd); >- >+ > fApplyButton = new Button(buttonComp, SWT.PUSH); > fApplyButton.setText(LaunchConfigurationsMessages.LaunchConfigurationDialog__Apply_17); > gd = new GridData(GridData.HORIZONTAL_ALIGN_END); >@@ -305,6 +348,17 @@ > } > > /** >+ * Shows/hides the options link on the top of the viewer >+ * @param show true if the link should be visible, false otherwise >+ * @since 3.3 >+ * >+ * EXPERIMENTAL >+ */ >+ protected void showOptionsLink(boolean show) { >+ fOptionsLink.setVisible(show); >+ } >+ >+ /** > * Simple method to create a spacer in the page > * > * @param composite the composite to add the spacer to >@@ -485,7 +539,8 @@ > error = tabs[i].getErrorMessage() != null; > item = fTabFolder.getItem(i); > setTabIcon(item, error, tabs[i]); >- } >+ } >+ fOptionsLink.setVisible(!canLaunchWithOptions()); > } > } > >@@ -958,10 +1013,41 @@ > return false; > } > } >+ > return true; > } > > /** >+ * Determines if the tab groups that is currently visible can launch with the currently selected >+ * set of 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> >+ * @return >+ */ >+ public boolean canLaunchWithOptions() { >+ if(fInitializingTabs) { >+ return false; >+ } >+ //check if selected options exist and that the selected combination can be launched >+ try { >+ ILaunchConfigurationWorkingCopy wc = getWorkingCopy(); >+ Set options = wc.getOptions(); >+ if(options.size() > 0) { >+ return ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getLaunchDelegates(fTabType.getIdentifier(), getLaunchConfigurationDialog().getMode(), (String[]) options.toArray(new String[options.size()])).length > 0; >+ } >+ } >+ catch (CoreException e) { >+ e.printStackTrace(); >+ } >+ return true; >+ } >+ >+ /** > * Returns the current error message or <code>null</code> if none. > */ > public String getErrorMesssage() { >@@ -988,6 +1074,7 @@ > return message; > } > >+ //EXPERIMENTAL > ILaunchConfigurationTab[] allTabs = getTabs(); > for (int i = 0; i < allTabs.length; i++) { > ILaunchConfigurationTab tab = allTabs[i]; >@@ -1004,6 +1091,19 @@ > return temp.toString(); > } > } >+ if(!canLaunchWithOptions()) { >+ try { >+ Object o = getInput(); >+ String name = null; >+ if(o instanceof ILaunchConfiguration) { >+ ILaunchConfiguration lc = (ILaunchConfiguration) o; >+ name = LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_9+lc.getName(); >+ } >+ return (name == null ? LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_10 : name) + LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_11+getLaunchConfigurationDialog().getMode()+LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_12+getWorkingCopy().getOptions().toString(); >+ } catch (CoreException e) { >+ e.printStackTrace(); >+ } >+ } > return null; > } > >Index: ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java,v >retrieving revision 1.176 >diff -u -r1.176 LaunchConfigurationDialog.java >--- ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java 15 Jun 2006 20:00:41 -0000 1.176 >+++ ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java 13 Oct 2006 17:50:01 -0000 >@@ -68,7 +68,7 @@ > public void updateButtons() { > // Launch button > getTabViewer().refresh(); >- getButton(ID_LAUNCH_BUTTON).setEnabled(getTabViewer().canLaunch()); >+ getButton(ID_LAUNCH_BUTTON).setEnabled(getTabViewer().canLaunch() & getTabViewer().canLaunchWithOptions()); > > } > >Index: ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties,v >retrieving revision 1.154 >diff -u -r1.154 LaunchConfigurationsMessages.properties >--- ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties 2 Aug 2006 16:13:30 -0000 1.154 >+++ ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties 13 Oct 2006 17:50:01 -0000 >@@ -46,12 +46,17 @@ > LaunchConfigurationDialog_An_exception_occurred_while_retrieving_launch_configurations_20=An exception occurred while retrieving launch configurations > LaunchConfigurationTabGroupViewer_0={0} is an invalid character in launch configuration name {1} > LaunchConfigurationTabGroupViewer_1=Configure launch settings from this dialog: >+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_2=- Press the 'New' button to create a configuration of the selected type. > LaunchConfigurationTabGroupViewer_3=- Edit or view an existing configuration by selecting it. > LaunchConfigurationTabGroupViewer_4=- Press the 'Delete' button to remove the selected configuration. > LaunchConfigurationTabGroupViewer_6=- Press the 'Duplicate' button to copy the selected configuration. > 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=Configuration > LaunchConfigurationDialog_Create__manage__and_run_launch_configurations_8=Create, manage, and run configurations > LaunchConfigurationDialog_Dele_te_14=De&lete > LaunchConfigurationDialog_Discard_changes__38=Discard changes? >@@ -65,6 +70,8 @@ > LaunchConfigurationDialog_Name_required_for_launch_configuration_11=Name required for launch configuration > LaunchConfigurationDialog_Ne_w_13=Ne&w > LaunchConfigurationDialog_No_33=No >+LaunchConfigurationEditDialog_0=Modify configuration and continue. >+LaunchConfigurationEditDialog_1=Continue > LaunchConfigurationDialog_Ready_to_launch_2=Ready to launch > LaunchConfigurationDialog_Save_changes__31=Save changes? > LaunchConfigurationDialog_The_configuration___29=The configuration "{0}" has unsaved changes. Do you wish to save them? >@@ -96,7 +103,7 @@ > LaunchConfigurationPropertiesDialog_Edit_launch_configuration_properties_1=Edit launch configuration properties > LaunchConfigurationPropertiesDialog_Properties_for__0__2=Properties for {0} > >-LaunchConfigurationDialog_Modify_attributes_and_launch__1=Modify attributes and launch. >+LaunchConfigurationDialog_Modify_attributes_and_launch__1=Edit configuration and launch. > > LaunchConfigurationTabGroupViewer_No_tabs_defined_for_launch_configuration_type__0__1=No tabs defined for launch configuration type {0} > >@@ -162,3 +169,9 @@ > CollapseAllLaunchConfigurationAction_0=Collapse All > CollapseAllLaunchConfigurationAction_1=Collapses all expanded launch configurations. > CollapseAllLaunchConfigurationAction_2=This action collapses all of the launch configurations currently visible and expanded. >+SelectLaunchOptionsDialog_0=\ (with no options) >+SelectLaunchOptionsDialog_1=: >+SelectLaunchOptionsDialog_2=A plugin that once provided the ability to launch the saved set of launch options for the current launch configuration is no longer available. As such, you must select a valid set of launch options that can be launched >+SelectLaunchOptionsDialog_3=Select Launch Options >+SelectLaunchOptionsDialog_4=&Select a supported options combination: >+SelectLaunchOptionsDialog_5=\ for >Index: ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java,v >retrieving revision 1.34 >diff -u -r1.34 LaunchConfigurationPresentationManager.java >--- ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java 22 Sep 2006 15:57:13 -0000 1.34 >+++ ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java 13 Oct 2006 17:50:01 -0000 >@@ -11,6 +11,7 @@ > package org.eclipse.debug.internal.ui.launchConfigurations; > > >+import java.util.ArrayList; > import java.util.Hashtable; > import java.util.Iterator; > import java.util.Map; >@@ -22,10 +23,12 @@ > 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.internal.core.IConfigurationElementConstants; > import org.eclipse.debug.internal.ui.DebugUIPlugin; >+import org.eclipse.debug.internal.ui.LaunchConfigurationTabExtension; > import org.eclipse.debug.ui.IDebugUIConstants; >+import org.eclipse.debug.ui.ILaunchConfigurationTab; > import org.eclipse.debug.ui.ILaunchConfigurationTabGroup; > > import com.ibm.icu.text.MessageFormat; >@@ -49,6 +52,16 @@ > * used to represent the default tab group (i.e. unspecified mode). > */ > private Hashtable fTabGroupExtensions; >+ >+ /** >+ * contributed tabs are stored by the tab group id that they contribute to. >+ * each entry is a futher <code>Hashtable</code> consisting of the corrseponding >+ * <code>LaunchConfigurationTabExtension</code> objects for each contributed tab stored by their >+ * id >+ * >+ * @since 3.3 >+ */ >+ private Hashtable fContributedTabs; > > /** > * Constructs the singleton launch configuration presentation >@@ -57,6 +70,7 @@ > private LaunchConfigurationPresentationManager() { > fgDefault = this; > initializeTabGroupExtensions(); >+ initializeContributedTabExtensions(); > } > > /** >@@ -75,52 +89,69 @@ > */ > private void initializeTabGroupExtensions() { > fTabGroupExtensions = new Hashtable(); >- IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_LAUNCH_CONFIGURATION_TAB_GROUPS); >+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_LAUNCH_CONFIGURATION_TAB_GROUPS); > IConfigurationElement[] groups = extensionPoint.getConfigurationElements(); >+ LaunchConfigurationTabGroupExtension group = null; >+ String typeId = null; >+ Map map = null; >+ Set modes = null; > for (int i = 0; i < groups.length; i++) { >- LaunchConfigurationTabGroupExtension group = new LaunchConfigurationTabGroupExtension(groups[i]); >- String typeId = group.getTypeIdentifier(); >- if (typeId == null) { >- IStatus status = new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.STATUS_INVALID_EXTENSION_DEFINITION, >- MessageFormat.format("Launch configuration tab group extension {0} does not specify launch configuration type.", (new String[] {groups[i].getAttribute("id")})), null); //$NON-NLS-1$ //$NON-NLS-2$ >- DebugUIPlugin.log(status); >- } else { >- // verify it references a valid launch configuration type >- ILaunchConfigurationType lct = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(typeId); >- if (lct == null) { >- IStatus status = new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.STATUS_INVALID_EXTENSION_DEFINITION, >- MessageFormat.format("Launch configuration tab group extension {0} refers to non-existent launch configuration type {1}.", (new String[] {groups[i].getAttribute("id"), typeId})), null); //$NON-NLS-1$ //$NON-NLS-2$ >- DebugUIPlugin.log(status); >- } >+ group = new LaunchConfigurationTabGroupExtension(groups[i]); >+ typeId = group.getTypeIdentifier(); >+ map = (Map)fTabGroupExtensions.get(typeId); >+ if (map == null) { >+ map = new Hashtable(); >+ fTabGroupExtensions.put(typeId, map); > } >- if (typeId != null) { >- // get the map for the config type >- Map map = (Map)fTabGroupExtensions.get(typeId); >- if (map == null) { >- map = new Hashtable(); >- fTabGroupExtensions.put(typeId, map); >- } >- Set modes = group.getModes(); >- if (modes == null) { >- // default tabs - store with "*" >- map.put("*", group); //$NON-NLS-1$ >- } else { >- // store per mode >- Iterator iterator = modes.iterator(); >- while (iterator.hasNext()) { >- map.put(iterator.next(), group); >- } >+ modes = group.getModes(); >+ if (modes == null) { >+ // default tabs - store with "*" >+ map.put("*", group); //$NON-NLS-1$ >+ } else { >+ // store per mode >+ Iterator iterator = modes.iterator(); >+ while (iterator.hasNext()) { >+ map.put(iterator.next(), group); > } > } > } > } > > /** >+ * This method is used to collect all of the contributed tabs defined by the <code>launchConfigurationTabs</code> >+ * extension point >+ * <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 void initializeContributedTabExtensions() { >+ fContributedTabs = new Hashtable(); >+ IExtensionPoint epoint = Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_CONTRIBUTED_LAUNCH_TABS); >+ IConfigurationElement[] elements = epoint.getConfigurationElements(); >+ LaunchConfigurationTabExtension tab = null; >+ Hashtable element = null; >+ for(int i = 0; i < elements.length; i++) { >+ tab = new LaunchConfigurationTabExtension(elements[i]); >+ element = (Hashtable) fContributedTabs.get(tab.getTabGroupId()); >+ if(element == null) { >+ element = new Hashtable(); >+ element.put(tab.getIdentifier(), tab); >+ fContributedTabs.put(tab.getTabGroupId(), element); >+ } >+ element.put(tab.getIdentifier(), tab); >+ } >+ } >+ >+ /** > * Returns the tab group for the given launch configuration type and mode. > * > * @param type launch configuration type > * @param mode launch mode >- * @return the tab group for the given type of launch configuration >+ * @return the tab group for the given type of launch configuration, or <code>null</code> if none > * @exception CoreException if an exception occurs creating the group > */ > public ILaunchConfigurationTabGroup getTabGroup(ILaunchConfigurationType type, String mode) throws CoreException { >@@ -130,7 +161,37 @@ > MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationPresentationManager_No_tab_group_defined_for_launch_configuration_type__0__3, (new String[] {type.getIdentifier()})), null); > throw new CoreException(status); > } >- return ext.newTabGroup(); >+ return new LaunchConfigurationTabGroupWrapper(ext.newTabGroup(), ext.getIdentifier()); >+ } >+ >+ /** >+ * Returns the listing of <code>ILaunchConfigurationTab</code>s for the specified <code>ILaunchConfigurationTabGroup</code>. >+ * If no tabs are found for the specified id an empty array is returned, never <code>null</code> >+ * @param groupid >+ * @return the <code>ILaunchConfigurationTab</code>s for the specified <code>ILaunchConfigurationTabGroup</code> id, >+ * or an empty array if none are found >+ * >+ * <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 ILaunchConfigurationTab[] createContributedTabs(String groupid) { >+ Hashtable tabs = (Hashtable) fContributedTabs.get(groupid); >+ ArrayList list = new ArrayList(); >+ if(tabs != null) { >+ LaunchConfigurationTabExtension ext = null; >+ for(Iterator iter = tabs.keySet().iterator(); iter.hasNext();) { >+ ext = (LaunchConfigurationTabExtension) tabs.get(iter.next()); >+ if(ext != null) { >+ list.add(ext.getTab()); >+ } >+ } >+ } >+ return (ILaunchConfigurationTab[]) list.toArray(new ILaunchConfigurationTab[list.size()]); > } > > /** >@@ -187,7 +248,7 @@ > */ > public String getDescription(ILaunchConfigurationType configType, String mode) { > LaunchConfigurationPresentationManager manager = LaunchConfigurationPresentationManager.getDefault(); >- LaunchConfigurationTabGroupExtension extension = manager.getExtension(configType.getAttribute("id"), mode); //$NON-NLS-1$ >+ LaunchConfigurationTabGroupExtension extension = manager.getExtension(configType.getAttribute(IConfigurationElementConstants.ID), mode); > return (extension != null ? extension.getDescription(mode) : null); > } > >Index: ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java,v >retrieving revision 1.36 >diff -u -r1.36 LaunchConfigurationsMessages.java >--- ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java 2 Aug 2006 16:13:30 -0000 1.36 >+++ ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java 13 Oct 2006 17:50:01 -0000 >@@ -58,6 +58,10 @@ > public static String LaunchConfigurationDialog__Apply_17; > public static String LaunchConfigurationDialog__Name__16; > public static String LaunchConfigurationDialog_An_exception_occurred_while_retrieving_launch_configurations_20; >+ >+ public static String LaunchConfigurationEditDialog_0; >+ >+ public static String LaunchConfigurationEditDialog_1; > public static String LaunchConfigurationTabGroupViewer_0; > public static String LaunchConfigurationDialog_Create__manage__and_run_launch_configurations_8; > public static String LaunchConfigurationDialog_Dele_te_14; >@@ -88,6 +92,16 @@ > public static String LaunchConfigurationsDialog_Warning_2; > public static String LaunchConfigurationsDialog_Information_3; > public static String LaunchConfigurationPresentationManager_No_tab_group_defined_for_launch_configuration_type__0__3; >+ >+ public static String LaunchConfigurationTabGroupViewer_10; >+ >+ public static String LaunchConfigurationTabGroupViewer_11; >+ >+ public static String LaunchConfigurationTabGroupViewer_12; >+ >+ public static String LaunchConfigurationTabGroupViewer_13; >+ >+ public static String LaunchConfigurationTabGroupViewer_9; > public static String PerspectiveManager_Error_1; > public static String PerspectiveManager_Unable_to_switch_perpsectives_as_specified_by_launch___0__4; > public static String PerspectiveManager_Unable_to_switch_to_perspective___0__2; >@@ -201,4 +215,16 @@ > > public static String CollapseAllLaunchConfigurationAction_2; > >+ public static String SelectLaunchOptionsDialog_0; >+ >+ public static String SelectLaunchOptionsDialog_1; >+ >+ public static String SelectLaunchOptionsDialog_2; >+ >+ public static String SelectLaunchOptionsDialog_3; >+ >+ public static String SelectLaunchOptionsDialog_4; >+ >+ public static String SelectLaunchOptionsDialog_5; >+ > } >Index: ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java,v >retrieving revision 1.181 >diff -u -r1.181 LaunchConfigurationsDialog.java >--- ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java 10 Oct 2006 16:33:24 -0000 1.181 >+++ ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java 13 Oct 2006 17:50:01 -0000 >@@ -519,7 +519,7 @@ > IStructuredSelection selection = (IStructuredSelection)fLaunchConfigurationView.getViewer().getSelection(); > Object target = selection.getFirstElement(); > if (target instanceof ILaunchConfiguration) { >- if (getTabViewer().canLaunch()) { >+ if (getTabViewer().canLaunch() & getTabViewer().canLaunchWithOptions()) { > handleLaunchPressed(); > } > } else { >@@ -1421,7 +1421,7 @@ > getDeleteAction().setEnabled(getDeleteAction().isEnabled()); > getDuplicateAction().setEnabled(getDuplicateAction().isEnabled()); > getTabViewer().refresh(); >- getButton(ID_LAUNCH_BUTTON).setEnabled(getTabViewer().canLaunch()); >+ getButton(ID_LAUNCH_BUTTON).setEnabled(getTabViewer().canLaunch() & getTabViewer().canLaunchWithOptions()); > } > > /* (non-Javadoc) >Index: ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupPanel.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupPanel.java,v >retrieving revision 1.17 >diff -u -r1.17 SourceLookupPanel.java >--- ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupPanel.java 21 Jun 2006 20:04:04 -0000 1.17 >+++ ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupPanel.java 13 Oct 2006 17:50:02 -0000 >@@ -258,7 +258,8 @@ > if (type == null) { > type = configuration.getType().getSourceLocatorId(); > } >- }catch(CoreException e){ >+ } >+ catch(CoreException e){ > setErrorMessage(e.getMessage()); > return; > } >Index: schema/launchConfigurationTabs.exsd >=================================================================== >RCS file: schema/launchConfigurationTabs.exsd >diff -N schema/launchConfigurationTabs.exsd >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ schema/launchConfigurationTabs.exsd 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,137 @@ >+<?xml version='1.0' encoding='UTF-8'?> >+<!-- Schema file written by PDE --> >+<schema targetNamespace="org.eclipse.debug.ui"> >+<annotation> >+ <appInfo> >+ <meta.schema plugin="org.eclipse.debug.ui" id="launchConfigurationTabs" name="Launch Configuration Tabs"/> >+ </appInfo> >+ <documentation> >+ This extension point is used to allow developers to contribute launch configuration tabs (one or more) to an existing launch configuration tab group. >+ >+ >+<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> >+ </documentation> >+ </annotation> >+ >+ <element name="extension"> >+ <complexType> >+ <sequence minOccurs="1" maxOccurs="unbounded"> >+ <element ref="tab"/> >+ </sequence> >+ <attribute name="point" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <element name="tab"> >+ <annotation> >+ <documentation> >+ describes an individual launch configuration tab contribution >+ </documentation> >+ </annotation> >+ <complexType> >+ <attribute name="id" type="string" use="required"> >+ <annotation> >+ <documentation> >+ the unique id of this contributed tab >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="group" type="string" use="required"> >+ <annotation> >+ <documentation> >+ the string id of the <code>ILaunchConfigurationTabGroup</code> that this tab should be contributed to >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="name" type="string" use="required"> >+ <annotation> >+ <documentation> >+ a human readable name for this tab. the prvided name does not have to be the name that you wish to appear on the tab itself. But it should sufficiently describe your tab. >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="class" type="string" use="required"> >+ <annotation> >+ <documentation> >+ the implementation of your tab >+ </documentation> >+ <appInfo> >+ <meta.attribute kind="java" basedOn="org.eclipse.debug.ui.ILaunchConfigurationTab"/> >+ </appInfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="since"/> >+ </appInfo> >+ <documentation> >+ Eclipse 3.3 M3 >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="examples"/> >+ </appInfo> >+ <documentation> >+ The following example adds the tab "FooTab" to the local java application launch tab group. >+ >+<p> >+<pre> >+<extension point="org.eclipse.debug.ui.launchConfigurationTabs"> >+ <tab >+ class="org.eclipse.jdt.debug.ui.launchConfigurations.FooTab" >+ group="org.eclipse.jdt.debug.ui.launchConfigurationTabGroup.localJavaApplication" >+ id="org.eclipse.jdt.debug.ui.fooTab" >+ name="Foo Tab"> >+ </tab> >+ </extension> >+</pre> >+</p> >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="apiInfo"/> >+ </appInfo> >+ <documentation> >+ [Enter API information here.] >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="implementation"/> >+ </appInfo> >+ <documentation> >+ [Enter information about supplied implementation of this extension point.] >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="copyright"/> >+ </appInfo> >+ <documentation> >+ Copyright (c) 2006 IBM Corporation and others.<br> >+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 >+<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> >+ </documentation> >+ </annotation> >+ >+</schema> >Index: ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java >=================================================================== >RCS file: ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java >diff -N ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,128 @@ >+package org.eclipse.debug.internal.ui.launchConfigurations; >+ >+import org.eclipse.debug.core.ILaunch; >+import org.eclipse.debug.core.ILaunchConfiguration; >+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; >+import org.eclipse.debug.ui.ILaunchConfigurationDialog; >+import org.eclipse.debug.ui.ILaunchConfigurationTab; >+import org.eclipse.debug.ui.ILaunchConfigurationTabGroup; >+ >+/** >+ * This class is used to wrap a contributed <code>ILaunchConfigurationTabGroup</code> with any contributed tabs >+ * for that group (from a <code>launchConfigurationTabs</code> extension point). >+ * >+ * <p> >+ * <strong>EXPERIMENTAL</strong>. This class has been added as >+ * part of a work in progress. There is no guarantee that this API will >+ * remain unchanged during the 3.3 release cycle. Please do not use this API >+ * without consulting with the Platform/Debug team. >+ * </p> >+ * @since 3.3 >+ */ >+public class LaunchConfigurationTabGroupWrapper implements ILaunchConfigurationTabGroup { >+ >+ private ILaunchConfigurationTabGroup fGroup = null; >+ private String fGroupId = null; >+ private ILaunchConfigurationTab[] fContributedTabs = null; >+ >+ /** >+ * Constructor >+ * @param group the existing group to wrapper >+ */ >+ public LaunchConfigurationTabGroupWrapper(ILaunchConfigurationTabGroup group, String groupId) { >+ fGroup = group; >+ fGroupId = groupId; >+ } >+ >+ /** >+ * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String) >+ */ >+ public void createTabs(ILaunchConfigurationDialog dialog, String mode) { >+ if(fGroup != null) { >+ fGroup.createTabs(dialog, mode); >+ } >+ } >+ >+ /** >+ * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#dispose() >+ */ >+ public void dispose() { >+ if(fGroup != null) { >+ fGroup.dispose(); >+ } >+ if(fContributedTabs != null) { >+ for(int i = 0; i < fContributedTabs.length; i++) { >+ fContributedTabs[i].dispose(); >+ } >+ } >+ } >+ >+ /** >+ * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#getTabs() >+ */ >+ public ILaunchConfigurationTab[] getTabs() { >+ if(fContributedTabs == null) { >+ fContributedTabs = LaunchConfigurationPresentationManager.getDefault().createContributedTabs(fGroupId); >+ } >+ ILaunchConfigurationTab[] grouptabs = fGroup.getTabs(); >+ ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[grouptabs.length + fContributedTabs.length]; >+ System.arraycopy(grouptabs, 0, tabs, 0, grouptabs.length); >+ System.arraycopy(fContributedTabs, 0, tabs, grouptabs.length, fContributedTabs.length); >+ return tabs; >+ } >+ >+ /** >+ * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) >+ */ >+ public void initializeFrom(ILaunchConfiguration configuration) { >+ if(fGroup != null) { >+ fGroup.initializeFrom(configuration); >+ } >+ if(fContributedTabs == null) { >+ getTabs(); >+ } >+ for(int i = 0; i < fContributedTabs.length; i++) { >+ fContributedTabs[i].initializeFrom(configuration); >+ } >+ } >+ >+ /** >+ * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#launched(org.eclipse.debug.core.ILaunch) >+ */ >+ public void launched(ILaunch launch) { >+ if(fGroup != null) { >+ fGroup.launched(launch); >+ } >+ } >+ >+ /** >+ * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) >+ */ >+ public void performApply(ILaunchConfigurationWorkingCopy configuration) { >+ if(fGroup != null) { >+ fGroup.performApply(configuration); >+ if(fContributedTabs == null) { >+ getTabs(); >+ } >+ for(int i = 0; i < fContributedTabs.length; i++) { >+ fContributedTabs[i].performApply(configuration); >+ } >+ } >+ } >+ >+ /** >+ * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) >+ */ >+ public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { >+ if(fGroup != null) { >+ fGroup.setDefaults(configuration); >+ if(fContributedTabs == null) { >+ getTabs(); >+ } >+ for(int i = 0; i < fContributedTabs.length; i++) { >+ fContributedTabs[i].setDefaults(configuration); >+ } >+ } >+ } >+ >+} >Index: ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationEditDialog.java >=================================================================== >RCS file: ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationEditDialog.java >diff -N ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationEditDialog.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationEditDialog.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,59 @@ >+/******************************************************************************* >+ * 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.ui.launchConfigurations; >+ >+import org.eclipse.debug.core.ILaunchConfiguration; >+import org.eclipse.debug.ui.IDebugUIConstants; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Shell; >+ >+/** >+ * This class is used to construct a launch configuraityon dialog used to edit a launch configuration and continue, >+ * not allowing a launch to occur. >+ * >+ * @since 3.3 >+ * >+ * EXPERIMENTAL >+ */ >+public class LaunchConfigurationEditDialog extends LaunchConfigurationDialog { >+ >+ public LaunchConfigurationEditDialog(Shell shell, ILaunchConfiguration launchConfiguration, LaunchGroupExtension group) { >+ super(shell, launchConfiguration, group); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#getTitleAreaTitle() >+ */ >+ protected String getTitleAreaTitle() { >+ return LaunchConfigurationsMessages.LaunchConfigurationEditDialog_0; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite) >+ */ >+ protected void createButtonsForButtonBar(Composite parent) { >+ createButton(parent, ID_CLOSE_BUTTON, LaunchConfigurationsMessages.LaunchConfigurationEditDialog_1, true); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#updateButtons() >+ */ >+ public void updateButtons() { >+ getTabViewer().refresh(); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#getDialogSettingsSectionName() >+ */ >+ protected String getDialogSettingsSectionName() { >+ return IDebugUIConstants.PLUGIN_ID + ".LAUNCH_CONFIGURATION_EDIT_DIALOG_SECTION"; //$NON-NLS-1$ >+ } >+} >Index: ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java >=================================================================== >RCS file: ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java >diff -N ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,82 @@ >+/******************************************************************************* >+ * 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.ui; >+ >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IConfigurationElement; >+import org.eclipse.debug.internal.core.IConfigurationElementConstants; >+import org.eclipse.debug.ui.ILaunchConfigurationTab; >+ >+/** >+ * Provides a proxy to a launchConfigurationTabs extension point >+ * >+ * <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 final class LaunchConfigurationTabExtension { >+ >+ /** >+ * The configuration element backing this proxy >+ */ >+ IConfigurationElement fElement = null; >+ >+ /** >+ * Constructor >+ * @param element the <code>IConfigurationElement</code> for this proxy >+ */ >+ public LaunchConfigurationTabExtension(IConfigurationElement element) { >+ fElement = element; >+ } >+ >+ /** >+ * Returns the unique id ofthe tab >+ * @return the unique id of the tab >+ */ >+ public String getIdentifier() { >+ return fElement.getAttribute(IConfigurationElementConstants.ID); >+ } >+ >+ /** >+ * Returns the human readable name for the tab, not to be confused with the name that appears on the tab itself >+ * @return the name of the tab >+ */ >+ public String getName() { >+ return fElement.getAttribute(IConfigurationElementConstants.NAME); >+ } >+ >+ /** >+ * Returns the instantiated class of this tab >+ * @return the instantiated class of this tab >+ */ >+ public ILaunchConfigurationTab getTab() { >+ try { >+ Object object = fElement.createExecutableExtension(IConfigurationElementConstants.CLASS); >+ if(object instanceof ILaunchConfigurationTab) { >+ return (ILaunchConfigurationTab) object; >+ } >+ } catch (CoreException e) {DebugUIPlugin.log(e);} >+ return null; >+ } >+ >+ /** >+ * Returns the unique id of the <code>ILaunchConfigurationTabGroup</code> that this tab contributes to >+ * @return the id of the <code>ILaunchConfigurationTabGroup</code> this tab conributes to >+ */ >+ public String getTabGroupId() { >+ return fElement.getAttribute(IConfigurationElementConstants.GROUP); >+ } >+ >+} >Index: ui/org/eclipse/debug/ui/AbstractOptionLaunchConfigurationTab.java >=================================================================== >RCS file: ui/org/eclipse/debug/ui/AbstractOptionLaunchConfigurationTab.java >diff -N ui/org/eclipse/debug/ui/AbstractOptionLaunchConfigurationTab.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/debug/ui/AbstractOptionLaunchConfigurationTab.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,83 @@ >+/******************************************************************************* >+ * 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.ui; >+ >+import java.util.Set; >+ >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.debug.core.DebugPlugin; >+import org.eclipse.debug.core.ILaunchConfiguration; >+import org.eclipse.debug.core.ILaunchConfigurationListener; >+import org.eclipse.debug.internal.ui.DebugUIPlugin; >+import org.eclipse.swt.widgets.Composite; >+ >+/** >+ * This class provides a basis for the contribution of an <code>ILaunchConfigurationTab</code> which manipulates >+ * a specified launch modification option. >+ * >+ * This class is intended to be subclassed by clients, and should be subclassed if a tab with an option it contributed >+ * >+ * @since 3.3 >+ * >+ * EXPERIMENTAL >+ */ >+public abstract class AbstractOptionLaunchConfigurationTab extends AbstractLaunchConfigurationTab implements ILaunchConfigurationListener { >+ >+ /** >+ * This method returns the name of the option that this tab controls >+ * @return the name of the option that this tab is to control >+ */ >+ public abstract Set getOptions(); >+ >+ /** >+ * This method is used to update the controls associated with setting the option for this tab. >+ * Update of the control takes place when a launch configuration has changed, which can occur when a tab >+ * is deactivated, or if an option is modified outside of the tabs' control. >+ * @param options the current list of options from the working copy >+ */ >+ public abstract void updateOptionControls(Set options); >+ >+ /** >+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite) >+ */ >+ public void createControl(Composite parent) { >+ DebugPlugin.getDefault().getLaunchManager().addLaunchConfigurationListener(this); >+ } >+ >+ /** >+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose() >+ */ >+ public void dispose() { >+ DebugPlugin.getDefault().getLaunchManager().removeLaunchConfigurationListener(this); >+ super.dispose(); >+ } >+ >+ /** >+ * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationAdded(org.eclipse.debug.core.ILaunchConfiguration) >+ */ >+ public void launchConfigurationAdded(ILaunchConfiguration configuration) {} >+ >+ /** >+ * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration) >+ */ >+ public void launchConfigurationRemoved(ILaunchConfiguration configuration) {} >+ >+ /** >+ * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationChanged(org.eclipse.debug.core.ILaunchConfiguration) >+ */ >+ public void launchConfigurationChanged(ILaunchConfiguration configuration) { >+ try { >+ updateOptionControls(configuration.getOptions()); >+ } >+ catch (CoreException e) {DebugUIPlugin.log(e);} >+ } >+ >+} >Index: ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchOptionsDialog.java >=================================================================== >RCS file: ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchOptionsDialog.java >diff -N ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchOptionsDialog.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchOptionsDialog.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,164 @@ >+/******************************************************************************* >+ * 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.ui.launchConfigurations; >+ >+import java.util.Set; >+ >+import org.eclipse.debug.internal.core.LaunchDelegate; >+import org.eclipse.debug.internal.ui.DebugUIPlugin; >+import org.eclipse.debug.internal.ui.IDebugHelpContextIds; >+import org.eclipse.debug.internal.ui.SWTUtil; >+import org.eclipse.debug.ui.IDebugUIConstants; >+import org.eclipse.jface.dialogs.Dialog; >+import org.eclipse.jface.dialogs.IDialogSettings; >+import org.eclipse.jface.viewers.ArrayContentProvider; >+import org.eclipse.jface.viewers.CheckStateChangedEvent; >+import org.eclipse.jface.viewers.CheckboxTableViewer; >+import org.eclipse.jface.viewers.ICheckStateListener; >+import org.eclipse.jface.viewers.ILabelProvider; >+import org.eclipse.jface.viewers.ILabelProviderListener; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.graphics.Image; >+import org.eclipse.swt.graphics.Point; >+import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.Shell; >+import org.eclipse.swt.widgets.Table; >+import org.eclipse.ui.PlatformUI; >+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 >+ * configuration state of the the current launch configuration >+ * >+ * @since 3.3 >+ * >+ * EXPERIMENTAL >+ */ >+public class SelectLaunchOptionsDialog extends SelectionDialog { >+ >+ /** >+ * Builds labels for list control of the form: Mode + (no options) | [optionslist] >+ */ >+ class OptionsLabelProvider implements ILabelProvider { >+ public Image getImage(Object element) {return null;} >+ public String getText(Object element) { >+ LaunchDelegate del = (LaunchDelegate) element; >+ Set set = del.getOptions(); >+ return del.getName() + LaunchConfigurationsMessages.SelectLaunchOptionsDialog_5 + fMode + (set.isEmpty() ? LaunchConfigurationsMessages.SelectLaunchOptionsDialog_0 : LaunchConfigurationsMessages.SelectLaunchOptionsDialog_1 + set); >+ } >+ public void addListener(ILabelProviderListener listener) {} >+ public void dispose() {} >+ public boolean isLabelProperty(Object element, String property) {return false;} >+ public void removeListener(ILabelProviderListener listener) {} >+ } >+ >+ private static final String SETTINGS_ID = IDebugUIConstants.PLUGIN_ID + ".SELECT_LAUNCH_OPTIONS_DIALOG"; //$NON-NLS-1$ >+ >+ private LaunchDelegate[] fDelegates = null; >+ private String fMode = null; >+ private Object[] fResult = null; >+ private CheckboxTableViewer fTableViewer = null; >+ private Table fTable = null; >+ >+ /** >+ * Constructor >+ * @param parentShell the parent shell >+ * @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) { >+ super(parentShell); >+ super.setMessage(LaunchConfigurationsMessages.SelectLaunchOptionsDialog_2); >+ super.setTitle(LaunchConfigurationsMessages.SelectLaunchOptionsDialog_3); >+ setShellStyle(getShellStyle() | SWT.RESIZE); >+ fDelegates = delegates; >+ fMode = mode; >+ } >+ >+ /** >+ * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) >+ */ >+ protected Control createDialogArea(Composite parent) { >+ initializeDialogUnits(parent); >+ Composite comp = (Composite) super.createDialogArea(parent); >+ SWTUtil.createLabel(comp, LaunchConfigurationsMessages.SelectLaunchOptionsDialog_4, 1); >+ fTable = new Table(comp, SWT.BORDER | SWT.SINGLE | SWT.CHECK); >+ fTable.setLayoutData(new GridData(GridData.FILL_BOTH)); >+ fTableViewer = new CheckboxTableViewer(fTable); >+ fTableViewer.setLabelProvider(new OptionsLabelProvider()); >+ fTableViewer.setContentProvider(new ArrayContentProvider()); >+ fTableViewer.setInput(fDelegates); >+ fTableViewer.addCheckStateListener(new ICheckStateListener() { >+ public void checkStateChanged(CheckStateChangedEvent event) { >+ fTableViewer.setAllChecked(false); >+ fTableViewer.setChecked(event.getElement(), true); >+ } >+ }); >+ Dialog.applyDialogFont(comp); >+ PlatformUI.getWorkbench().getHelpSystem().setHelp(comp, IDebugHelpContextIds.SELECT_LAUNCH_OPTIONS_DIALOG); >+ return comp; >+ } >+ >+ /** >+ * @see org.eclipse.ui.dialogs.SelectionDialog#getResult() >+ */ >+ public Object[] getResult() { >+ return fResult; >+ } >+ >+ /** >+ * @see org.eclipse.jface.dialogs.Dialog#okPressed() >+ */ >+ protected void okPressed() { >+ Object[] o = fTableViewer.getCheckedElements(); >+ if(o.length > 0) { >+ fResult = ((LaunchDelegate)o[0]).getOptions().toArray(); >+ } >+ super.okPressed(); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.dialogs.SelectionDialog#getDialogBoundsSettings() >+ */ >+ protected IDialogSettings getDialogBoundsSettings() { >+ IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings(); >+ IDialogSettings section = settings.getSection(SETTINGS_ID); >+ if (section == null) { >+ section = settings.addNewSection(SETTINGS_ID); >+ } >+ return section; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.dialogs.Dialog#getInitialSize() >+ */ >+ protected Point getInitialSize() { >+ IDialogSettings settings = getDialogBoundsSettings(); >+ if(settings != null) { >+ try { >+ int width = settings.getInt("DIALOG_WIDTH"); //$NON-NLS-1$ >+ int height = settings.getInt("DIALOG_HEIGHT"); //$NON-NLS-1$ >+ if(width > 0 & height > 0) { >+ return new Point(width, height); >+ } >+ } >+ catch (NumberFormatException nfe) { >+ return new Point(350, 400); >+ } >+ } >+ return new Point(350, 400); >+ } >+ >+} >Index: ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java >=================================================================== >RCS file: ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java >diff -N ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,48 @@ >+/******************************************************************************* >+ * 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.ui.launchConfigurations; >+ >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Status; >+import org.eclipse.debug.core.ILaunchConfiguration; >+import org.eclipse.debug.core.IStatusHandler; >+import org.eclipse.debug.internal.ui.DebugUIPlugin; >+import org.eclipse.debug.ui.DebugUITools; >+ >+/** >+ * This class provides a mechanism to prompt users in the UI thread from debug.core in the case where >+ * a launch delegate has gone missing and a new choice needs to be made in the launch dialog. >+ * >+ * @since 3.3 >+ * >+ * EXPERIMENTAL >+ */ >+public class LaunchDelegateNotAvailableHandler implements IStatusHandler { >+ >+ /** >+ * @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object) >+ */ >+ public Object handleStatus(IStatus status, Object source) throws CoreException { >+ if(source instanceof Object[]) { >+ Object[] infos = (Object[]) source; >+ if(infos.length == 2) { >+ ILaunchConfiguration config = (ILaunchConfiguration) infos[0]; >+ String mode = (String) infos[1]; >+ DebugUITools.openLaunchConfigurationEditDialog(DebugUIPlugin.getShell(), >+ config, >+ DebugUITools.getLaunchGroup(config, mode).getIdentifier(), >+ null); >+ } >+ } >+ return Status.OK_STATUS; >+ } >+} >#P org.eclipse.jdt.doc.user >Index: contexts_Debugger.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.doc.user/contexts_Debugger.xml,v >retrieving revision 1.89 >diff -u -r1.89 contexts_Debugger.xml >--- contexts_Debugger.xml 22 Sep 2006 17:42:27 -0000 1.89 >+++ contexts_Debugger.xml 13 Oct 2006 17:50:04 -0000 >@@ -482,6 +482,11 @@ > <topic label="Running and Debugging" href="tasks/task-running_and_debugging.htm"/> > <topic label="Creating a Java application launch configuration" href="tasks/tasks-java-local-configuration.htm"/> > </context> >+ <context id="select_launch_options_dialog"> >+ <description>This dialog prompts users to select an available set of conbination of launch options in the event a plugin, no longer provided, has set launch options in the current launch configuration.</description> >+ <topic label="Running and Debugging" href="tasks/task-running_and_debugging.htm"/> >+ <topic label="Creating a Java application launch configuration" href="tasks/tasks-java-local-configuration.htm"/> >+ </context> > > > >#P org.eclipse.debug.core >Index: core/org/eclipse/debug/core/ILaunchManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchManager.java,v >retrieving revision 1.60 >diff -u -r1.60 ILaunchManager.java >--- core/org/eclipse/debug/core/ILaunchManager.java 15 Sep 2006 02:33:50 -0000 1.60 >+++ core/org/eclipse/debug/core/ILaunchManager.java 13 Oct 2006 17:50:05 -0000 >@@ -229,7 +229,7 @@ > * @param optionId the unique id of the launch option > * @return the lauch option associated with ther specified id or <code>null</code> if not found > * <p> >- * <strong>EXPERIMENTAL</strong>. This ,method has been added as >+ * <strong>EXPERIMENTAL</strong>. This method has been added as > * part of a work in progress. There is no guarantee that this API will > * remain unchanged during the 3.3 release cycle. Please do not use this API > * without consulting with the Platform/Debug team. >@@ -242,7 +242,7 @@ > * Returns all registered launch options > * @return all registered launch options > * <p> >- * <strong>EXPERIMENTAL</strong>. This ,method has been added as >+ * <strong>EXPERIMENTAL</strong>. This method has been added as > * part of a work in progress. There is no guarantee that this API will > * remain unchanged during the 3.3 release cycle. Please do not use this API > * without consulting with the Platform/Debug team. >Index: core/org/eclipse/debug/core/ILaunchOption.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchOption.java,v >retrieving revision 1.2 >diff -u -r1.2 ILaunchOption.java >--- core/org/eclipse/debug/core/ILaunchOption.java 15 Sep 2006 02:33:50 -0000 1.2 >+++ core/org/eclipse/debug/core/ILaunchOption.java 13 Oct 2006 17:50:05 -0000 >@@ -16,12 +16,10 @@ > * > * Example contribution of the debug launch option: > * <pre> >- * <extension >- point="org.eclipse.debug.core.launchOptions"> >+ * <extension point="org.eclipse.debug.core.launchOptions"> > <launchOption > id="org.eclipse.debug.core.debug" >- label="Debug" >- option="debug"> >+ label="Debug"> > </launchOption> > </extension> > * </pre> >@@ -45,14 +43,7 @@ > public String getLabel(); > > /** >- * Returns the launch option defined for this extension. The option is non-translatable, one word and >- * all lowercase. >- * @return the option defined by this extension >- */ >- public String getOption(); >- >- /** >- * @return the unique id provided for this option e.g. org.eclipse.debug.core.debug >+ * @return the unique id provided for this option e.g. debug > */ > public String getIdentifier(); > } >Index: core/org/eclipse/debug/core/ILaunchConfiguration.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfiguration.java,v >retrieving revision 1.45 >diff -u -r1.45 ILaunchConfiguration.java >--- core/org/eclipse/debug/core/ILaunchConfiguration.java 12 Jun 2006 20:42:24 -0000 1.45 >+++ core/org/eclipse/debug/core/ILaunchConfiguration.java 13 Oct 2006 17:50:05 -0000 >@@ -13,6 +13,7 @@ > > import java.util.List; > import java.util.Map; >+import java.util.Set; > > import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IResource; >@@ -190,6 +191,27 @@ > public List getAttribute(String attributeName, List defaultValue) throws CoreException; > > /** >+ * Returns the <code>java.util.Set</code>-valued attribute with the given name. >+ * Returns the given default value if the attribute is undefined. >+ * >+ * @param attributeName the name of the attribute >+ * @param defaultValue the value to use if no value is found >+ * @return the value or the default value if no value was found. >+ * @exception CoreException if this method fails. Reasons include: >+ * <ul> >+ * <li>An exception occurs while retrieving the attribute from >+ * underlying storage.</li> >+ * <li>An attribute with the given name exists, but does not >+ * have a List value</li> >+ * </ul> >+ * >+ * @since 3.3 >+ * >+ * EXPERIMENTAL >+ */ >+ public Set getAttribute(String attributeName, Set defaultValue) throws CoreException; >+ >+ /** > * Returns the <code>java.util.Map</code>-valued attribute with the given name. > * Returns the given default value if the attribute is undefined. > * >@@ -304,6 +326,20 @@ > public String getName(); > > /** >+ * >+ * @return returns the options that this configuration supports >+ * >+ * <p> >+ * <strong>EXPERIMENTAL</strong>. This method has been added as >+ * part of a work in progress. There is no guarantee that this API will >+ * remain unchanged during the 3.3 release cycle. Please do not use this API >+ * without consulting with the Platform/Debug team. >+ * </p> >+ * @since 3.3 >+ */ >+ public Set getOptions() throws CoreException; >+ >+ /** > * Returns the type of this launch configuration. This is a > * handle-only method. > * >Index: core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java,v >retrieving revision 1.17 >diff -u -r1.17 ILaunchConfigurationWorkingCopy.java >--- core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java 9 Dec 2005 15:59:15 -0000 1.17 >+++ core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java 13 Oct 2006 17:50:05 -0000 >@@ -13,6 +13,7 @@ > > import java.util.List; > import java.util.Map; >+import java.util.Set; > > import org.eclipse.core.resources.IContainer; > import org.eclipse.core.resources.IResource; >@@ -172,4 +173,92 @@ > * @since 3.2 > */ > public void setMappedResources(IResource[] resources); >+ >+ /** >+ * This method is used to set an option for the associated <code>ILaunchConfiguraiton</code>. >+ * >+ * If the option is <code>null</code>, or is alrready in the current set of options no changes are made >+ * >+ * @param option the name of the option to set >+ * >+ * <p> >+ * <strong>EXPERIMENTAL</strong>. This method has been added as >+ * part of a work in progress. There is no guarantee that this API will >+ * remain unchanged during the 3.3 release cycle. Please do not use this API >+ * without consulting with the Platform/Debug team. >+ * </p> >+ * @since 3.3 >+ */ >+ public void addOption(String option); >+ >+ /** >+ * This method is used to remove an option from the associated <code>ILaunchConfiguraiton</code>. >+ * >+ * If the option is <code>null</code> or not contained in the current set of options no changes are made >+ * >+ * @param option the name of the option to remove >+ * >+ * <p> >+ * <strong>EXPERIMENTAL</strong>. This method has been added as >+ * part of a work in progress. There is no guarantee that this API will >+ * remain unchanged during the 3.3 release cycle. Please do not use this API >+ * without consulting with the Platform/Debug team. >+ * </p> >+ * @since 3.3 >+ */ >+ public void removeOption(String option); >+ >+ /** >+ * This method is used to set the options for the associated <code>ILaunchConfiguration</code>. >+ * Unlike <code>ILaunchConfigurationWorkingCopy.setOption(String, boolean)</code>, this method will over-write the existing >+ * set of options with the new listing specified, it will NOT add the specified listing to the current set of options. >+ * >+ * If the specified list of options is empty or <code>null</code>, the 'options' attribute is removed from the launch configuration altogether >+ * >+ * @param options the list of options to replace the currently set ones with >+ * >+ * <p> >+ * <strong>EXPERIMENTAL</strong>. This method has been added as >+ * part of a work in progress. There is no guarantee that this API will >+ * remain unchanged during the 3.3 release cycle. Please do not use this API >+ * without consulting with the Platform/Debug team. >+ * </p> >+ * @since 3.3 >+ */ >+ public void setOptions(Set options); >+ >+ /** >+ * This method is used to add the set of options to the associated <code>ILaunchConfiguraiton</code>. >+ * The original set of options is maintained and this set is appended to it >+ * >+ * If the specified list of options is empty or <code>null</code>, no changes are made >+ * >+ * @param options the set of options to append to the current set of 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 void addOptions(Set options); >+ >+ /** >+ * This method is used to remove a set of options from the associated <code>ILaunchConfiguraiton</code>. >+ * >+ * If the set is empty or <code>null</code> no changes are made >+ * >+ * @param option the name of the option to remove >+ * >+ * <p> >+ * <strong>EXPERIMENTAL</strong>. This method has been added as >+ * part of a work in progress. There is no guarantee that this API will >+ * remain unchanged during the 3.3 release cycle. Please do not use this API >+ * without consulting with the Platform/Debug team. >+ * </p> >+ * @since 3.3 >+ */ >+ public void removeOptions(Set options); > } >Index: core/org/eclipse/debug/core/ILaunchConfigurationType.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationType.java,v >retrieving revision 1.26 >diff -u -r1.26 ILaunchConfigurationType.java >--- core/org/eclipse/debug/core/ILaunchConfigurationType.java 12 Jun 2006 20:42:24 -0000 1.26 >+++ core/org/eclipse/debug/core/ILaunchConfigurationType.java 13 Oct 2006 17:50:05 -0000 >@@ -126,10 +126,31 @@ > * @exception CoreException if unable to instantiate the > * delegate > * @since 3.0 >+ * @deprecated we have introduced launch options in 3.3M3 and delegates can be acquired using the new >+ * <code>getDelegate(String mode, String[] options)</code> version. If no options are desired or cared about passing <code>null</code> >+ * works as though options are not considered at all. >+ * > */ > public ILaunchConfigurationDelegate getDelegate(String mode) throws CoreException; > > /** >+ * Returns the launch delegate for the specifed mode with the given options >+ * @param mode the mode to get the delegate for >+ * @param options the options that the delegate must support >+ * @return the <code>ILaunchConfigurationDelegate</code> for the given mode and options, or <code>null</code> if the is not one >+ * @throws CoreException >+ * @since 3.3 >+ * >+ * <p> >+ * <strong>EXPERIMENTAL</strong>. This method has been added as >+ * part of a work in progress. There is no guarantee that this API will >+ * remain unchanged during the 3.3 release cycle. Please do not use this API >+ * without consulting with the Platform/Debug team. >+ * </p> >+ */ >+ public ILaunchConfigurationDelegate getDelegate(String mode, String[] options) throws CoreException; >+ >+ /** > * Returns the unique identifier for this type of launch configuration > * > * @return the unique identifier for this type of launch configuration >@@ -157,9 +178,16 @@ > * Launch configuration types optionally specify this attribute > * in their plug-in XML via the <code>sourceLocatorId</code> attribute. > * >+ * In 3.3 we now search for a source locator id from contributed delegates that apply >+ * to this launch congfiguration type. As we assume only one locator id >+ * will be provided for any one contributed launch configuraiton type, the search is done >+ * on a first-found basis; i.e. the first delegate found is assumed to be the source lookup >+ * provider, and is cached for subsequent uses in source lookup. >+ * > * @return the identifier of the persistable source locator registered with > * this launch configurations type, or <code>null</code> if unspecified > * @since 3.0 >+ * > */ > public String getSourceLocatorId(); > >@@ -169,9 +197,16 @@ > * registered with a launch configuration type in plug-in XML via the > * <code>sourcePathComputerId</code> attribute. > * >+ * In 3.3 we now will look for a source path computer id from launch delegates that apply >+ * to this launch configuration type. As we assume only one locator id >+ * will be provided for any one contributed launch configuraiton type, the search is done >+ * on a first-found basis; i.e. the first delegate found is assumed to be the source lookup >+ * provider, and is cached for subsequent uses in source lookup. >+ * > * @return the source path computer registered with this launch configuration > * type or <code>null</code> if unspecified > * @since 3.0 >+ * > */ > public ISourcePathComputer getSourcePathComputer(); > >@@ -222,6 +257,37 @@ > * <code>DEBUG_MODE</code>. > * @return whether this kind of launch configuration supports the > * specified mode >+ * > */ > public boolean supportsMode(String mode); >+ >+ /** >+ * Returns the simple name of the plugin that contributed this launch configuration type >+ * @return the name of the contributor >+ * @since 3.3 >+ * >+ * <p> >+ * <strong>EXPERIMENTAL</strong>. This method has been added as >+ * part of a work in progress. There is no guarantee that this API will >+ * remain unchanged during the 3.3 release cycle. Please do not use this API >+ * without consulting with the Platform/Debug team. >+ * </p> >+ */ >+ public String getContributorName(); >+ >+ /** >+ * Returns the path of the image descriptor for this launch configuration type, which in turn >+ * is used in <code>DebugPluginImages</code> to load the image registry with config images. >+ * NOTE: the path could be only a fragment, and might require qualification via the bundle of the contributor. >+ * @return the id of the image for this config type >+ * @since 3.3 >+ * >+ * <p> >+ * <strong>EXPERIMENTAL</strong>. This method has been added as >+ * part of a work in progress. There is no guarantee that this API will >+ * remain unchanged during the 3.3 release cycle. Please do not use this API >+ * without consulting with the Platform/Debug team. >+ * </p> >+ */ >+ public String getImageDescriptorPath(); > } >Index: core/org/eclipse/debug/internal/core/LaunchManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java,v >retrieving revision 1.167 >diff -u -r1.167 LaunchManager.java >--- core/org/eclipse/debug/internal/core/LaunchManager.java 13 Sep 2006 19:09:07 -0000 1.167 >+++ core/org/eclipse/debug/internal/core/LaunchManager.java 13 Oct 2006 17:50:06 -0000 >@@ -148,7 +148,6 @@ > * @since 3.2 > */ > protected static final IStatus deleteAssociatedLaunchConfigs = new Status(IStatus.INFO, DEBUG_CORE, 225, EMPTY_STRING, null); >- > > > /** >@@ -507,17 +506,14 @@ > * @throws IOException if the encoding attempted to be used is not supported > */ > public static String serializeDocument(Document doc) throws TransformerException, IOException { >- ByteArrayOutputStream s= new ByteArrayOutputStream(); >- >- TransformerFactory factory= TransformerFactory.newInstance(); >- Transformer transformer= factory.newTransformer(); >+ ByteArrayOutputStream s = new ByteArrayOutputStream(); >+ TransformerFactory factory = TransformerFactory.newInstance(); >+ Transformer transformer = factory.newTransformer(); > transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$ > transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$ >- >- DOMSource source= new DOMSource(doc); >- StreamResult outputTarget= new StreamResult(s); >+ DOMSource source = new DOMSource(doc); >+ StreamResult outputTarget = new StreamResult(s); > transformer.transform(source, outputTarget); >- > return s.toString("UTF8"); //$NON-NLS-1$ > } > >@@ -564,10 +560,14 @@ > private HashMap fLaunchOptions = null; > > /** >- * List of contributed launch delegates (delegates contributed for existing >- * launch configuration types). >+ * A map of LaunchDelegate objects stored by id of delegate, or launch config type > */ >- private List fContributedDelegates = null; >+ private HashMap fLaunchDelegates = null; >+ >+ /** >+ * A map of duplicate delegates arranged by config type id >+ */ >+ private HashMap fDuplicateDelegates = null; > > /** > * Collection of launches >@@ -581,7 +581,7 @@ > /** > * Collection of listeners > */ >- private ListenerList fListeners= new ListenerList(); >+ private ListenerList fListeners = new ListenerList(); > > /** > * Collection of "plural" listeners. >@@ -630,7 +630,7 @@ > * and values are associated configuration elements. > */ > private Map sourcePathComputers; >- >+ > /** > * @see ILaunchManager#addLaunch(ILaunch) > */ >@@ -830,8 +830,9 @@ > } > Iterator iter = list.iterator(); > List configs = new ArrayList(list.size()); >+ IFile file = null; > while (iter.hasNext()) { >- IFile file = (IFile)iter.next(); >+ file = (IFile)iter.next(); > configs.add(getLaunchConfiguration(file)); > } > return configs; >@@ -856,8 +857,9 @@ > } > }; > String[] files = directory.list(filter); >+ LaunchConfiguration config = null; > for (int i = 0; i < files.length; i++) { >- LaunchConfiguration config = new LaunchConfiguration(containerPath.append(files[i])); >+ config = new LaunchConfiguration(containerPath.append(files[i])); > configs.add(config); > } > } >@@ -893,13 +895,13 @@ > try { > index = Integer.parseInt(trailer); > baseName = baseName.substring(0, copyIndex); >- } catch (NumberFormatException nfe) { >- } >+ } >+ catch (NumberFormatException nfe) {} > } > } > String newName = baseName; > >- StringBuffer buffer= null; >+ StringBuffer buffer = null; > while (isExistingLaunchConfigurationName(newName)) { > buffer = new StringBuffer(baseName); > buffer.append(" ("); //$NON-NLS-1$ >@@ -995,16 +997,18 @@ > List configs = new ArrayList(4); > NodeList list = root.getChildNodes(); > int length = list.getLength(); >+ Node node = null; >+ Element entry = null; >+ String memento = null; > for (int i = 0; i < length; ++i) { >- Node node = list.item(i); >+ node = list.item(i); > short type = node.getNodeType(); > if (type == Node.ELEMENT_NODE) { >- Element entry = (Element) node; >- String nodeName = entry.getNodeName(); >- if (!nodeName.equals("launchConfiguration")) { //$NON-NLS-1$ >+ entry = (Element) node; >+ if (!entry.getNodeName().equals("launchConfiguration")) { //$NON-NLS-1$ > throw invalidFormat; > } >- String memento = entry.getAttribute("memento"); //$NON-NLS-1$ >+ memento = entry.getAttribute("memento"); //$NON-NLS-1$ > if (memento == null) { > throw invalidFormat; > } >@@ -1016,18 +1020,7 @@ > > protected ConfigurationNotifier getConfigurationNotifier() { > return new ConfigurationNotifier(); >- } >- >- /** >- * Returns a list of launch delegates contributed for existing launch configuration >- * types. >- * >- * @return list of ContributedDelegate >- */ >- protected List getContributedDelegates() { >- initializeContributedDelegates(); >- return fContributedDelegates; >- } >+ } > > /** > * @see ILaunchManager#getDebugTargets() >@@ -1036,9 +1029,10 @@ > synchronized (fLaunches) { > List allTargets= new ArrayList(fLaunches.size()); > if (fLaunches.size() > 0) { >- Iterator e= fLaunches.iterator(); >+ Iterator e = fLaunches.iterator(); >+ IDebugTarget[] targets = null; > while (e.hasNext()) { >- IDebugTarget[] targets= ((ILaunch) e.next()).getDebugTargets(); >+ targets = ((ILaunch) e.next()).getDebugTargets(); > for (int i = 0; i < targets.length; i++) { > allTargets.add(targets[i]); > } >@@ -1073,10 +1067,9 @@ > if (configEnv == null) { > return null; > } >- Map env = null; >+ Map env = new HashMap(); > // build base environment >- env= new HashMap(); >- boolean append= configuration.getAttribute(ATTR_APPEND_ENVIRONMENT_VARIABLES, true); >+ boolean append = configuration.getAttribute(ATTR_APPEND_ENVIRONMENT_VARIABLES, true); > if (append) { > env.putAll(getNativeEnvironmentCasePreserved()); > } >@@ -1084,10 +1077,17 @@ > // Add variables from config > Iterator iter= configEnv.entrySet().iterator(); > boolean win32= Platform.getOS().equals(Constants.OS_WIN32); >+ Map.Entry entry = null; >+ String key = null; >+ String value = null; >+ Object nativeValue = null; >+ Iterator envIter = null; >+ Map.Entry nativeEntry = null; >+ String nativeKey = null; > while (iter.hasNext()) { >- Map.Entry entry= (Map.Entry) iter.next(); >- String key= (String) entry.getKey(); >- String value = (String) entry.getValue(); >+ entry = (Map.Entry) iter.next(); >+ key = (String) entry.getKey(); >+ value = (String) entry.getValue(); > // translate any string substitution variables > if (value != null) { > value = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(value); >@@ -1095,7 +1095,7 @@ > boolean added= false; > if (win32) { > // First, check if the key is an exact match for an existing key. >- Object nativeValue= env.get(key); >+ nativeValue = env.get(key); > if (nativeValue != null) { > // If an exact match is found, just replace the value > env.put(key, value); >@@ -1103,13 +1103,13 @@ > // Win32 vars are case-insensitive. If an exact match isn't found, iterate to > // check for a case-insensitive match. We maintain the key's case (see bug 86725), > // but do a case-insensitive comparison (for example, "pAtH" will still override "PATH"). >- Iterator envIter= env.entrySet().iterator(); >+ envIter = env.entrySet().iterator(); > while (envIter.hasNext()) { >- Map.Entry nativeEntry = (Map.Entry) envIter.next(); >- String nativeKey= (String) (nativeEntry).getKey(); >+ nativeEntry = (Map.Entry) envIter.next(); >+ nativeKey = (String) (nativeEntry).getKey(); > if (nativeKey.equalsIgnoreCase(key)) { > nativeEntry.setValue(value); >- added= true; >+ added = true; > break; > } > } >@@ -1120,11 +1120,12 @@ > } > } > >- iter= env.entrySet().iterator(); >- List strings= new ArrayList(env.size()); >+ iter = env.entrySet().iterator(); >+ List strings = new ArrayList(env.size()); >+ StringBuffer buffer = null; > while (iter.hasNext()) { >- Map.Entry entry = (Map.Entry) iter.next(); >- StringBuffer buffer= new StringBuffer((String) entry.getKey()); >+ entry = (Map.Entry) iter.next(); >+ buffer = new StringBuffer((String) entry.getKey()); > buffer.append('=').append((String) entry.getValue()); > strings.add(buffer.toString()); > } >@@ -1215,8 +1216,9 @@ > public ILaunchConfiguration[] getLaunchConfigurations(ILaunchConfigurationType type) throws CoreException { > Iterator iter = getAllLaunchConfigurations().iterator(); > List configs = new ArrayList(); >+ ILaunchConfiguration config = null; > while (iter.hasNext()) { >- ILaunchConfiguration config = (ILaunchConfiguration)iter.next(); >+ config = (ILaunchConfiguration)iter.next(); > if (config.getType().equals(type)) { > configs.add(config); > } >@@ -1224,7 +1226,6 @@ > return (ILaunchConfiguration[])configs.toArray(new ILaunchConfiguration[configs.size()]); > } > >- > /** > * Returns all launch configurations that are stored as resources > * in the given project. >@@ -1236,9 +1237,11 @@ > protected List getLaunchConfigurations(IProject project) { > Iterator iter = getAllLaunchConfigurations().iterator(); > List configs = new ArrayList(); >+ ILaunchConfiguration config = null; >+ IFile file = null; > while (iter.hasNext()) { >- ILaunchConfiguration config = (ILaunchConfiguration)iter.next(); >- IFile file = config.getFile(); >+ config = (ILaunchConfiguration)iter.next(); >+ file = config.getFile(); > if (file != null && file.getProject().equals(project)) { > configs.add(config); > } >@@ -1276,7 +1279,7 @@ > } > } > >- /* (non-Javadoc) >+ /**) > * @see org.eclipse.debug.core.ILaunchManager#getLaunchMode(java.lang.String) > */ > public ILaunchMode getLaunchMode(String mode) { >@@ -1284,7 +1287,7 @@ > return (ILaunchMode) fLaunchModes.get(mode); > } > >- /* (non-Javadoc) >+ /** > * @see org.eclipse.debug.core.ILaunchManager#getLaunchModes() > */ > public ILaunchMode[] getLaunchModes() { >@@ -1309,7 +1312,215 @@ > Collection col = fLaunchOptions.values(); > return (ILaunchOption[])col.toArray(new ILaunchOption[col.size()]); > } >- >+ >+ /** >+ * Initializes the listing of registered launch options. Does no work if the mapping is already populated. >+ * >+ * <p> >+ * <strong>EXPERIMENTAL</strong>. This method has been added as >+ * part of a work in progress. There is no guarantee that this API will >+ * remain unchanged during the 3.3 release cycle. Please do not use this API >+ * without consulting with the Platform/Debug team. >+ * </p> >+ * @since 3.3 >+ */ >+ private synchronized void initializeLaunchOptions() { >+ if(fLaunchOptions == null) { >+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_OPTIONS); >+ IConfigurationElement[] infos = extensionPoint.getConfigurationElements(); >+ fLaunchOptions = new HashMap(); >+ ILaunchOption option = null; >+ for(int i = 0; i < infos.length; i++) { >+ option = new LaunchOption(infos[i]); >+ fLaunchOptions.put(option.getIdentifier(), option); >+ } >+ } >+ } >+ >+ /** >+ * Returns all of the launch delegates. The rturned listing of delegates cannot be directly used to launch, >+ * instead the method <code>IlaunchDelegate.getDelegate</code> must be used to acquire an executable form of >+ * the delegate, allowing us to maintain lazy loading of the delegates themselves. >+ * @return all of the launch delegates >+ * @since 3.3 >+ * <p> >+ * <strong>EXPERIMENTAL</strong>. This method has been added as >+ * part of a work in progress. There is no guarantee that this API will >+ * remain unchanged during the 3.3 release cycle. Please do not use this API >+ * without consulting with the Platform/Debug team. >+ * </p> >+ */ >+ public LaunchDelegate[] getLaunchDelegates() { >+ initializeLaunchDelegates(); >+ Collection col = fLaunchDelegates.values(); >+ return (LaunchDelegate[]) col.toArray(new LaunchDelegate[col.size()]); >+ } >+ >+ /** Returns the launch delegates that applies to the specified options for the specified mode and type id >+ * @param typeid the <code>ILaunchConfigurationType</code> id >+ * @param the mode id >+ * @param options the array of 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, String[] options) { >+ initializeLaunchDelegates(); >+ LaunchDelegate ld = null; >+ boolean applies = true; >+ ArrayList list = new ArrayList(); >+ 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 & options.length == 0) { >+ applies = false; >+ } >+ for(int i = 0; i < options.length; i++) { >+ applies &= doptions.contains(options[i]); >+ } >+ } >+ else if(doptions.size() > 0) { >+ applies = false; >+ } >+ if(applies) { >+ list.add(ld); >+ } >+ applies = true; >+ } >+ } >+ return (LaunchDelegate[]) list.toArray(new LaunchDelegate[list.size()]); >+ } >+ >+ /** >+ * Returns the listing of launch delegates that apply to the specified >+ * <code>ILaunchConfigurationType</code> id >+ * @param typeid the id of the launch configuration type to get delegates for >+ * @return An array of <code>LaunchDelegate</code>s that apply to the specified launch configuration >+ * type, or an empty array, never <code>null</code> >+ * >+ * @since 3.3 >+ * >+ * EXPERIMENTAL >+ */ >+ public LaunchDelegate[] getLaunchDelegates(String typeid) { >+ initializeLaunchDelegates(); >+ ArrayList list = new ArrayList(); >+ LaunchDelegate ld = null; >+ for(Iterator iter = fLaunchDelegates.keySet().iterator(); iter.hasNext();) { >+ ld = (LaunchDelegate) fLaunchDelegates.get(iter.next()); >+ if(ld.appliesTo(typeid)) { >+ list.add(ld); >+ } >+ } >+ return (LaunchDelegate[]) list.toArray(new LaunchDelegate[list.size()]); >+ } >+ >+ /** >+ * Returns the listing of duplicate launch delegates in the form of a <code>HashMap</code>, with the >+ * object arrangement: >+ * <p> >+ * <pre> >+ * HashMap<ILaunchConfigurationType, HashMap<string, LaunchDelegate[]>> >+ * </pre> >+ * </p> >+ * <p> >+ * Where the first map is keyed based on <code>ILaunchConfigurationType</code> ids and the inner map >+ * is keyed by mode. >+ * </p> >+ * @return the map of <code>LaunchDelegate</code>s that are in conflict for type, mode and options >+ * >+ * @since 3.3 >+ * >+ * EXPERIMENTAL >+ */ >+ public HashMap getDuplicateLaunchDelegates() { >+ initializeDuplicateLaunchDelegates(); >+ return fDuplicateDelegates; >+ } >+ >+ /** >+ * Lazily initializes the listing of duplicate launch delegates >+ * >+ * @since 3.3 >+ * >+ * EXPERIMENTAL >+ */ >+ private synchronized void initializeDuplicateLaunchDelegates() { >+ if(fDuplicateDelegates == null) { >+ fDuplicateDelegates = new HashMap(); >+ //for each delegate get the delegates[] >+ LaunchDelegate[] delegates = getLaunchDelegates(); >+ LaunchDelegate[] dupes = null; >+ ILaunchConfigurationType type = null; >+ Set modes = null; >+ Iterator iter = null; >+ Set options = null; >+ HashMap tmp = null; >+ String mode = null; >+ for(int i = 0; i < delegates.length; i++) { >+ type = getLaunchConfigurationType(delegates[i].getLaunchConfigurationType()); >+ options = delegates[i].getOptions(); >+ modes = type.getSupportedModes(); >+ for(iter = modes.iterator(); iter.hasNext();) { >+ mode = (String) iter.next(); >+ dupes = getLaunchDelegates(type.getIdentifier(), mode, (String[])options.toArray(new String[options.size()])); >+ if(dupes.length > 1) { >+ tmp = (HashMap) fDuplicateDelegates.get(type); >+ if(tmp == null) { >+ tmp = new HashMap(dupes.length); >+ } >+ tmp.put(mode, dupes); >+ fDuplicateDelegates.put(type, tmp); >+ } >+ } >+ } >+ } >+ } >+ >+ /** >+ * Initializes the listing of delegates available to the launching framework >+ * >+ * <p> >+ * <strong>EXPERIMENTAL</strong>. This method has been added as >+ * part of a work in progress. There is no guarantee that this API will >+ * remain unchanged during the 3.3 release cycle. Please do not use this API >+ * without consulting with the Platform/Debug team. >+ * </p> >+ * @since 3.3 >+ */ >+ private synchronized void initializeLaunchDelegates() { >+ if(fLaunchDelegates == null) { >+ fLaunchDelegates = new HashMap(); >+ //get all launch delegate contributions >+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_DELEGATES); >+ IConfigurationElement[] infos = extensionPoint.getConfigurationElements(); >+ LaunchDelegate delegate = null; >+ for(int i = 0; i < infos.length; i++) { >+ delegate = new LaunchDelegate(infos[i]); >+ fLaunchDelegates.put(delegate.getIdentifier(), delegate); >+ } >+ //get all delegates from launch configuration type contributions >+ extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES); >+ infos = extensionPoint.getConfigurationElements(); >+ for(int i = 0; i < infos.length; i++) { >+ //must check to see if delegate is provided in contribution >+ if(infos[i].getAttribute(IConfigurationElementConstants.DELEGATE) != null) { >+ delegate = new LaunchDelegate(infos[i]); >+ fLaunchDelegates.put(delegate.getIdentifier(), delegate); >+ } >+ } >+ } >+ } >+ > /** > * Returns all launch configurations that are stored locally. > * >@@ -1397,9 +1608,11 @@ > if (Platform.getOS().equals(Constants.OS_WIN32)) { > fgNativeEnv= new HashMap(); > Iterator entries = casePreserved.entrySet().iterator(); >+ Map.Entry entry = null; >+ String key = null; > while (entries.hasNext()) { >- Map.Entry entry = (Entry) entries.next(); >- String key = ((String)entry.getKey()).toUpperCase(); >+ entry = (Entry) entries.next(); >+ key = ((String)entry.getKey()).toUpperCase(); > fgNativeEnv.put(key, entry.getValue()); > } > } else { >@@ -1425,10 +1638,11 @@ > */ > public IProcess[] getProcesses() { > synchronized (fLaunches) { >- List allProcesses= new ArrayList(fLaunches.size()); >- Iterator e= fLaunches.iterator(); >+ List allProcesses = new ArrayList(fLaunches.size()); >+ Iterator e = fLaunches.iterator(); >+ IProcess[] processes = null; > while (e.hasNext()) { >- IProcess[] processes= ((ILaunch) e.next()).getProcesses(); >+ processes = ((ILaunch) e.next()).getProcesses(); > for (int i= 0; i < processes.length; i++) { > allProcesses.add(processes[i]); > } >@@ -1494,9 +1708,11 @@ > IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_COMPARATORS); > IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); > fComparators = new HashMap(infos.length); >+ IConfigurationElement configurationElement = null; >+ String attr = null; > for (int i= 0; i < infos.length; i++) { >- IConfigurationElement configurationElement = infos[i]; >- String attr = configurationElement.getAttribute("attribute"); //$NON-NLS-1$ >+ configurationElement = infos[i]; >+ attr = configurationElement.getAttribute("attribute"); //$NON-NLS-1$ > if (attr != null) { > fComparators.put(attr, new LaunchConfigurationComparator(configurationElement)); > } else { >@@ -1508,32 +1724,18 @@ > } > } > } >- >+ > /** >- * Initializes contributed launch delegates (i.e. delegates contributed >- * to an existing launch configuration type). >+ * Initializes the listing of <code>LaunchConfigurationType</code>s. > */ >- private synchronized void initializeContributedDelegates() { >- if (fContributedDelegates == null) { >- IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_DELEGATES); >- IConfigurationElement[] infos = extensionPoint.getConfigurationElements(); >- fContributedDelegates = new ArrayList(infos.length); >- for (int i= 0; i < infos.length; i++) { >- fContributedDelegates.add(new ContributedDelegate(infos[i])); >- } >- } >- } >- > private synchronized void initializeLaunchConfigurationTypes() { > if (fLaunchConfigurationTypes == null) { > hookResourceChangeListener(); > IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES); >- IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); >- fLaunchConfigurationTypes= new ArrayList(infos.length); >- for (int i= 0; i < infos.length; i++) { >- IConfigurationElement configurationElement = infos[i]; >- LaunchConfigurationType configType = new LaunchConfigurationType(configurationElement); >- fLaunchConfigurationTypes.add(configType); >+ IConfigurationElement[] infos = extensionPoint.getConfigurationElements(); >+ fLaunchConfigurationTypes = new ArrayList(infos.length); >+ for (int i= 0; i < infos.length; i++) { >+ fLaunchConfigurationTypes.add(new LaunchConfigurationType(infos[i])); > } > } > } >@@ -1543,6 +1745,7 @@ > * > * @exception CoreException if an exception occurs reading > * the extensions >+ * > */ > private synchronized void initializeLaunchModes() { > if (fLaunchModes == null) { >@@ -1559,26 +1762,6 @@ > catch (CoreException e) {DebugPlugin.log(e);} > } > } >- >- /** >- * Initializes the listing of registered launch options. Does no work if the mapping is already populated. >- * @since 3.3 >- */ >- private synchronized void initializeLaunchOptions() { >- if(fLaunchOptions == null) { >- try { >- IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_OPTIONS); >- IConfigurationElement[] infos = extensionPoint.getConfigurationElements(); >- fLaunchOptions = new HashMap(); >- ILaunchOption option = null; >- for(int i = 0; i < infos.length; i++) { >- option = new LaunchOption(infos[i]); >- fLaunchOptions.put(option.getIdentifier(), option); >- } >- } >- catch(CoreException ce) {DebugPlugin.log(ce);} >- } >- } > > /** > * Initializes source container type and source path computer extensions. >@@ -1615,9 +1798,11 @@ > IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_SOURCE_LOCATORS); > IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); > fSourceLocators= new HashMap(infos.length); >+ IConfigurationElement configurationElement = null; >+ String id = null; > for (int i= 0; i < infos.length; i++) { >- IConfigurationElement configurationElement = infos[i]; >- String id = configurationElement.getAttribute("id"); //$NON-NLS-1$ >+ configurationElement = infos[i]; >+ id = configurationElement.getAttribute("id"); //$NON-NLS-1$ > if (id != null) { > fSourceLocators.put(id,configurationElement); > } else { >@@ -1812,8 +1997,7 @@ > if (!configs.isEmpty()) { > Iterator iterator = configs.iterator(); > while (iterator.hasNext()) { >- ILaunchConfiguration configuration = (ILaunchConfiguration)iterator.next(); >- launchConfigurationDeleted(configuration); >+ launchConfigurationDeleted((ILaunchConfiguration)iterator.next()); > } > } > //bug 12134 >@@ -1832,8 +2016,7 @@ > if (!configs.isEmpty()) { > Iterator iterator = configs.iterator(); > while (iterator.hasNext()) { >- ILaunchConfiguration config = (ILaunchConfiguration) iterator.next(); >- launchConfigurationAdded(config); >+ launchConfigurationAdded((ILaunchConfiguration) iterator.next()); > } > } > } >@@ -1953,8 +2136,9 @@ > fLaunchesListeners = new ListenerList(); > fLaunchConfigurationListeners = new ListenerList(); > ILaunch[] launches = getLaunches(); >+ ILaunch launch = null; > for (int i= 0; i < launches.length; i++) { >- ILaunch launch= launches[i]; >+ launch = launches[i]; > try { > if (launch instanceof IDisconnect) { > IDisconnect disconnect = (IDisconnect)launch; >@@ -2014,8 +2198,9 @@ > */ > protected void verifyConfigurations(List verify, List valid) { > Iterator configs = verify.iterator(); >+ ILaunchConfiguration config = null; > while (configs.hasNext()) { >- ILaunchConfiguration config = (ILaunchConfiguration)configs.next(); >+ config = (ILaunchConfiguration)configs.next(); > if (isValid(config)) { > valid.add(config); > } >Index: core/org/eclipse/debug/internal/core/DebugCoreMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java,v >retrieving revision 1.14 >diff -u -r1.14 DebugCoreMessages.java >--- core/org/eclipse/debug/internal/core/DebugCoreMessages.java 13 Sep 2006 19:09:07 -0000 1.14 >+++ core/org/eclipse/debug/internal/core/DebugCoreMessages.java 13 Oct 2006 17:50:05 -0000 >@@ -27,6 +27,8 @@ > public static String DebugPlugin_1; > public static String EnvironmentVariableResolver_0; > >+ public static String LaunchConfigurationInfo_35; >+ > public static String LaunchOption_0; > public static String SystemPropertyResolver_0; > public static String InputStreamMonitor_label; >Index: core/org/eclipse/debug/internal/core/LaunchConfiguration.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java,v >retrieving revision 1.85 >diff -u -r1.85 LaunchConfiguration.java >--- core/org/eclipse/debug/internal/core/LaunchConfiguration.java 9 Jun 2006 17:06:36 -0000 1.85 >+++ core/org/eclipse/debug/internal/core/LaunchConfiguration.java 13 Oct 2006 17:50:05 -0000 >@@ -13,10 +13,11 @@ > > import java.io.IOException; > import java.io.StringReader; >-import com.ibm.icu.text.MessageFormat; > import java.util.ArrayList; >+import java.util.HashSet; > import java.util.List; > import java.util.Map; >+import java.util.Set; > > import javax.xml.parsers.DocumentBuilder; > import javax.xml.parsers.DocumentBuilderFactory; >@@ -44,6 +45,7 @@ > import org.eclipse.debug.core.ILaunchConfiguration; > import org.eclipse.debug.core.ILaunchConfigurationType; > import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; >+import org.eclipse.debug.core.IStatusHandler; > import org.eclipse.debug.core.Launch; > import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; > import org.eclipse.debug.core.model.ILaunchConfigurationDelegate2; >@@ -55,6 +57,8 @@ > import org.xml.sax.SAXException; > import org.xml.sax.helpers.DefaultHandler; > >+import com.ibm.icu.text.MessageFormat; >+ > /** > * Launch configuration handle. > * >@@ -82,6 +86,32 @@ > public static final String ATTR_MAPPED_RESOURCE_TYPES = DebugPlugin.getUniqueIdentifier() + ".MAPPED_RESOURCE_TYPES"; //$NON-NLS-1$ > > /** >+ * The listing of applicable launch options for this configuration. >+ * >+ * <p> >+ * <strong>EXPERIMENTAL</strong>. This class has been added as >+ * part of a work in progress. There is no guarantee that this API will >+ * remain unchanged during the 3.3 release cycle. Please do not use this API >+ * without consulting with the Platform/Debug team. >+ * </p> >+ * @since 3.3 >+ */ >+ public static final String ATTR_LAUNCH_OPTIONS = DebugPlugin.getUniqueIdentifier() + ".LAUNCH_OPTIONS"; //$NON-NLS-1$ >+ >+ /** >+ * Status handler to prompt in the UI thread >+ * >+ * @since 3.3 >+ */ >+ protected static final IStatus promptStatus = new Status(IStatus.INFO, "org.eclipse.debug.ui", 200, "", null); //$NON-NLS-1$//$NON-NLS-2$ >+ >+ /** >+ * Status handler to prompt the user to resolve the missing launch delegate issue >+ * @since 3.3 >+ */ >+ protected static final IStatus delegateNotAvailable = new Status(IStatus.INFO, "org.eclipse.debug.core", 226, "", null); //$NON-NLS-1$ //$NON-NLS-2$ >+ >+ /** > * Location this configuration is stored in. This > * is the key for a launch configuration handle. > */ >@@ -271,6 +301,13 @@ > return getInfo().getListAttribute(attributeName, defaultValue); > } > >+ /** >+ * @see org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String, java.util.Set) >+ */ >+ public Set getAttribute(String attributeName, Set defaultValue) throws CoreException { >+ return getInfo().getSetAttribute(attributeName, defaultValue); >+ } >+ > /* (non-Javadoc) > * @see org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String, java.util.Map) > */ >@@ -320,14 +357,13 @@ > /** > * Returns the launch configuration delegate for this > * launch configuration, for the specified launch mode. >- * > * @param mode launch mode > * @return launch configuration delegate > * @exception CoreException if the delegate was unable > * to be created > */ >- protected ILaunchConfigurationDelegate getDelegate(String mode) throws CoreException { >- return getType().getDelegate(mode); >+ protected ILaunchConfigurationDelegate getDelegate(String mode, String[] options) throws CoreException { >+ return getType().getDelegate(mode, options); > } > > /* (non-Javadoc) >@@ -480,6 +516,14 @@ > return getLastLocationSegment(); > } > >+ /** >+ * @see org.eclipse.debug.core.ILaunchConfiguration#getOptions() >+ */ >+ public Set getOptions() throws CoreException { >+ Set options = getAttribute(ATTR_LAUNCH_OPTIONS, (Set)null); >+ return (options != null ? new HashSet(options) : new HashSet(0)); >+ } >+ > /* (non-Javadoc) > * @see org.eclipse.debug.core.ILaunchConfiguration#getType() > */ >@@ -570,7 +614,19 @@ > */ > public ILaunch launch(String mode, IProgressMonitor monitor, boolean build, boolean register) throws CoreException { > // bug 28245 - force the delegate to load in case it is interested in launch notifications >- ILaunchConfigurationDelegate delegate= getDelegate(mode); >+ ILaunchConfigurationDelegate delegate = null; >+ Set options = getOptions(); >+ try { >+ delegate = getDelegate(mode, (String[]) options.toArray(new String[options.size()])); >+ } >+ 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, (String[]) options.toArray(new String[options.size()])); >+ } > ILaunchConfigurationDelegate2 delegate2 = null; > if (delegate instanceof ILaunchConfigurationDelegate2) { > delegate2 = (ILaunchConfigurationDelegate2) delegate; >@@ -690,5 +746,5 @@ > return getType().supportsMode(mode); > } > >-}//end class >+} > >Index: core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java,v >retrieving revision 1.58 >diff -u -r1.58 LaunchConfigurationWorkingCopy.java >--- core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java 22 Sep 2006 16:08:57 -0000 1.58 >+++ core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java 13 Oct 2006 17:50:06 -0000 >@@ -16,10 +16,10 @@ > import java.io.FileOutputStream; > import java.io.IOException; > import java.io.UnsupportedEncodingException; >-import com.ibm.icu.text.MessageFormat; > import java.util.ArrayList; > import java.util.List; > import java.util.Map; >+import java.util.Set; > > import javax.xml.parsers.ParserConfigurationException; > import javax.xml.transform.TransformerException; >@@ -40,6 +40,8 @@ > import org.eclipse.debug.core.ILaunchConfigurationType; > import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; > >+import com.ibm.icu.text.MessageFormat; >+ > /** > * A working copy launch configuration > */ >@@ -194,7 +196,7 @@ > } > // write the new file > writeNewFile(); >- resetDirty(); >+ fDirty = false; > } > > /** >@@ -350,7 +352,7 @@ > LaunchConfigurationInfo info = original.getInfo(); > setInfo(info.getCopy()); > setContainer(original.getContainer()); >- resetDirty(); >+ fDirty = false; > } > > /** >@@ -404,13 +406,75 @@ > } > > /** >- * Sets this working copy's state to not dirty. >+ * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#setOptions(java.lang.String[]) > */ >- private void resetDirty() { >- fDirty = false; >+ public void addOption(String option) { >+ try { >+ Set options = getOptions(); >+ if(option != null && !options.contains(option)) { >+ options.add(option); >+ getInfo().setAttribute(ATTR_LAUNCH_OPTIONS, options); >+ setDirty(); >+ } >+ } >+ catch (CoreException e) {DebugPlugin.log(e);} > } > > /** >+ * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#removeOption(java.lang.String) >+ */ >+ public void removeOption(String option) { >+ try { >+ Set options = getOptions(); >+ if(options.remove(option)) { >+ getInfo().setAttribute(ATTR_LAUNCH_OPTIONS, options); >+ setDirty(); >+ } >+ } >+ catch (CoreException e) {DebugPlugin.log(e);} >+ } >+ >+ /** >+ * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#setOptions(java.util.List) >+ */ >+ public void setOptions(Set options) { >+ getInfo().setAttribute(ATTR_LAUNCH_OPTIONS, (options.size() > 0 ? options : null)); >+ setDirty(); >+ } >+ >+ /** >+ * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#addOptions(java.util.Set) >+ */ >+ public void addOptions(Set options) { >+ try { >+ Set opts = getOptions(); >+ if(opts.addAll(options)) { >+ getInfo().setAttribute(ATTR_LAUNCH_OPTIONS, opts); >+ setDirty(); >+ } >+ } >+ catch (CoreException e) { >+ DebugPlugin.log(e); >+ } >+ } >+ >+ /** >+ * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#removeOptions(java.util.Set) >+ */ >+ public void removeOptions(Set options) { >+ try { >+ Set opts = getOptions(); >+ if(opts.removeAll(options)) { >+ getInfo().setAttribute(ATTR_LAUNCH_OPTIONS, opts); >+ setDirty(); >+ } >+ } >+ catch (CoreException e) { >+ DebugPlugin.log(e); >+ } >+ } >+ >+ /** > * @see ILaunchConfigurationWorkingCopy#rename(String) > */ > public void rename(String name) { >@@ -574,7 +638,7 @@ > } > setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_PATHS, paths); > setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_TYPES, types); >- }//end setResource >+ } > >-}//end class >+} > >Index: core/org/eclipse/debug/internal/core/LaunchOption.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchOption.java,v >retrieving revision 1.1 >diff -u -r1.1 LaunchOption.java >--- core/org/eclipse/debug/internal/core/LaunchOption.java 13 Sep 2006 19:09:07 -0000 1.1 >+++ core/org/eclipse/debug/internal/core/LaunchOption.java 13 Oct 2006 17:50:06 -0000 >@@ -10,26 +10,15 @@ > *******************************************************************************/ > package org.eclipse.debug.internal.core; > >-import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IConfigurationElement; >-import org.eclipse.core.runtime.IStatus; >-import org.eclipse.core.runtime.Status; >-import org.eclipse.debug.core.DebugPlugin; > import org.eclipse.debug.core.ILaunchOption; > >-import com.ibm.icu.text.MessageFormat; >- > /** > * Proxy to a launch option extension > * > * @since 3.3 > */ > public class LaunchOption implements ILaunchOption { >- >- //constants for attribute names >- private static final String ID = "id"; //$NON-NLS-1$ >- private static final String LABEL = "label"; //$NON-NLS-1$ >- private static final String OPTION = "option"; //$NON-NLS-1$ > > /** > * The associated configuration element >@@ -40,58 +29,21 @@ > * Constructor > * @param element the element to associate this launch option with > */ >- public LaunchOption(IConfigurationElement element) throws CoreException { >+ public LaunchOption(IConfigurationElement element) { > fElement = element; >- verifyAttributesExist(); > } > > /* (non-Javadoc) > * @see org.eclipse.debug.core.ILaunchOption#getIdentifier() > */ > public String getIdentifier() { >- return fElement.getAttribute(ID); >+ return fElement.getAttribute(IConfigurationElementConstants.ID); > } > > /* (non-Javadoc) > * @see org.eclipse.debug.core.ILaunchOption#getLabel() > */ > public String getLabel() { >- return fElement.getAttribute(LABEL); >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.debug.core.ILaunchOption#getOption() >- */ >- public String getOption() { >- return fElement.getAttribute(OPTION); >- } >- >- /** >- * Checks to ensure that all of the required attributes are present in the <code>IConfigurationElement</code> >- * @return true if all attributes are present, throws <code>CoreException</code> otherwise >- * @throws CoreException >- */ >- private void verifyAttributesExist() throws CoreException { >- if(fElement != null) { >- if(fElement.getAttribute(ID) == null) { >- missingAttribute(ID); >- } >- if(fElement.getAttribute(LABEL) == null) { >- missingAttribute(LABEL); >- } >- if(fElement.getAttribute(OPTION) == null) { >- missingAttribute(OPTION); >- } >- } >- } >- >- /** >- * Throws a <code>CoreException</code> indicating the specified attribute is missing from the extension >- * point definition >- * @param attrName the attribute name that is missing >- * @throws CoreException >- */ >- private void missingAttribute(String attrName) throws CoreException { >- throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.LaunchOption_0, new String[]{attrName}), null)); >+ return fElement.getAttribute(IConfigurationElementConstants.LABEL); > } > } >Index: core/org/eclipse/debug/internal/core/ContributedDelegate.java >=================================================================== >RCS file: core/org/eclipse/debug/internal/core/ContributedDelegate.java >diff -N core/org/eclipse/debug/internal/core/ContributedDelegate.java >--- core/org/eclipse/debug/internal/core/ContributedDelegate.java 8 May 2006 19:48:58 -0000 1.9 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,145 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2000, 2006 IBM Corporation and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Eclipse Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * IBM Corporation - initial API and implementation >- *******************************************************************************/ >-package org.eclipse.debug.internal.core; >- >-import com.ibm.icu.text.MessageFormat; >-import java.util.HashSet; >-import java.util.Set; >-import org.eclipse.core.runtime.CoreException; >-import org.eclipse.core.runtime.IConfigurationElement; >-import org.eclipse.core.runtime.IStatus; >-import org.eclipse.core.runtime.Status; >-import org.eclipse.debug.core.DebugPlugin; >-import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; >- >-/** >- * A placeholder for a launch delegate contributed for a launch mode for an >- * existing launch configuration type. >- */ >-public class ContributedDelegate { >- >- /** >- * The configuration element of the extension. >- */ >- private IConfigurationElement fElement; >- >- /** >- * Modes this delegate supports. >- */ >- private Set fModes; >- >- /** >- * Delegate, or <code>null</code> if not yet instantiated. >- */ >- private ILaunchConfigurationDelegate fDelegate; >- >- /** >- * Constructs a new contributed delegate on the >- * given configuration element. >- * >- * @param element configuration element >- */ >- protected ContributedDelegate(IConfigurationElement element) { >- setConfigurationElement(element); >- } >- >- /** >- * Sets this delegate's configuration element. >- * >- * @param element this delegate's configuration element >- */ >- private void setConfigurationElement(IConfigurationElement element) { >- fElement = element; >- } >- >- /** >- * Returns this delegate's configuration element. >- * >- * @return this delegate's configuration element >- */ >- protected IConfigurationElement getConfigurationElement() { >- return fElement; >- } >- >- /** >- * Returns the set of modes specified in the configuration data. >- * >- * @return the set of modes specified in the configuration data >- */ >- protected Set getModes() { >- if (fModes == null) { >- String modes= getConfigurationElement().getAttribute("modes"); //$NON-NLS-1$ >- if (modes == null) { >- return new HashSet(0); >- } >- String[] strings = modes.split(","); //$NON-NLS-1$ >- fModes = new HashSet(3); >- for (int i = 0; i < strings.length; i++) { >- String string = strings[i]; >- fModes.add(string.trim()); >- } >- } >- return fModes; >- } >- >- /** >- * Returns the type identifier of launch configuration type this delegate is >- * contributed to. >- */ >- protected String getLaunchConfigurationType() { >- return getConfigurationElement().getAttribute("type"); //$NON-NLS-1$ >- } >- >- protected ILaunchConfigurationDelegate getDelegate() throws CoreException { >- if (fDelegate == null) { >- Object object = getConfigurationElement().createExecutableExtension("delegate"); //$NON-NLS-1$ >- if (object instanceof ILaunchConfigurationDelegate) { >- fDelegate = (ILaunchConfigurationDelegate)object; >- } else { >- throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_Launch_delegate_for__0__does_not_implement_required_interface_ILaunchConfigurationDelegate__1, new String[]{getIdentifier()}), null)); >- } >- } >- return fDelegate; >- } >- >- /** >- * Returns the identifier of this extension point. >- */ >- protected String getIdentifier() { >- return getConfigurationElement().getAttribute("id"); //$NON-NLS-1$ >- } >- >- /** >- * Returns the source path computer id specified by this launch delegate >- * or <code>null</code> if none. >- * >- * @return the source path computer id specified by this launch delegate >- * or <code>null</code> if none >- * >- * @since 3.1 >- */ >- protected String getSourcePathComputerId() { >- return getConfigurationElement().getAttribute("sourcePathComputerId"); //$NON-NLS-1$ >- } >- >- /** >- * Returns the source locater id specified by this launch delegate >- * or <code>null</code> if none. >- * >- * @return the source locater id specified by this launch delegate >- * or <code>null</code> if none >- * >- * @since 3.1 >- */ >- protected String getSourceLocaterId() { >- return getConfigurationElement().getAttribute("sourceLocatorId"); //$NON-NLS-1$ >- } >-} >Index: core/org/eclipse/debug/internal/core/LaunchConfigurationType.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java,v >retrieving revision 1.33 >diff -u -r1.33 LaunchConfigurationType.java >--- core/org/eclipse/debug/internal/core/LaunchConfigurationType.java 8 May 2006 19:48:58 -0000 1.33 >+++ core/org/eclipse/debug/internal/core/LaunchConfigurationType.java 13 Oct 2006 17:50:06 -0000 >@@ -11,14 +11,11 @@ > package org.eclipse.debug.internal.core; > > >-import com.ibm.icu.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; >+ > import org.eclipse.core.resources.IContainer; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IConfigurationElement; >@@ -34,6 +31,8 @@ > import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; > import org.eclipse.debug.core.sourcelookup.ISourcePathComputer; > >+import com.ibm.icu.text.MessageFormat; >+ > /** > * A launch configuration type wrappers a configuration > * element for a <code>launchConfigurationType</code> >@@ -41,31 +40,52 @@ > */ > public class LaunchConfigurationType extends PlatformObject implements ILaunchConfigurationType { > >- private static String MIGRATION_DELEGATE = "migrationDelegate"; //$NON-NLS-1$ >- > /** > * The configuration element of the extension. > */ > private IConfigurationElement fElement; > > /** >- * Base modes this type supports. >+ * a listing of modes contributed to this launch configuration type >+ * @since 3.3 >+ * >+ * <p> >+ * <strong>EXPERIMENTAL</strong>. This field has been added as >+ * part of a work in progress. There is no guarantee that this API will >+ * remain unchanged during the 3.3 release cycle. Please do not use this API >+ * without consulting with the Platform/Debug team. >+ * </p> >+ */ >+ private Set fModes = null; >+ >+ /** >+ * the default source path computer for this config type >+ * @since 3.3 >+ * >+ * <p> >+ * <strong>EXPERIMENTAL</strong>. This field has been added as >+ * part of a work in progress. There is no guarantee that this API will >+ * remain unchanged during the 3.3 release cycle. Please do not use this API >+ * without consulting with the Platform/Debug team. >+ * </p> > */ >- private Set fBaseModes; >+ private ISourcePathComputer fSourcePathComputer = null; > > /** >- * Modes that delegates have been contributed for >+ * The source locator id for this config type > */ >- private Set fContributedModes; >+ private String fSourceLocator = null; > > /** > * The delegates for launch configurations of this type. > * Delegates are instantiated lazily as required. There may > * be different delegates for different modes (since 3.0). >- * Map of mode -> delegate >+ * Map of mode to delegate > */ > private Map fDelegates; > >+ private LaunchDelegate fSourceProvider; >+ > /** > * Constructs a new launch configuration type on the > * given configuration element. >@@ -73,83 +93,25 @@ > * @param element configuration element > */ > protected LaunchConfigurationType(IConfigurationElement element) { >- setConfigurationElement(element); >+ fElement = element; > } > > /* (non-Javadoc) > * @see org.eclipse.debug.core.ILaunchConfigurationType#getAttribute(java.lang.String) > */ > public String getAttribute(String attributeName) { >- return getConfigurationElement().getAttribute(attributeName); >+ return fElement.getAttribute(attributeName); > } >- >- /** >- * Returns the set of modes specified in the configuration data. >- * >- * @return the set of modes specified in the configuration data >- */ >- protected Set getBaseModes() { >- if (fBaseModes == null) { >- String modes= getConfigurationElement().getAttribute("modes"); //$NON-NLS-1$ >- if (modes == null) { >- return new HashSet(0); >- } >- StringTokenizer tokenizer= new StringTokenizer(modes, ","); //$NON-NLS-1$ >- fBaseModes = new HashSet(tokenizer.countTokens()); >- while (tokenizer.hasMoreTokens()) { >- fBaseModes.add(tokenizer.nextToken().trim()); >- } >- } >- return fBaseModes; >- } > > /* (non-Javadoc) > * @see org.eclipse.debug.core.ILaunchConfigurationType#getCategory() > */ > public String getCategory() { >- return getConfigurationElement().getAttribute("category"); //$NON-NLS-1$ >- } >- >- /** >- * Returns this type's configuration element. >- * >- * @return this type's configuration element >- */ >- protected IConfigurationElement getConfigurationElement() { >- return fElement; >- } >- >- /** >- * Returns the set of modes delegates have been contributed for >- * >- * @return the set of modes delegates have been contributed for >- */ >- protected Set getContributedModes() { >- if (fContributedModes == null) { >- fContributedModes = new HashSet(0); >- // add modes for contributed delegates >- List delegates = ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getContributedDelegates(); >- Iterator iterator = delegates.iterator(); >- while (iterator.hasNext()) { >- ContributedDelegate delegate = (ContributedDelegate)iterator.next(); >- if (delegate.getLaunchConfigurationType().equals(getIdentifier())) { >- fContributedModes.addAll(delegate.getModes()); >- } >- } >- } >- return fContributedModes; >+ return fElement.getAttribute(IConfigurationElementConstants.CATEGORY); > } > > /** >- * Returns the launch configuration delegate for launch >- * configurations of this type. The first time this method >- * is called, the delegate is instantiated. >- * > * @see org.eclipse.debug.core.ILaunchConfigurationType#getDelegate() >- * @return launch configuration delegate >- * @exception CoreException if unable to instantiate the >- * delegate >- * @deprecated use <code>getDelegate(String)</code> to specify mode > */ > public ILaunchConfigurationDelegate getDelegate() throws CoreException { > return getDelegate(ILaunchManager.RUN_MODE); >@@ -159,62 +121,47 @@ > * @see org.eclipse.debug.core.ILaunchConfigurationType#getDelegate(java.lang.String) > */ > public ILaunchConfigurationDelegate getDelegate(String mode) throws CoreException { >+ return getDelegate(mode, null); >+ } >+ >+ /** >+ * @see org.eclipse.debug.core.ILaunchConfigurationType#getDelegate(java.lang.String, java.lang.String[]) >+ */ >+ public ILaunchConfigurationDelegate getDelegate(String mode, String[] options) throws CoreException { > if (!supportsMode(mode)) { > throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_9, new String[] {mode, getIdentifier()}), null)); > } > if (fDelegates == null) { > // initialize delegate table with base modes >- fDelegates = new Hashtable(3); >+ fDelegates = new Hashtable(); > } > ILaunchConfigurationDelegate delegate = (ILaunchConfigurationDelegate)fDelegates.get(mode); > if (delegate == null) { >- Set modes = getBaseModes(); >- if (modes.contains(mode)) { >- Object object = getConfigurationElement().createExecutableExtension("delegate"); //$NON-NLS-1$ >- if (object instanceof ILaunchConfigurationDelegate) { >- Iterator iter = modes.iterator(); >- while (iter.hasNext()) { >- fDelegates.put(iter.next(), object); >- } >- return (ILaunchConfigurationDelegate)object; >- } >- throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_Launch_delegate_for__0__does_not_implement_required_interface_ILaunchConfigurationDelegate__1, new String[]{getName()}), null)); >- } >- // contributed modes >- List contributed = ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getContributedDelegates(); >- Iterator iterator = contributed.iterator(); >- while (iterator.hasNext()) { >- ContributedDelegate contributedDelegate = (ContributedDelegate)iterator.next(); >- if (getIdentifier().equals(contributedDelegate.getLaunchConfigurationType())) { >- modes = contributedDelegate.getModes(); >- if (modes.contains(mode)) { >- delegate = contributedDelegate.getDelegate(); >- Iterator modesIterator = modes.iterator(); >- while (modesIterator.hasNext()) { >- fDelegates.put(modesIterator.next(), delegate); >- } >- return delegate; >- } >+ if(fModes.contains(mode)) { >+ LaunchDelegate[] delegates = ((LaunchManager) DebugPlugin.getDefault().getLaunchManager()).getLaunchDelegates(getIdentifier(), mode, options); >+ if(delegates.length > 0) { >+ return delegates[0].getDelegate(); > } > } >- } else { >+ } >+ else { > return delegate; > } >- throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_10, new String[] {getIdentifier(), mode}), null)); >+ throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_10, new String[] {getIdentifier(), mode}), null)); > } > > /* (non-Javadoc) > * @see org.eclipse.debug.core.ILaunchConfigurationType#getIdentifier() > */ > public String getIdentifier() { >- return getConfigurationElement().getAttribute("id"); //$NON-NLS-1$ >+ return fElement.getAttribute(IConfigurationElementConstants.ID); > } > > /* (non-Javadoc) > * @see org.eclipse.debug.core.ILaunchConfigurationType#getName() > */ > public String getName() { >- return getConfigurationElement().getAttribute("name"); //$NON-NLS-1$ >+ return fElement.getAttribute(IConfigurationElementConstants.NAME); > } > > /* (non-Javadoc) >@@ -228,50 +175,78 @@ > * @see org.eclipse.debug.core.ILaunchConfigurationType#getSourceLocatorId() > */ > public String getSourceLocatorId() { >- String id = getAttribute("sourceLocatorId"); //$NON-NLS-1$ >- if (id == null) { >- // check for specification by mode specific delegate >- List delegates = ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getContributedDelegates(); >- Iterator iterator = delegates.iterator(); >- while (iterator.hasNext() && id == null) { >- ContributedDelegate delegate = (ContributedDelegate)iterator.next(); >- if (delegate.getLaunchConfigurationType().equals(getIdentifier())) { >- id = delegate.getSourceLocaterId(); >+ if(fSourceLocator == null) { >+ fSourceLocator = getAttribute(IConfigurationElementConstants.SOURCE_LOCATOR); >+ //see if the cached source provider knows about it >+ if(fSourceProvider != null) { >+ fSourceLocator = fSourceProvider.getSourceLocatorId(); >+ } >+ //if not provided check all the applicable delegates for one and record the delegate if found, >+ //so it can be reused to try and find the source path computer >+ if(fSourceLocator == null) { >+ LaunchDelegate[] delegates = ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getLaunchDelegates(getIdentifier()); >+ for(int i = 0; i < delegates.length; i++) { >+ fSourceLocator = delegates[i].getSourceLocatorId(); >+ if(fSourceLocator != null) { >+ fSourceProvider = delegates[i]; >+ return fSourceLocator; >+ } > } >+ fSourceProvider = null; > } > } >- return id; >+ return fSourceLocator; > } > > /* (non-Javadoc) > * @see org.eclipse.debug.core.ILaunchConfigurationType#getSourcePathComputer() > */ > public ISourcePathComputer getSourcePathComputer() { >- String id = getConfigurationElement().getAttribute("sourcePathComputerId"); //$NON-NLS-1$ >- if (id == null) { >- // check for specification by mode specific delegate >- List delegates = ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getContributedDelegates(); >- Iterator iterator = delegates.iterator(); >- while (iterator.hasNext() && id == null) { >- ContributedDelegate delegate = (ContributedDelegate)iterator.next(); >- if (delegate.getLaunchConfigurationType().equals(getIdentifier())) { >- id = delegate.getSourcePathComputerId(); >+ if(fSourcePathComputer == null) { >+ //get the id >+ String id = fElement.getAttribute(IConfigurationElementConstants.SOURCE_PATH_COMPUTER); >+ //ask if the source provider knows about it >+ if(fSourceProvider != null) { >+ id = fSourceProvider.getSourcePathComputerId(); >+ } >+ if(id != null) { >+ fSourcePathComputer = DebugPlugin.getDefault().getLaunchManager().getSourcePathComputer(id); >+ } >+ else { >+ //if not provided check all the applicable delegates for one and record the delegate if found, >+ //so it can be reused to try and find the source path computer >+ LaunchDelegate[] delegates = ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getLaunchDelegates(getIdentifier()); >+ for(int i = 0; i < delegates.length; i++) { >+ id = delegates[i].getSourcePathComputerId(); >+ if(id != null) { >+ fSourceProvider = delegates[i]; >+ fSourcePathComputer = DebugPlugin.getDefault().getLaunchManager().getSourcePathComputer(id); >+ if(fSourcePathComputer != null) { >+ return fSourcePathComputer; >+ } >+ } > } >+ fSourceProvider = null; > } >+ > } >- if (id != null && id.length() > 0) { >- return DebugPlugin.getDefault().getLaunchManager().getSourcePathComputer(id); >- } >- return null; >+ return fSourcePathComputer; > } > >- /* (non-Javadoc) >+ /** > * @see org.eclipse.debug.core.ILaunchConfigurationType#getSupportedModes() > */ > public Set getSupportedModes() { >- HashSet modes = new HashSet(getBaseModes()); >- modes.addAll(getContributedModes()); >- return modes; >+ if(fModes == null) { >+ fModes = new HashSet(); >+ LaunchDelegate[] delegates = ((LaunchManager) DebugPlugin.getDefault().getLaunchManager()).getLaunchDelegates(); >+ for(int i= 0; i < delegates.length; i++) { >+ if(delegates[i].appliesTo(getIdentifier())) { >+ fModes.addAll(delegates[i].getModes()); >+ } >+ } >+ } >+ return fModes; > } > > /** >@@ -283,14 +258,14 @@ > * @since 3.2 > */ > public boolean isMigrationCandidate(ILaunchConfiguration candidate) throws CoreException { >- if(getAttribute(MIGRATION_DELEGATE) != null) { >+ if(getAttribute(IConfigurationElementConstants.MIGRATION_DELEGATE) != null) { > if(fDelegates == null) { > fDelegates = new Hashtable(); > } >- Object delegate = fDelegates.get(MIGRATION_DELEGATE); >+ Object delegate = fDelegates.get(IConfigurationElementConstants.MIGRATION_DELEGATE); > if(delegate == null) { >- delegate = getConfigurationElement().createExecutableExtension(MIGRATION_DELEGATE); >- fDelegates.put(MIGRATION_DELEGATE, delegate); >+ delegate = fElement.createExecutableExtension(IConfigurationElementConstants.MIGRATION_DELEGATE); >+ fDelegates.put(IConfigurationElementConstants.MIGRATION_DELEGATE, delegate); > } > if(delegate instanceof ILaunchConfigurationMigrationDelegate) { > return ((ILaunchConfigurationMigrationDelegate)delegate).isCandidate(candidate); >@@ -303,7 +278,7 @@ > * @see org.eclipse.debug.core.ILaunchConfigurationType#isPublic() > */ > public boolean isPublic() { >- String publicString = getConfigurationElement().getAttribute("public"); //$NON-NLS-1$ >+ String publicString = fElement.getAttribute(IConfigurationElementConstants.PUBLIC); > if (publicString != null) { > if (publicString.equalsIgnoreCase("false")) { //$NON-NLS-1$ > return false; >@@ -320,14 +295,14 @@ > * @since 3.2 > */ > public void migrate(ILaunchConfiguration candidate) throws CoreException { >- if(getAttribute(MIGRATION_DELEGATE) != null) { >+ if(getAttribute(IConfigurationElementConstants.MIGRATION_DELEGATE) != null) { > if(fDelegates == null) { > fDelegates = new Hashtable(); > } >- Object delegate = fDelegates.get(MIGRATION_DELEGATE); >+ Object delegate = fDelegates.get(IConfigurationElementConstants.MIGRATION_DELEGATE); > if(delegate == null) { >- delegate = getConfigurationElement().createExecutableExtension(MIGRATION_DELEGATE); >- fDelegates.put(MIGRATION_DELEGATE, delegate); >+ delegate = fElement.createExecutableExtension(IConfigurationElementConstants.MIGRATION_DELEGATE); >+ fDelegates.put(IConfigurationElementConstants.MIGRATION_DELEGATE, delegate); > } > if(delegate instanceof ILaunchConfigurationMigrationDelegate) { > ((ILaunchConfigurationMigrationDelegate)delegate).migrate(candidate); >@@ -339,23 +314,28 @@ > * @see org.eclipse.debug.core.ILaunchConfigurationType#newInstance(org.eclipse.core.resources.IContainer, java.lang.String) > */ > public ILaunchConfigurationWorkingCopy newInstance(IContainer container, String name) { >- return new LaunchConfigurationWorkingCopy(container, name, this); >+ return new LaunchConfigurationWorkingCopy(container, name, this); > } > > /** >- * Sets this type's configuration element. >- * >- * @param element this type's configuration element >+ * @see org.eclipse.debug.core.ILaunchConfigurationType#supportsMode(java.lang.String) > */ >- private void setConfigurationElement(IConfigurationElement element) { >- fElement = element; >+ public boolean supportsMode(String mode) { >+ return getSupportedModes().contains(mode); > } >- >- /** >- * @see ILaunchConfigurationType#supportsMode(String) >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.core.ILaunchConfigurationType#getContributorName() > */ >- public boolean supportsMode(String mode) { >- return getBaseModes().contains(mode) || getContributedModes().contains(mode); >+ public String getContributorName() { >+ return fElement.getContributor().getName(); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.core.ILaunchConfigurationType#getImageDescriptorId() >+ */ >+ public String getImageDescriptorPath() { >+ return fElement.getAttribute(IConfigurationElementConstants.ICON); > } > } > >Index: core/org/eclipse/debug/internal/core/DebugCoreMessages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties,v >retrieving revision 1.67 >diff -u -r1.67 DebugCoreMessages.properties >--- core/org/eclipse/debug/internal/core/DebugCoreMessages.properties 13 Sep 2006 19:09:07 -0000 1.67 >+++ core/org/eclipse/debug/internal/core/DebugCoreMessages.properties 13 Oct 2006 17:50:05 -0000 >@@ -42,6 +42,7 @@ > LaunchConfigurationInfo_Invalid_launch_configuration_XML__10=Invalid launch configuration XML. > LaunchConfigurationInfo_missing_type=Launch configuration type id \"{0}\" does not exist.\nPossible causes:\n\tMissing specification of a launch type (missing plug-in)\n\tIncorrect launch configuration XML > LaunchConfigurationInfo_36=A null key has been specified for an attribute in this launch configuration >+LaunchConfigurationInfo_35=Attribute {0} is not of type java.util.Set. > LaunchConfigurationWorkingCopy__0__occurred_generating_launch_configuration_XML__1={0} occurred generating launch configuration XML. > LaunchConfigurationWorkingCopy_Specified_container_for_launch_configuration_does_not_exist_2=Specified container for launch configuration does not exist > LaunchConfigurationWorkingCopy_5=Unable to save launch configuration. >@@ -63,6 +64,6 @@ > RuntimeProcess_Exit_value_not_available_until_process_terminates__1=Exit value not available until process terminates. > LaunchConfigurationType_Launch_delegate_for__0__does_not_implement_required_interface_ILaunchConfigurationDelegate__1=Launch delegate for {0} does not implement required interface ILaunchConfigurationDelegate. > LaunchConfigurationType_9=Launch mode {0} not supported for configuration type {1} >-LaunchConfigurationType_10=Launch delegate not registered for configuration type {0}, mode {1} >+LaunchConfigurationType_10=There is no launch delegate registered for configuration type {0}, mode {1} > WatchExpression_0=(Watch expressions not supported) > NullStreamsProxy_0=Null Stream Monitor >Index: core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java,v >retrieving revision 1.35 >diff -u -r1.35 LaunchConfigurationInfo.java >--- core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java 8 May 2006 19:48:58 -0000 1.35 >+++ core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java 13 Oct 2006 17:50:06 -0000 >@@ -12,10 +12,10 @@ > > > import java.io.IOException; >-import com.ibm.icu.text.MessageFormat; > import java.util.ArrayList; > import java.util.Comparator; > import java.util.HashMap; >+import java.util.HashSet; > import java.util.Iterator; > import java.util.List; > import java.util.Map; >@@ -34,18 +34,35 @@ > import org.w3c.dom.Element; > import org.w3c.dom.Node; > import org.w3c.dom.NodeList; >+ >+import com.ibm.icu.text.MessageFormat; > > /** >- * The information associated with a launch configuration >- * handle. >+ * The information associated with a launch configuration handle. > */ > public class LaunchConfigurationInfo { >- >+ > /** >- * This configurations attribute table. >- * Keys are <code>String</code>s and values >- * are one of <code>String</code>, <code>Integer</code>, >- * or <code>Boolean</code>. >+ * Constants fo XML element names and attrbiutes >+ */ >+ private static final String KEY = "key"; //$NON-NLS-1$ >+ private static final String VALUE = "value"; //$NON-NLS-1$ >+ private static final String SET_ENTRY = "setEntry"; //$NON-NLS-1$ >+ private static final String LAUNCH_CONFIGURATION = "launchConfiguration"; //$NON-NLS-1$ >+ private static final String MAP_ENTRY = "mapEntry"; //$NON-NLS-1$ >+ private static final String LIST_ENTRY = "listEntry"; //$NON-NLS-1$ >+ private static final String SET_ATTRIBUTE = "setAttribute"; //$NON-NLS-1$ >+ private static final String MAP_ATTRIBUTE = "mapAttribute"; //$NON-NLS-1$ >+ private static final String LIST_ATTRIBUTE = "listAttribute"; //$NON-NLS-1$ >+ private static final String BOOLEAN_ATTRIBUTE = "booleanAttribute"; //$NON-NLS-1$ >+ private static final String INT_ATTRIBUTE = "intAttribute"; //$NON-NLS-1$ >+ private static final String STRING_ATTRIBUTE = "stringAttribute"; //$NON-NLS-1$ >+ private static final String TYPE = "type"; //$NON-NLS-1$ >+ >+ /** >+ * This configurations attribute table. Keys are <code>String</code>s and >+ * values are one of <code>String</code>, <code>Integer</code>, or >+ * <code>Boolean</code>. > */ > private HashMap fAttributes; > >@@ -88,7 +105,8 @@ > /** > * Sets this configuration's attribute table. > * >- * @param table attribute table >+ * @param table >+ * attribute table > */ > private void setAttributeTable(HashMap table) { > fAttributes = table; >@@ -115,13 +133,13 @@ > } > > /** >- * Returns the <code>String</code> attribute with the >- * given key or the given default value if undefined. >+ * Returns the <code>String</code> attribute with the given key or the >+ * given default value if undefined. > * >- * @return attribute specified by given key or the defaultValue >- * if undefined >- * @throws CoreException if the attribute with the given key exists >- * but is not a <code>String</code> >+ * @return attribute specified by given key or the defaultValue if undefined >+ * @throws CoreException >+ * if the attribute with the given key exists but is not a >+ * <code>String</code> > */ > protected String getStringAttribute(String key, String defaultValue) throws CoreException { > Object attr = getAttributeTable().get(key); >@@ -140,13 +158,13 @@ > } > > /** >- * Returns the <code>int</code> attribute with the >- * given key or the given default value if undefined. >+ * Returns the <code>int</code> attribute with the given key or the given >+ * default value if undefined. > * >- * @return attribute specified by given key or the defaultValue >- * if undefined >- * @throws CoreException if the attribute with the given key exists >- * but is not an <code>int</code> >+ * @return attribute specified by given key or the defaultValue if undefined >+ * @throws CoreException >+ * if the attribute with the given key exists but is not an >+ * <code>int</code> > */ > protected int getIntAttribute(String key, int defaultValue) throws CoreException { > Object attr = getAttributeTable().get(key); >@@ -165,13 +183,13 @@ > } > > /** >- * Returns the <code>boolean</code> attribute with the >- * given key or the given default value if undefined. >+ * Returns the <code>boolean</code> attribute with the given key or the >+ * given default value if undefined. > * >- * @return attribute specified by given key or the defaultValue >- * if undefined >- * @throws CoreException if the attribute with the given key exists >- * but is not a <code>boolean</code> >+ * @return attribute specified by given key or the defaultValue if undefined >+ * @throws CoreException >+ * if the attribute with the given key exists but is not a >+ * <code>boolean</code> > */ > protected boolean getBooleanAttribute(String key, boolean defaultValue) throws CoreException { > Object attr = getAttributeTable().get(key); >@@ -190,13 +208,13 @@ > } > > /** >- * Returns the <code>java.util.List</code> attribute with the >- * given key or the given default value if undefined. >+ * Returns the <code>java.util.List</code> attribute with the given key or >+ * the given default value if undefined. > * >- * @return attribute specified by given key or the defaultValue >- * if undefined >- * @throws CoreException if the attribute with the given key exists >- * but is not a <code>java.util.List</code> >+ * @return attribute specified by given key or the defaultValue if undefined >+ * @throws CoreException >+ * if the attribute with the given key exists but is not a >+ * <code>java.util.List</code> > */ > protected List getListAttribute(String key, List defaultValue) throws CoreException { > Object attr = getAttributeTable().get(key); >@@ -215,13 +233,40 @@ > } > > /** >- * Returns the <code>java.util.Map</code> attribute with the >- * given key or the given default value if undefined. >+ * Returns the <code>java.util.Set</code> attribute with the given key or >+ * the given default value if undefined. >+ * >+ * @return attribute specified by given key or the defaultValue if undefined >+ * @throws CoreException >+ * if the attribute with the given key exists but is not a >+ * <code>java.util.Set</code> >+ * >+ * @since 3.3 EXPERIMENTAL >+ */ >+ protected Set getSetAttribute(String key, Set defaultValue) throws CoreException { >+ Object attr = getAttributeTable().get(key); >+ if (attr != null) { >+ if (attr instanceof Set) { >+ return (Set)attr; >+ } >+ throw new DebugException( >+ new Status( >+ IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), >+ DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_35, new String[] {key}), null >+ ) >+ ); >+ } >+ return defaultValue; >+ } >+ >+ /** >+ * Returns the <code>java.util.Map</code> attribute with the given key or >+ * the given default value if undefined. > * >- * @return attribute specified by given key or the defaultValue >- * if undefined >- * @throws CoreException if the attribute with the given key exists >- * but is not a <code>java.util.Map</code> >+ * @return attribute specified by given key or the defaultValue if undefined >+ * @throws CoreException >+ * if the attribute with the given key exists but is not a >+ * <code>java.util.Map</code> > */ > protected Map getMapAttribute(String key, Map defaultValue) throws CoreException { > Object attr = getAttributeTable().get(key); >@@ -239,16 +284,17 @@ > return defaultValue; > } > >- /** >+ /** > * Sets this configuration's type. > * >- * @param type launch configuration type >+ * @param type >+ * launch configuration type > */ > protected void setType(ILaunchConfigurationType type) { > fType = type; > } > >- /** >+ /** > * Returns this configuration's type. > * > * @return launch configuration type >@@ -280,11 +326,13 @@ > } > > /** >- * Sets the given attribute to the given value. Only >- * working copy's should use this API. >+ * Sets the given attribute to the given value. Only working copy's should >+ * use this API. > * >- * @param key attribute key >- * @param value attribute value >+ * @param key >+ * attribute key >+ * @param value >+ * attribute value > */ > protected void setAttribute(String key, Object value) { > if (value == null) { >@@ -298,18 +346,22 @@ > * Returns the content of this info as XML > * > * @return the content of this info as XML >- * @throws CoreException if a attribute has been set with a null key >- * @throws IOException if an exception occurs creating the XML >- * @throws ParserConfigurationException if an exception occurs creating the XML >- * @throws TransformerException if an exception occurs creating the XML >+ * @throws CoreException >+ * if a attribute has been set with a null key >+ * @throws IOException >+ * if an exception occurs creating the XML >+ * @throws ParserConfigurationException >+ * if an exception occurs creating the XML >+ * @throws TransformerException >+ * if an exception occurs creating the XML > */ > protected String getAsXML() throws CoreException, IOException, ParserConfigurationException, TransformerException { > > Document doc = LaunchManager.getDocument(); >- Element configRootElement = doc.createElement("launchConfiguration"); //$NON-NLS-1$ >+ Element configRootElement = doc.createElement(LAUNCH_CONFIGURATION); > doc.appendChild(configRootElement); > >- configRootElement.setAttribute("type", getType().getIdentifier()); //$NON-NLS-1$ >+ configRootElement.setAttribute(TYPE, getType().getIdentifier()); > > Iterator keys = getAttributeTable().keySet().iterator(); > while (keys.hasNext()) { >@@ -330,18 +382,20 @@ > String valueString = null; > if (value instanceof String) { > valueString = (String)value; >- element = createKeyValueElement(doc, "stringAttribute", key, valueString); //$NON-NLS-1$ >+ element = createKeyValueElement(doc, STRING_ATTRIBUTE, key, valueString); > } else if (value instanceof Integer) { > valueString = ((Integer)value).toString(); >- element = createKeyValueElement(doc, "intAttribute", key, valueString); //$NON-NLS-1$ >+ element = createKeyValueElement(doc, INT_ATTRIBUTE, key, valueString); > } else if (value instanceof Boolean) { > valueString = ((Boolean)value).toString(); >- element = createKeyValueElement(doc, "booleanAttribute", key, valueString); //$NON-NLS-1$ >+ element = createKeyValueElement(doc, BOOLEAN_ATTRIBUTE, key, valueString); > } else if (value instanceof List) { >- element = createListElement(doc, "listAttribute", key, (List)value); //$NON-NLS-1$ >+ element = createListElement(doc, LIST_ATTRIBUTE, key, (List)value); > } else if (value instanceof Map) { >- element = createMapElement(doc, "mapAttribute", key, (Map)value); //$NON-NLS-1$ >- } >+ element = createMapElement(doc, MAP_ATTRIBUTE, key, (Map)value); >+ } else if(value instanceof Set) { >+ element = createSetElement(doc, SET_ATTRIBUTE, key, (Set)value); >+ } > configRootElement.appendChild(element); > } > >@@ -349,51 +403,101 @@ > } > > /** >- * Helper method that creates a 'key value' element of the specified type with the >- * specified attribute values. >+ * Helper method that creates a 'key value' element of the specified type >+ * with the specified attribute values. > */ > protected Element createKeyValueElement(Document doc, String elementType, String key, String value) { > Element element = doc.createElement(elementType); >- element.setAttribute("key", key); //$NON-NLS-1$ >- element.setAttribute("value", value); //$NON-NLS-1$ >+ element.setAttribute(KEY, key); >+ element.setAttribute(VALUE, value); > return element; > } > >+ /** >+ * Creates a new <code>Element</code> for the specified >+ * <code>java.util.List</code> >+ * >+ * @param doc the doc to add the element to >+ * @param elementType the type of the element >+ * @param setKey the key for the element >+ * @param list the list to fill the new element with >+ * @return the new element >+ */ > protected Element createListElement(Document doc, String elementType, String listKey, List list) { > Element listElement = doc.createElement(elementType); >- listElement.setAttribute("key", listKey); //$NON-NLS-1$ >+ listElement.setAttribute(KEY, listKey); > Iterator iterator = list.iterator(); > while (iterator.hasNext()) { > String value = (String) iterator.next(); >- Element element = doc.createElement("listEntry"); //$NON-NLS-1$ >- element.setAttribute("value", value); //$NON-NLS-1$ >+ Element element = doc.createElement(LIST_ENTRY); >+ element.setAttribute(VALUE, value); > listElement.appendChild(element); > } > return listElement; > } > >+ /** >+ * Creates a new <code>Element</code> for the specified >+ * <code>java.util.Set</code> >+ * >+ * @param doc the doc to add the element to >+ * @param elementType the type of the element >+ * @param setKey the key for the element >+ * @param set the set to fill the new element with >+ * @return the new element >+ * >+ * @since 3.3 >+ */ >+ protected Element createSetElement(Document doc, String elementType, String setKey, Set set) { >+ Element setElement = doc.createElement(elementType); >+ setElement.setAttribute(KEY, setKey); >+ Element element = null; >+ for(Iterator iter = set.iterator(); iter.hasNext();) { >+ element = doc.createElement(SET_ENTRY); >+ element.setAttribute(VALUE, (String) iter.next()); >+ setElement.appendChild(element); >+ } >+ return setElement; >+ } >+ >+ /** >+ * Creates a new <code>Element</code> for the specified >+ * <code>java.util.Map</code> >+ * >+ * @param doc the doc to add the element to >+ * @param elementType the type of the element >+ * @param setKey the key for the element >+ * @param map the map to fill the new element with >+ * @return the new element >+ * >+ */ > protected Element createMapElement(Document doc, String elementType, String mapKey, Map map) { > Element mapElement = doc.createElement(elementType); >- mapElement.setAttribute("key", mapKey); //$NON-NLS-1$ >+ mapElement.setAttribute(KEY, mapKey); > Iterator iterator = map.keySet().iterator(); > while (iterator.hasNext()) { > String key = (String) iterator.next(); > String value = (String) map.get(key); >- Element element = doc.createElement("mapEntry"); //$NON-NLS-1$ >- element.setAttribute("key", key); //$NON-NLS-1$ >- element.setAttribute("value", value); //$NON-NLS-1$ >+ Element element = doc.createElement(MAP_ENTRY); >+ element.setAttribute(KEY, key); >+ element.setAttribute(VALUE, value); > mapElement.appendChild(element); > } > return mapElement; > } > >+ /** >+ * Initializes the mapping of attributes from the XML file >+ * @param root the root node from the XML document >+ * @throws CoreException >+ */ > protected void initializeFromXML(Element root) throws CoreException { >- if (!root.getNodeName().equalsIgnoreCase("launchConfiguration")) { //$NON-NLS-1$ >+ if (!root.getNodeName().equalsIgnoreCase(LAUNCH_CONFIGURATION)) { > throw getInvalidFormatDebugException(); > } > > // read type >- String id = root.getAttribute("type"); //$NON-NLS-1$ >+ String id = root.getAttribute(TYPE); > if (id == null) { > throw getInvalidFormatDebugException(); > } >@@ -410,106 +514,174 @@ > setType(type); > > NodeList list = root.getChildNodes(); >- int length = list.getLength(); >- for (int i = 0; i < length; ++i) { >- Node node = list.item(i); >+ Node node = null; >+ Element element = null; >+ String nodeName = null; >+ for (int i = 0; i < list.getLength(); ++i) { >+ node = list.item(i); > short nodeType = node.getNodeType(); > if (nodeType == Node.ELEMENT_NODE) { >- Element element = (Element) node; >- String nodeName = element.getNodeName(); >- >- if (nodeName.equalsIgnoreCase("stringAttribute")) { //$NON-NLS-1$ >+ element = (Element) node; >+ nodeName = element.getNodeName(); >+ if (nodeName.equalsIgnoreCase(STRING_ATTRIBUTE)) { > setStringAttribute(element); >- } else if (nodeName.equalsIgnoreCase("intAttribute")) { //$NON-NLS-1$ >+ } else if (nodeName.equalsIgnoreCase(INT_ATTRIBUTE)) { > setIntegerAttribute(element); >- } else if (nodeName.equalsIgnoreCase("booleanAttribute")) { //$NON-NLS-1$ >+ } else if (nodeName.equalsIgnoreCase(BOOLEAN_ATTRIBUTE)) { > setBooleanAttribute(element); >- } else if (nodeName.equalsIgnoreCase("listAttribute")) { //$NON-NLS-1$ >+ } else if (nodeName.equalsIgnoreCase(LIST_ATTRIBUTE)) { > setListAttribute(element); >- } else if (nodeName.equalsIgnoreCase("mapAttribute")) { //$NON-NLS-1$ >+ } else if (nodeName.equalsIgnoreCase(MAP_ATTRIBUTE)) { > setMapAttribute(element); >+ } else if(nodeName.equalsIgnoreCase(SET_ATTRIBUTE)) { >+ setSetAttribute(element); > } > } > } > } > >+ /** >+ * Loads a <code>String</code> from the specified element into the local attribute mapping >+ * @param element the element to load from >+ * @throws CoreException >+ */ > protected void setStringAttribute(Element element) throws CoreException { >- String key = getKeyAttribute(element); >- String value = getValueAttribute(element); >- setAttribute(key, value); >+ setAttribute(getKeyAttribute(element), getValueAttribute(element)); > } > >+ /** >+ * Loads an <code>Integer</code> from the specified element into the local attribute mapping >+ * @param element the element to load from >+ * @throws CoreException >+ */ > protected void setIntegerAttribute(Element element) throws CoreException { >- String key = getKeyAttribute(element); >- String value = getValueAttribute(element); >- setAttribute(key, new Integer(value)); >+ setAttribute(getKeyAttribute(element), new Integer(getValueAttribute(element))); > } > >+ /** >+ * Loads a <code>Boolean</code> from the specified element into the local attribute mapping >+ * @param element the element to load from >+ * @throws CoreException >+ */ > protected void setBooleanAttribute(Element element) throws CoreException { >- String key = getKeyAttribute(element); >- String value = getValueAttribute(element); >- setAttribute(key, Boolean.valueOf(value)); >+ setAttribute(getKeyAttribute(element), Boolean.valueOf(getValueAttribute(element))); > } > >+ /** >+ * Reads a <code>List</code> attribute from the specified XML node and >+ * loads it into the mapping of attributes >+ * >+ * @param element the element to read the list attribute from >+ * @throws CoreException if the element has an invalid format >+ */ > protected void setListAttribute(Element element) throws CoreException { >- String listKey = element.getAttribute("key"); //$NON-NLS-1$ >+ String listKey = element.getAttribute(KEY); > NodeList nodeList = element.getChildNodes(); > int entryCount = nodeList.getLength(); > List list = new ArrayList(entryCount); >+ Node node = null; >+ Element selement = null; > for (int i = 0; i < entryCount; i++) { >- Node node = nodeList.item(i); >- short type = node.getNodeType(); >- if (type == Node.ELEMENT_NODE) { >- Element subElement = (Element) node; >- String nodeName = subElement.getNodeName(); >- if (!nodeName.equalsIgnoreCase("listEntry")) { //$NON-NLS-1$ >+ node = nodeList.item(i); >+ if (node.getNodeType() == Node.ELEMENT_NODE) { >+ selement = (Element) node; >+ if (!selement.getNodeName().equalsIgnoreCase(LIST_ENTRY)) { > throw getInvalidFormatDebugException(); > } >- String value = getValueAttribute(subElement); >- list.add(value); >+ list.add(getValueAttribute(selement)); > } > } > setAttribute(listKey, list); > } > >+ /** >+ * Reads a <code>Set</code> attribute from the specified XML node and >+ * loads it into the mapping of attributes >+ * >+ * @param element the element to read the set attribute from >+ * @throws CoreException if the element has an invalid format >+ * >+ * @since 3.3 >+ */ >+ protected void setSetAttribute(Element element) throws CoreException { >+ String setKey = element.getAttribute(KEY); >+ NodeList nodeList = element.getChildNodes(); >+ int entryCount = nodeList.getLength(); >+ Set set = new HashSet(entryCount); >+ Node node = null; >+ Element selement = null; >+ for(int i = 0; i < entryCount; i++) { >+ node = nodeList.item(i); >+ if(node.getNodeType() == Node.ELEMENT_NODE) { >+ selement = (Element)node; >+ if(!selement.getNodeName().equalsIgnoreCase(SET_ENTRY)) { >+ throw getInvalidFormatDebugException(); >+ } >+ set.add(getValueAttribute(selement)); >+ } >+ } >+ setAttribute(setKey, set); >+ } >+ >+ /** >+ * Reads a <code>Map</code> attribute from the specified XML node and >+ * loads it into the mapping of attributes >+ * >+ * @param element the element to read the map attribute from >+ * @throws CoreException if the element has an invalid format >+ */ > protected void setMapAttribute(Element element) throws CoreException { >- String mapKey = element.getAttribute("key"); //$NON-NLS-1$ >+ String mapKey = element.getAttribute(KEY); > NodeList nodeList = element.getChildNodes(); > int entryCount = nodeList.getLength(); > Map map = new HashMap(entryCount); >+ Node node = null; >+ Element selement = null; > for (int i = 0; i < entryCount; i++) { >- Node node = nodeList.item(i); >- short type = node.getNodeType(); >- if (type == Node.ELEMENT_NODE) { >- Element subElement = (Element) node; >- String nodeName = subElement.getNodeName(); >- if (!nodeName.equalsIgnoreCase("mapEntry")) { //$NON-NLS-1$ >+ node = nodeList.item(i); >+ if (node.getNodeType() == Node.ELEMENT_NODE) { >+ selement = (Element) node; >+ if (!selement.getNodeName().equalsIgnoreCase(MAP_ENTRY)) { > throw getInvalidFormatDebugException(); > } >- String key = getKeyAttribute(subElement); >- String value = getValueAttribute(subElement); >- map.put(key, value); >+ map.put(getKeyAttribute(selement), getValueAttribute(selement)); > } > } > setAttribute(mapKey, map); > } > >+ /** >+ * Returns the <code>String</code> representation of the 'key' attribute from the specified element >+ * @param element the element to read from >+ * @return the value >+ * @throws CoreException >+ */ > protected String getKeyAttribute(Element element) throws CoreException { >- String key = element.getAttribute("key"); //$NON-NLS-1$ >+ String key = element.getAttribute(KEY); > if (key == null) { > throw getInvalidFormatDebugException(); > } > return key; > } > >+ /** >+ * Returns the <code>String</code> representation of the 'value' attribute from the specified element >+ * @param element the element to read from >+ * @return the value >+ * @throws CoreException >+ */ > protected String getValueAttribute(Element element) throws CoreException { >- String value = element.getAttribute("value"); //$NON-NLS-1$ >+ String value = element.getAttribute(VALUE); > if (value == null) { > throw getInvalidFormatDebugException(); > } > return value; > } > >+ /** >+ * Returns an invalid format exception for reuse >+ * @return an invalid format exception >+ */ > protected DebugException getInvalidFormatDebugException() { > return > new DebugException( >@@ -521,8 +693,9 @@ > } > > /** >- * Two <code>LaunchConfigurationInfo</code> objects are equal if and only if they have the >- * same type and they have the same set of attributes with the same values. >+ * Two <code>LaunchConfigurationInfo</code> objects are equal if and only >+ * if they have the same type and they have the same set of attributes with >+ * the same values. > * > * @see Object#equals(Object) > */ >@@ -544,10 +717,10 @@ > } > > /** >- * Returns whether the two attribute maps are equal, consulting >- * registered comparator extensions. >+ * Returns whether the two attribute maps are equal, consulting registered >+ * comparator extensions. > * >- * @param map1 attribute map >+ * @param map1 attribute map > * @param map2 attribute map > * @return whether the two attribute maps are equal > */ >@@ -566,8 +739,12 @@ > if (comp == null) { > if (fgIsSun14x) { > if(attr2 instanceof String & attr1 instanceof String) { >- //this is a hack for bug 110215, on SUN 1.4.x, \r is stripped off when the stream is written to the DOM >- //this is not the case for 1.5.x, so to be safe we are stripping \r off all strings before we compare for equality >+ // this is a hack for bug 110215, on SUN 1.4.x, \r >+ // is stripped off when the stream is written to the >+ // DOM >+ // this is not the case for 1.5.x, so to be safe we >+ // are stripping \r off all strings before we >+ // compare for equality > attr1 = ((String)attr1).replaceAll("\\r", ""); //$NON-NLS-1$ //$NON-NLS-2$ > attr2 = ((String)attr2).replaceAll("\\r", ""); //$NON-NLS-1$ //$NON-NLS-2$ > } >Index: schema/launchModes.exsd >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/schema/launchModes.exsd,v >retrieving revision 1.9 >diff -u -r1.9 launchModes.exsd >--- schema/launchModes.exsd 25 Jan 2006 21:52:43 -0000 1.9 >+++ schema/launchModes.exsd 13 Oct 2006 17:50:06 -0000 >@@ -1,134 +1,120 @@ >-<?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 "run", "debug", and "profile". >- </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 "run", "debug", and "profile". >- </documentation> >- </annotation> >- </attribute> >- <attribute name="label" type="string" use="required"> >- <annotation> >- <documentation> >- A human-readable label that describes the launch mode >- </documentation> >- <appInfo> >- <meta.attribute translatable="true"/> >- </appInfo> >- </annotation> >- </attribute> >- <attribute name="launchAsLabel" type="string"> >- <annotation> >- <documentation> >- A human-readable label to be used in a launch cascade menu. For example "Run As". This attribute was added in 3.2 to allow the label to be properly externalized. When unspecified, a default label is created via concatenation. >- </documentation> >- <appInfo> >- <meta.attribute translatable="true"/> >- </appInfo> >- </annotation> >- </attribute> >- </complexType> >- </element> >- >- <annotation> >- <appInfo> >- <meta.section type="since"/> >- </appInfo> >- <documentation> >- 3.0 >- </documentation> >- </annotation> >- >- <annotation> >- <appInfo> >- <meta.section type="examples"/> >- </appInfo> >- <documentation> >- The following is an example of a launch delegate extension point: >- >-<p> >-<pre> >- <extension point="org.eclipse.debug.core.launchModes"> >- <launchMode >- mode="profile" >- label="Profile"> >- </launchMode> >- </extension> >-</pre> >-</p> >- >-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> >- Copyright (c) 2000, 2005 IBM Corporation and others.<br> >-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 >-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> >- </documentation> >- </annotation> >- >-</schema> >+<?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 "run", "debug", and "profile". >+ </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> >+ </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 "run", "debug", and "profile". >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="label" type="string" use="required"> >+ <annotation> >+ <documentation> >+ A human-readable label that describes the launch mode >+ </documentation> >+ <appInfo> >+ <meta.attribute translatable="true"/> >+ </appInfo> >+ </annotation> >+ </attribute> >+ <attribute name="launchAsLabel" type="string"> >+ <annotation> >+ <documentation> >+ A human-readable label to be used in a launch cascade menu. For example "Run As". This attribute was added in 3.2 to allow the label to be properly externalized. When unspecified, a default label is created via concatenation. >+ </documentation> >+ <appInfo> >+ <meta.attribute translatable="true"/> >+ </appInfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="since"/> >+ </appInfo> >+ <documentation> >+ 3.0 >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="examples"/> >+ </appInfo> >+ <documentation> >+ The following is an example of a launch delegate extension point: >+ >+<p> >+<pre> >+ <extension point="org.eclipse.debug.core.launchModes"> >+ <launchMode >+ mode="profile" >+ label="Profile"> >+ </launchMode> >+ </extension> >+</pre> >+</p> >+ >+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> >+ Copyright (c) 2000, 2005 IBM Corporation and others.<br> >+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 >+<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> >+ </documentation> >+ </annotation> >+ >+</schema> >Index: schema/launchConfigurationTypes.exsd >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/schema/launchConfigurationTypes.exsd,v >retrieving revision 1.15 >diff -u -r1.15 launchConfigurationTypes.exsd >--- schema/launchConfigurationTypes.exsd 9 Dec 2005 15:55:03 -0000 1.15 >+++ schema/launchConfigurationTypes.exsd 13 Oct 2006 17:50:06 -0000 >@@ -60,22 +60,42 @@ > </documentation> > </annotation> > </attribute> >- <attribute name="delegate" type="string" use="required"> >+ <attribute name="delegate" type="string"> > <annotation> > <documentation> > specifies the fully qualified name of the Java class that implements <code>ILaunchConfigurationDelegate</code>. > Launch configuration instances of this type will delegate to instances of this class to perform launching. >+ >+With new API changes for 3.3M3 the delegate should be contributed via the <code>launchDelegates</code> extension point >+<p> >+<strong>EXPERIMENTAL</strong>. This attribute has been deprecated 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> > </documentation> > <appInfo> >- <meta.attribute kind="java" basedOn="org.eclipse.debug.core.model.ILaunchConfigurationDelegate"/> >+ <meta.attribute kind="java" basedOn="org.eclipse.debug.core.model.ILaunchConfigurationDelegate" deprecated="true"/> > </appInfo> > </annotation> > </attribute> >- <attribute name="modes" type="string" use="required"> >+ <attribute name="modes" type="string"> > <annotation> > <documentation> > specifies a comma-separated list of the modes this type of lauch configuration supports - "run" and/or "debug". >+ >+With new API changes for 3.3M3 the delegate should be contributed via the <code>launchDelegates</code> extension point >+ >+<p> >+<strong>EXPERIMENTAL</strong>. This attribute has been deprecated 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> > </documentation> >+ <appInfo> >+ <meta.attribute deprecated="true"/> >+ </appInfo> > </annotation> > </attribute> > <attribute name="name" type="string" use="required"> >@@ -106,6 +126,8 @@ > <annotation> > <documentation> > The unique identifier of a sourcePathComputer extension that is used to compute a default source lookup path for launch configurations of this type. This atttribute was added in the 3.0 release. >+ >+With new API changes for 3.3M3 the sourcePathComputer id should be contributed via the <code>launchDelegates</code> extension point > </documentation> > </annotation> > </attribute> >@@ -113,6 +135,8 @@ > <annotation> > <documentation> > The unique identifier of a sourceLocator extension that is used to create the source locator for sessions launched using launch configurations of this type. This atttribute was added in the 3.0 release. >+ >+With new API changes for 3.3M3 the sourceLocatorId id should be contributed via the <code>launchDelegates</code> extension point > </documentation> > </annotation> > </attribute> >@@ -126,6 +150,25 @@ > </appInfo> > </annotation> > </attribute> >+ <attribute name="icon" type="string"> >+ <annotation> >+ <documentation> >+ The id of the icon for this launch configuraiton type. >+ >+since 3.3 >+ >+<p> >+<strong>EXPERIMENTAL</strong>. This element has been added as >+part of a work in progress. There is no guarantee that this API will >+remain unchanged during the 3.3 release cycle. Please do not use this API >+without consulting with the Platform/Debug team. >+</p> >+ </documentation> >+ <appInfo> >+ <meta.attribute kind="resource"/> >+ </appInfo> >+ </annotation> >+ </attribute> > </complexType> > </element> > >Index: schema/launchOptions.exsd >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/schema/launchOptions.exsd,v >retrieving revision 1.2 >diff -u -r1.2 launchOptions.exsd >--- schema/launchOptions.exsd 14 Sep 2006 17:37:41 -0000 1.2 >+++ schema/launchOptions.exsd 13 Oct 2006 17:50:06 -0000 >@@ -8,6 +8,11 @@ > <documentation> > This extension point is used to contribute launch options to the launch manager. > Launch options are used as modifiers when executing a launch configuration. >+ >+<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> > </documentation> > </annotation> > >@@ -67,13 +72,6 @@ > </documentation> > </annotation> > </attribute> >- <attribute name="option" type="string" use="required"> >- <annotation> >- <documentation> >- the name of the option itself, described as one word all lowercase e.g. debug >- </documentation> >- </annotation> >- </attribute> > </complexType> > </element> > >@@ -101,7 +99,7 @@ > </launchOption> > </extension> > </pre> >-</p> >+</p> > </documentation> > </annotation> > >@@ -128,7 +126,7 @@ > <meta.section type="copyright"/> > </appInfo> > <documentation> >- Copyright (c) 2003, 2005 IBM Corporation and others.<br> >+ Copyright (c) 2006 IBM Corporation and others.<br> > 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 >Index: schema/launchDelegates.exsd >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/schema/launchDelegates.exsd,v >retrieving revision 1.9 >diff -u -r1.9 launchDelegates.exsd >--- schema/launchDelegates.exsd 13 Sep 2006 19:09:07 -0000 1.9 >+++ schema/launchDelegates.exsd 13 Oct 2006 17:50:06 -0000 >@@ -1,155 +1,207 @@ >-<?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 modes. Since launch modes are extensible, it may be neccessary to contribute additional launch delegates to an existing launch configuration type. Each launch delegate is contributed for a specific launch configuration type. A launch delegate supports one or more launch modes, and specifies a delegate responsible for the implementation of launching. >- </documentation> >- </annotation> >- >- <element name="extension"> >- <complexType> >- <sequence> >- <element ref="launchDelegate" minOccurs="1" 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 <code>ILaunchConfigurationDelegate</code>. >-Launch configuration instances of this delegate'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> >- <attribute name="sourcePathComputerId" type="string"> >- <annotation> >- <documentation> >- The unique identifier of a sourcePathComputer extension that is used to compute a default source lookup path for launch configurations of this type. Since 3.1, this attribute cab be specified in a launchDelegate extension when unspecified in the assocaited launchConfigurationType extension. Only one source path computer can be specified per launch configuration type. >- </documentation> >- </annotation> >- </attribute> >- <attribute name="sourceLocatorId" type="string"> >- <annotation> >- <documentation> >- The unique identifier of a sourceLocator extension that is used to create the source locator for sessions launched using launch configurations of this type. Since 3.1, this attribute can be specified in a launchDelegate extension when unspecified in the assocaited launchConfigurationType extension. Only one source locater can be specified per launch configuration type. >- </documentation> >- </annotation> >- </attribute> >- </complexType> >- </element> >- >- <annotation> >- <appInfo> >- <meta.section type="since"/> >- </appInfo> >- <documentation> >- 3.0 >- </documentation> >- </annotation> >- >- <annotation> >- <appInfo> >- <meta.section type="examples"/> >- </appInfo> >- <documentation> >- The following is an example of a launch delegate extension point: >- >-<p> >-<pre> >- <extension point="org.eclipse.debug.core.launchDelegates"> >- <launchDelegate >- id="com.example.ExampleProfileDelegate" >- delegate="com.example.ExampleProfileDelegate" >- type="org.eclipse.jdt.launching.localJavaApplication" >- modes="profile"> >- </launchDelegate> >- </extension> >-</pre> >-</p> >- >-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 <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>. >- </documentation> >- </annotation> >- >- <annotation> >- <appInfo> >- <meta.section type="copyright"/> >- </appInfo> >- <documentation> >- Copyright (c) 2000, 2005 IBM Corporation and others.<br> >-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 >-<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> >- </documentation> >- </annotation> >- >-</schema> >+<?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 modes. Since launch modes are extensible, it may be neccessary to contribute additional launch delegates to an existing launch configuration type. Each launch delegate is contributed for a specific launch configuration type. A launch delegate supports one or more launch modes, and specifies a delegate responsible for the implementation of launching. >+ </documentation> >+ </annotation> >+ >+ <element name="extension"> >+ <complexType> >+ <sequence> >+ <element ref="launchDelegate" minOccurs="1" 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 minOccurs="0" maxOccurs="unbounded"> >+ </sequence> >+ <attribute name="id" type="string" use="required"> >+ <annotation> >+ <documentation> >+ specifies a unique identifier for this launch delegate. >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="name" type="string"> >+ <annotation> >+ <documentation> >+ specifies a human readable name for this delegate >+ >+since 3.3M3 >+ >+<p> >+<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> >+ </documentation> >+ <appInfo> >+ <meta.attribute translatable="true"/> >+ </appInfo> >+ </annotation> >+ </attribute> >+ <attribute name="delegate" type="string" use="required"> >+ <annotation> >+ <documentation> >+ specifies the fully qualified name of the Java class that implements <code>ILaunchConfigurationDelegate</code>. >+Launch configuration instances of this delegate'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"> >+ <annotation> >+ <documentation> >+ specifies a comma-separated list of the modes this lauch delegate supports. >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="type" type="string"> >+ <annotation> >+ <documentation> >+ identifier of an existing launch configuration type that this launch delegate is capable of launching. >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="sourcePathComputerId" type="string"> >+ <annotation> >+ <documentation> >+ The unique identifier of a sourcePathComputer extension that is used to compute a default source lookup path for launch configurations of this type. Since 3.1, this attribute cab be specified in a launchDelegate extension when unspecified in the assocaited launchConfigurationType extension. Only one source path computer can be specified per launch configuration type. >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="sourceLocatorId" type="string"> >+ <annotation> >+ <documentation> >+ The unique identifier of a sourceLocator extension that is used to create the source locator for sessions launched using launch configurations of this type. Since 3.1, this attribute can be specified in a launchDelegate extension when unspecified in the assocaited launchConfigurationType extension. Only one source locater can be specified per launch configuration type. >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="options" type="string"> >+ <annotation> >+ <documentation> >+ This attribute allows contributors to sepcify what options this delegate can apply to other than the specified modes >+ >+since 3.3M3 >+ >+<p> >+<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> >+ </documentation> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="since"/> >+ </appInfo> >+ <documentation> >+ 3.0 >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="examples"/> >+ </appInfo> >+ <documentation> >+ The following is an example of a launch delegate extension point: >+ >+<p> >+<pre> >+ <extension point="org.eclipse.debug.core.launchDelegates"> >+ <launchDelegate >+ id="com.example.ExampleProfileDelegate" >+ delegate="com.example.ExampleProfileDelegate" >+ type="org.eclipse.jdt.launching.localJavaApplication" >+ modes="profile"> >+ </launchDelegate> >+ </extension> >+</pre> >+</p> >+ >+In the example above, the specified launch delegate is contributed to launch Java applications in profile mode. >+ >+The previous example has been deprecated as of 3.3M3, but left in for brevity. See the following example for new usage. >+ >+<p> >+<pre> >+<extension point="org.eclipse.debug.core.launchDelegates"> >+ <launchDelegate >+ delegate="org.eclipse.jdt.launching.JavaLaunchDelegate" >+ id="org.eclipse.jdt.launching.JavaLaunchDelegate" >+ type="org.eclipse.jdt.launching.localJavaApplication" >+ modes="profile"> >+ </launchDelegate> >+ </extension> >+</pre> >+</p> >+ >+In 3.3 mode-based launching has been deprecated, and in its place we have provided launching with options. Options are contributed via the <code>launchOptions</code> 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> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="apiInfo"/> >+ </appInfo> >+ <documentation> >+ 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>. >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="copyright"/> >+ </appInfo> >+ <documentation> >+ Copyright (c) 2000, 2005 IBM Corporation and others.<br> >+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 >+<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> >+ </documentation> >+ </annotation> >+ >+</schema> >Index: buildnotes_platform-debug.html >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/buildnotes_platform-debug.html,v >retrieving revision 1.1641 >diff -u -r1.1641 buildnotes_platform-debug.html >--- buildnotes_platform-debug.html 26 Sep 2006 17:00:18 -0000 1.1641 >+++ buildnotes_platform-debug.html 13 Oct 2006 17:50:05 -0000 >@@ -20,13 +20,44 @@ > <li>deprecated <code>IDebugUIConstants.ATTR_CONSOLE_ENCODING</code>.</li> > <li>added <code>DebugUITools.getLastLaunch(String id)</code> - provides access to the last launch in > each launch group.</li> >- <li>Add <code>launchOptions</code> schema -- provides a new mechanism for providing launch options to the launching framework</li> >- <li>Added <code>ILaunchOption</code> -- which describes a single contributed launch option within the launch manager</li> >- <li>Added <code>ILaunchManager.getLaunchOptions()</code> -- returns and array of all of the <code>ILaunchOptions</code> registered with the launch manager</li> >- <li>Added <code>ILaunchManager.getLaunchOption(String id)</code> -- returns the <code>ILaunchOption</code> associated with the given unique id, or <code>null</code></li> > </ul> > >-<h2>Oct 3, 2006</h2> >+<h2>Summary of Launch Option conversion changes in 3.3</h2> >+<ul> >+<li>Added <code>launchOptions</code> schema -- provides a new mechanism for providing launch options to the launching framework</li> >+ <li>Added interface/class <code>ILaunchOption</code> -- which describes a single contributed launch option within the launch manager</li> >+ <li>Added method <code>ILaunchManager.getLaunchOptions()</code> -- returns and array of all of the <code>ILaunchOptions</code> registered with the launch manager</li> >+ <li>Added method <code>ILaunchManager.getLaunchOption(String id)</code> -- returns the <code>ILaunchOption</code> associated with the given unique id, or <code>null</code></li> >+ <li>Added interface/class <code>ILaunchOption</code> -- which describes a single contributed launch option within the launch manager</li> >+ <li>Added method <code>ILaunchConfiguration.getOptions()</code> -- returns the comma seperated listiong of options</li> >+ <li>Added method <code>ILaunchConfigurationWorkingCopy.setOptions(String[] options)</code> -- allows the options to be set in the launch configuration</li> >+ <li>Added method <code>ILaunchManager.getLaunchDelegates()</code> -- returns all of the registered launch delegates</li> >+ <li>Added method <code>ILaunchManager.getLaunchDelegates(String typeid, String mode, String[] options)</code> -- returns the >+ list of delegates that apply to the the specifed mode, config type id and options (if any)</li> >+ <li>Added constant <code>ATTR_LAUNCH_OPTIONS</code> to <code>LaunchConfiguration</code></li> >+ <li>Added method <code>ILaunchConfigurationType.getContributorName()</code> -- returns the name of the contributor of the type</li> >+ <li>Added method <code>ILaunchConfigurationType.getImageDescriptorPath()</code> -- returns the path of the image descriptor (if provided)</li> >+ <li>Added method <code>ILaunchConfigurationType.getDelegate(String mode, String[] options)</code> -- returns the launch delegate for the specified mode and options</li> >+ <li>Added class <code>ConfigurationElementConstants</code> -- contains common constants for getting child elements of <code>IConfigurationElements</code> >+ <li>Added internal method <code>LaunchManager.initializeLaunchDelegates()</code> -- loads the listing of delegates</li> >+ <li>Added internal method <code>LaunchManager.initializeLaunchOptions()</code> -- loads the listing of launch options</li> >+ <li>Deprecated method <code>ILaunchConfigurationType.getDelegate(String mode)</code> -- in favour of the new <code>getDelegate(String mode, String[] options) method</code></li> >+ <li>Deprecated attribute 'delegate' in <code>launchConfigurationTypes</code> schema, in favour of contributing delegates via the <code>launchDelegates</code> extension point</li> >+ <li>Deprecated attribute 'modes' in <code>launchConfigurationTypes</code> schema, in favour of contributing modes via the <code>launchDelegates</code> extension point</li> >+ <li>Deprecated attribute 'sourcePathComputerId' in <code>launchConfigurationTypes</code> schema, in favour of contributing it via the <code>launchDelegates</code> extension point</li> >+ <li>Deprecated attribute 'sourceLocatorId' in <code>launchConfigurationTypes</code> schema, in favour of contributing it via the <code>launchDelegates</code> extension point</li> >+ <li>Added attrbute 'icon' in <code>launchConfigurationTypes</code> schema, in favour of contributing a seperate extension <code>launchConfigurationTypeImages</code></li> >+ <li>Added attribute 'name' to the <code>launchDelegates</code> schema, providing a human readable name for the delegate. To be used in duplicate resolution</li> >+ <li>Added attribute 'options' to the <code>launchDelegates</code> schema, providing the ability to specify launch options that this delegate can support</li> >+ <li>Added interface/class <code>ILaunchConfigurationTabExtension</code> -- provides a proxy to a contributed tab <code>IConfigurationElement</code> element</li> >+ <li>Added internal method <code>LauncConfigurationPtresentationManager.initializeContributedTabExtensions</code> -- loads contributed tabs</li> >+ <li>Added method <code>LaunchConfigurationPresentationManager.createContributedTabs(String groupid)</code> -- lazily creates the tabs for a specified tabgroup id</li> >+ <li>Added constant <code>EXTENSION_POINT_CONTRIBUTED_LAUNCH_TABS</code> to <code>IDebugUIConstants</code></li> >+ <li>Added class <code>LaunchConfigurationTabGroupWrapper</code> -- which is used to wrap an existing tab group with its contributed tabs</li> >+ <li>Deprecated <code>launchConfigurationTypeImages</code> extension point</li> >+</ul> >+ >+h2>Oct 3, 2006</h2> > <h3>Problem Reports Fixed</h3> > <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=158760">158760</a>: Warning in latest nightly build and integration build<br> > >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/plugin.xml,v >retrieving revision 1.65 >diff -u -r1.65 plugin.xml >--- plugin.xml 13 Sep 2006 19:09:07 -0000 1.65 >+++ plugin.xml 13 Oct 2006 17:50:05 -0000 >@@ -164,9 +164,8 @@ > <extension > point="org.eclipse.debug.core.launchOptions"> > <launchOption >- id="org.eclipse.debug.core.debug" >- label="Debug" >- option="debug"> >+ id="debug" >+ label="Debug"> > </launchOption> > </extension> > >Index: core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java >=================================================================== >RCS file: core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java >diff -N core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,118 @@ >+/******************************************************************************* >+ * 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; >+ >+/** >+ * This interface provides a repository for the names of <code>IConfigurationElement</code> child node ids. >+ * @since 3.3 >+ */ >+public interface IConfigurationElementConstants { >+ >+ /** >+ * The id node name for a configuration element >+ */ >+ public static final String ID = "id"; //$NON-NLS-1$ >+ >+ /** >+ * the name node name for a configuration element >+ */ >+ public static final String NAME = "name"; //$NON-NLS-1$ >+ >+ /** >+ * the category node name for a configuration element >+ */ >+ public static final String CATEGORY = "category"; //$NON-NLS-1$ >+ >+ /** >+ * the launchMode node name for a configuration element >+ */ >+ public static final String LAUNCH_MODE = "launchMode"; //$NON-NLS-1$ >+ >+ /** >+ * the label node name for a configuration element >+ */ >+ public static final String LABEL = "label"; //$NON-NLS-1$ >+ >+ /** >+ * the description node name for a configuration element >+ */ >+ public static final String DESCRIPTION = "description"; //$NON-NLS-1$ >+ >+ /** >+ * the helpContextId node name for a configuration element >+ */ >+ public static final String HELP_CONTEXT_ID = "helpContextId"; //$NON-NLS-1$ >+ >+ /** >+ * the icon node name for a configuration element >+ */ >+ public static final String ICON = "icon"; //$NON-NLS-1$ >+ >+ /** >+ * the public node name for a configuration element >+ */ >+ public static final String PUBLIC = "public"; //$NON-NLS-1$ >+ >+ /** >+ * the perspective node name for a configuration element >+ */ >+ public static final String PERSPECTIVE = "perspective"; //$NON-NLS-1$ >+ >+ /** >+ * the modes node name for a configuration element >+ */ >+ public static final String MODES = "modes"; //$NON-NLS-1$ >+ >+ /** >+ * the mode node name for a configuration element >+ */ >+ public static final String MODE = "mode"; //$NON-NLS-1$ >+ >+ /** >+ * the type node name for a configuration element >+ */ >+ public static final String TYPE = "type"; //$NON-NLS-1$ >+ >+ /** >+ * the option node name for a configuration element >+ */ >+ public static final String OPTIONS = "options"; //$NON-NLS-1$ >+ >+ /** >+ * the delegate node name for a configuration element >+ */ >+ public static final String DELEGATE = "delegate"; //$NON-NLS-1$ >+ >+ /** >+ * the group node name for a configuration element >+ */ >+ public static final String GROUP = "group"; //$NON-NLS-1$ >+ >+ /** >+ * the class node name for a configuration element >+ */ >+ public static final String CLASS = "class"; //$NON-NLS-1$ >+ >+ /** >+ * the sourcePathComputerId node name for a configuration element >+ */ >+ public static final String SOURCE_PATH_COMPUTER = "sourcePathComputerId"; //$NON-NLS-1$ >+ >+ /** >+ * the sourceLocatorId node name for a configuration element >+ */ >+ public static final String SOURCE_LOCATOR = "sourceLocatorId"; //$NON-NLS-1$ >+ >+ /** >+ * the migrationDelegate node name for a configuration element >+ */ >+ public static final String MIGRATION_DELEGATE = "migrationDelegate"; //$NON-NLS-1$ >+} >Index: core/org/eclipse/debug/internal/core/LaunchDelegate.java >=================================================================== >RCS file: core/org/eclipse/debug/internal/core/LaunchDelegate.java >diff -N core/org/eclipse/debug/internal/core/LaunchDelegate.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ core/org/eclipse/debug/internal/core/LaunchDelegate.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,190 @@ >+/******************************************************************************* >+ * 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 java.util.HashSet; >+import java.util.Set; >+ >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IConfigurationElement; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Status; >+import org.eclipse.debug.core.DebugPlugin; >+import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; >+ >+import com.ibm.icu.text.MessageFormat; >+ >+/** >+ * Proxy to a launch delegate extension >+ * Clients can contribute launch delegates through the <code>launchDelegates</code> extension point >+ * >+ * Example contribution of the local java launch delegate >+ * <pre> >+ * <extension point="org.eclipse.debug.core.launchDelegates"> >+ <launchDelegate >+ delegate="org.eclipse.jdt.launching.JavaLaunchDelegate" >+ id="org.eclipse.jdt.launching.localJavaApplicationDelegate" >+ modes="run, debug" >+ name="%localJavaApplication" >+ type="org.eclipse.jdt.launching.localJavaApplication"> >+ </launchDelegate> >+ * </pre> >+ * >+ * Clients are NOT intended to subclass this class >+ * >+ * @since 3.3 >+ */ >+public final class LaunchDelegate { >+ >+ /** >+ * The configuration element for this delegate >+ */ >+ private IConfigurationElement fElement = null; >+ >+ /** >+ * The cached delegate. Remains null until asked for, then persisted >+ */ >+ private ILaunchConfigurationDelegate fDelegate = null; >+ >+ //lists of cached entries >+ private HashSet fModes = null; >+ private HashSet fOptions = null; >+ private String fType = null; >+ >+ /** >+ * Constructor >+ * @param element the configuration element to associate with this launch delegate >+ */ >+ public LaunchDelegate(IConfigurationElement element) { >+ fElement = element; >+ } >+ >+ /** >+ * Returns the actual instance of the launch delegate specified >+ * @return the launch delegate >+ */ >+ public ILaunchConfigurationDelegate getDelegate() throws CoreException { >+ if(fDelegate == null) { >+ Object obj = fElement.createExecutableExtension(IConfigurationElementConstants.DELEGATE); >+ if(obj instanceof ILaunchConfigurationDelegate) { >+ return (ILaunchConfigurationDelegate)obj; >+ } >+ 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; >+ } >+ >+ /** >+ * @return returns the unique id of the delegate >+ */ >+ public String getIdentifier() { >+ return fElement.getAttribute(IConfigurationElementConstants.ID); >+ } >+ >+ /** >+ * Returns the id of the associated <code>ILaunchConfigurationType</code> or <code>null</code> if none provided >+ * @return the id of the <code>ILaunchConfigurationType</code> associated with this delegate >+ */ >+ public String getLaunchConfigurationType() { >+ if(fType == null) { >+ //fall back to single association if no appliesTo >+ fType = fElement.getAttribute(IConfigurationElementConstants.TYPE); >+ if(fType == null) { >+ //the case when we have passed a launch configuration type to the launch delegate >+ fType = fElement.getAttribute(IConfigurationElementConstants.ID); >+ } >+ } >+ return fType; >+ } >+ >+ /** >+ * Returns the set of options provided to by this delegate >+ * @return the options associated with this delegate. If no options are specified an empty set is >+ * returned, never <code>null</code>. >+ */ >+ public Set getOptions() { >+ if(fOptions == null) { >+ fOptions = new HashSet(); >+ String option = fElement.getAttribute(IConfigurationElementConstants.OPTIONS); >+ if(option != null) { >+ String[] options = option.split(","); //$NON-NLS-1$ >+ for(int i = 0; i < options.length; i++) { >+ fOptions.add(options[i].trim()); >+ } >+ } >+ } >+ return fOptions; >+ } >+ >+ /** >+ * This method is provided as a backward compatibility measure to allow access to modes, if mode-based >+ * launching is still being used. >+ * >+ * @return a set of modes for this delegate or the empty set if none are found, never <code>null</code>. >+ */ >+ public Set getModes() { >+ if (fModes == null) { >+ fModes = new HashSet(); >+ String modes = fElement.getAttribute(IConfigurationElementConstants.MODES); >+ if (modes != null) { >+ String[] strings = modes.split(","); //$NON-NLS-1$ >+ for (int i = 0; i < strings.length; i++) { >+ fModes.add(strings[i].trim()); >+ } >+ } >+ } >+ return fModes; >+ } >+ >+ /** >+ * Returns the human readable name for this launch delegate >+ * @return the human readable name for this launch delegate, or <code>null</code> if none >+ */ >+ public String getName() { >+ return fElement.getAttribute(IConfigurationElementConstants.NAME); >+ } >+ >+ /** >+ * Returns the associated source locator id or <code>null</code> >+ * @return the associated source locator id or <code>null</code> if not provided >+ */ >+ public String getSourceLocatorId() { >+ return fElement.getAttribute(IConfigurationElementConstants.SOURCE_LOCATOR); >+ } >+ >+ /** >+ * Returns the associated source path computer id or <code>null</code> >+ * @return the associated source path computer id or <code>null</code> if not provided >+ */ >+ public String getSourcePathComputerId() { >+ return fElement.getAttribute(IConfigurationElementConstants.SOURCE_PATH_COMPUTER); >+ } >+ >+ /** >+ * 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 >+ */ >+ public boolean appliesTo(String configtypeId) { >+ return getLaunchConfigurationType().equals(configtypeId); >+ } >+ >+ /** >+ * 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 >+ */ >+ public boolean appliesTo(String configtypeId, String mode) { >+ return getLaunchConfigurationType().equals(configtypeId) & getModes().contains(mode); >+ } >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 157059
:
50306
|
50933
|
51706
|
51719
|
51935
|
51964
|
52144
|
52498
|
52620
|
53657
|
54555
|
54562
|
54584