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 51719 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]
patch
reivew-launch-options-20061010.patch (text/plain), 68.16 KB, created by
Darin Wright
on 2006-10-10 15:31:59 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Darin Wright
Created:
2006-10-10 15:31:59 EDT
Size:
68.16 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.debug.core >Index: core/org/eclipse/debug/internal/core/ConfigurationElementConstants.java >=================================================================== >RCS file: core/org/eclipse/debug/internal/core/ConfigurationElementConstants.java >diff -N core/org/eclipse/debug/internal/core/ConfigurationElementConstants.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ core/org/eclipse/debug/internal/core/ConfigurationElementConstants.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,119 @@ >+/******************************************************************************* >+ * 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 class provides a repository for the names of <code>IConfigurationElement</code> child node ids. >+ * @since 3.3 >+ * <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> >+ */ >+public class ConfigurationElementConstants { >+ >+ /** >+ * 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 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/core/ILaunchDelegate.java >=================================================================== >RCS file: core/org/eclipse/debug/core/ILaunchDelegate.java >diff -N core/org/eclipse/debug/core/ILaunchDelegate.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ core/org/eclipse/debug/core/ILaunchDelegate.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,97 @@ >+/******************************************************************************* >+ * Copyright (c) 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.debug.core; >+ >+import java.util.Set; >+ >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; >+ >+/** >+ * This interface describes a launch delegate >+ * Clients can contribute launch delegate through the <code>launchDelegates</code> extension point >+ * >+ * Example contribution of the local java launch delegate >+ * <pre> >+ * <launchDelegate >+ delegate="org.eclipse.jdt.launching.JavaLaunchDelegate" >+ id="org.eclipse.jdt.launching.JavaLaunchDelegate"> >+ <appliesTo >+ type="org.eclipse.jdt.launching.localJavaApplication"> >+ <option >+ option="debug"> >+ </option> >+ </appliesTo> >+ </launchDelegate> >+ * </pre> >+ * >+ * Clients are NOT intended to implement this interface >+ * @since 3.3 >+ */ >+public interface ILaunchDelegate { >+ >+ /** >+ * @return returns the unique id of the delegate >+ */ >+ public String getIdentifier(); >+ >+ /** >+ * @return the launch delegate >+ */ >+ public ILaunchConfigurationDelegate getDelegate() throws CoreException; >+ >+ /** >+ * One delegate definition can now be associated with more than on launch configuration type. >+ * In this case we need to return them all. In the deprecated case when one delegate is associated >+ * with one type, we only need return the one (a set of only one element) >+ * @return the set of associated launch configuration type ids (String) or the empty set, never <code>null</code> >+ */ >+ public String getLaunchConfigurationType(); >+ >+ /** >+ * @return the associated source locator id or <code>null</code> if not provided >+ */ >+ public String getSourceLocatorId(); >+ >+ /** >+ * @return the associated source path computer id or <code>null</code> if not provided >+ */ >+ public String getSourcePathComputerId(); >+ >+ /** >+ * @return the options associated with this delegate. If no options are specified an empty set is >+ * returned, never <code>null</code>. >+ */ >+ public Set getOptions(); >+ >+ /** >+ * 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(); >+ >+ /** >+ * used to determine 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); >+ >+ /** >+ * used to determine 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); >+} >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,154 @@ >+/******************************************************************************* >+ * 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.ILaunchDelegate; >+import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; >+ >+import com.ibm.icu.text.MessageFormat; >+ >+/** >+ * Proxy to a launch delegate extension >+ * >+ * @since 3.3 >+ */ >+public class LaunchDelegate implements ILaunchDelegate { >+ >+ /** >+ * 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; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.core.ILaunchDelegate#getDelegate() >+ */ >+ public ILaunchConfigurationDelegate getDelegate() throws CoreException { >+ if(fDelegate == null) { >+ Object obj = fElement.createExecutableExtension(ConfigurationElementConstants.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; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.core.ILaunchDelegate#getIdentifier() >+ */ >+ public String getIdentifier() { >+ return fElement.getAttribute(ConfigurationElementConstants.ID); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.core.ILaunchDelegate#getLaunchConfigurationType() >+ */ >+ public String getLaunchConfigurationType() { >+ if(fType == null) { >+ //fall back to single association if no appliesTo >+ fType = fElement.getAttribute(ConfigurationElementConstants.TYPE); >+ if(fType == null) { >+ //the case when we have passed a launch configuration type to the launch delegate >+ fType = fElement.getAttribute(ConfigurationElementConstants.ID); >+ } >+ } >+ return fType; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.core.ILaunchDelegate#getOptions() >+ */ >+ public Set getOptions() { >+ if(fOptions == null) { >+ fOptions = new HashSet(); >+ String option = fElement.getAttribute(ConfigurationElementConstants.OPTIONS); >+ if(option != null) { >+ String[] options = option.split(","); //$NON-NLS-1$ >+ for(int i = 0; i < options.length; i++) { >+ fOptions.add(options[i]); >+ } >+ } >+ } >+ return fOptions; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.core.ILaunchDelegate#getModes() >+ */ >+ public Set getModes() { >+ if (fModes == null) { >+ fModes = new HashSet(); >+ String modes = fElement.getAttribute(ConfigurationElementConstants.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; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.core.ILaunchDelegate#getSourceLocatorId() >+ */ >+ public String getSourceLocatorId() { >+ return fElement.getAttribute(ConfigurationElementConstants.SOURCE_LOCATOR); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.core.ILaunchDelegate#getSourcePathComputerId() >+ */ >+ public String getSourcePathComputerId() { >+ return fElement.getAttribute(ConfigurationElementConstants.SOURCE_PATH_COMPUTER); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.core.ILaunchDelegate#appliesTo(java.lang.String) >+ */ >+ public boolean appliesTo(String configtypeId) { >+ return getLaunchConfigurationType().equals(configtypeId); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.core.ILaunchDelegate#appliesTo(java.lang.String, java.lang.String) >+ */ >+ public boolean appliesTo(String configtypeId, String mode) { >+ return getLaunchConfigurationType().equals(configtypeId) & getModes().contains(mode); >+ } >+ >+} >#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 10 Oct 2006 19:31:54 -0000 >@@ -27,31 +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"> >+ > > </launchConfigurationType> > </extension> > <extension >@@ -189,5 +180,35 @@ > 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" >+ sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector" >+ sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer" >+ 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" >+ sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector" >+ sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer" >+ 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" >+ sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector" >+ sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer" >+ type="org.eclipse.jdt.launching.javaApplet"> >+ </launchDelegate> > </extension> > </plugin> >#P org.eclipse.debug.ui >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 10 Oct 2006 19:31:56 -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 10 Oct 2006 19:31:56 -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 >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 10 Oct 2006 19:31:56 -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 when the image resides in a different plug-in than the launch configruation type extension. >+ </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> >@@ -59,6 +50,8 @@ > <annotation> > <documentation> > specifies the plugin-relative path of an image file. >+ >+<br>Since 3.3 an image can be specified in the launch configuration type definition. > </documentation> > <appInfo> > <meta.attribute kind="resource"/> >@@ -77,24 +70,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/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 10 Oct 2006 19:31:56 -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.ConfigurationElementConstants; > 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(ConfigurationElementConstants.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 10 Oct 2006 19:31:57 -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/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 10 Oct 2006 19:31:57 -0000 >@@ -18,6 +18,7 @@ > > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IConfigurationElement; >+import org.eclipse.debug.internal.core.ConfigurationElementConstants; > 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(ConfigurationElementConstants.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(ConfigurationElementConstants.MODE); > fModes.add(mode); >- String perspective = element.getAttribute("perspective"); //$NON-NLS-1$ >+ perspective = element.getAttribute(ConfigurationElementConstants.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(ConfigurationElementConstants.TYPE); > } > > /** >@@ -139,7 +143,17 @@ > * @since 2.1 > */ > protected String getHelpContextId() { >- return getConfigurationElement().getAttribute("helpContextId"); //$NON-NLS-1$ >+ return getConfigurationElement().getAttribute(ConfigurationElementConstants.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(ConfigurationElementConstants.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(ConfigurationElementConstants.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(ConfigurationElementConstants.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(ConfigurationElementConstants.DESCRIPTION); > } > } > } > if (description == null){ >- description = fConfig.getAttribute("description"); //$NON-NLS-1$ >+ description = fConfig.getAttribute(ConfigurationElementConstants.DESCRIPTION); > } > > if (description == 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 10 Oct 2006 19:31:57 -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/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 10 Oct 2006 19:31:57 -0000 >@@ -11,6 +11,8 @@ > package org.eclipse.debug.internal.ui.launchConfigurations; > > >+import java.util.List; >+ > import org.eclipse.core.resources.IResource; > import org.eclipse.core.resources.ResourcesPlugin; > import org.eclipse.core.runtime.CoreException; >@@ -958,9 +960,40 @@ > return false; > } > } >+ > return true; > } > >+ >+ /** >+ * <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(); >+ if(wc != null) { >+ List options = wc.getOptions(); >+ if(options.size() > 0) { >+ return 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. > */ >@@ -988,6 +1021,7 @@ > return message; > } > >+ //EXPERIMENTAL > ILaunchConfigurationTab[] allTabs = getTabs(); > for (int i = 0; i < allTabs.length; i++) { > ILaunchConfigurationTab tab = allTabs[i]; >@@ -1004,6 +1038,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/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 10 Oct 2006 19:31:57 -0000 >@@ -46,12 +46,16 @@ > 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_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? >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 10 Oct 2006 19:31:57 -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.ConfigurationElementConstants; > 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(ConfigurationElementConstants.ID), mode); > return (extension != null ? extension.getDescription(mode) : null); > } > >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 10 Oct 2006 19:31:57 -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/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 10 Oct 2006 19:31:57 -0000 >@@ -88,6 +88,14 @@ > 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_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; >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 10 Oct 2006 19:31:57 -0000 >@@ -927,6 +927,21 @@ > public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_TAB_GROUPS= "launchConfigurationTabGroups"; //$NON-NLS-1$ > > /** >+ * Launch configuration tabs extension point identifier >+ * (value <code>"launchConfigurationTabs"</code>). >+ * >+ * <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: 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/ui/ILaunchConfigurationTabExtension.java >=================================================================== >RCS file: ui/org/eclipse/debug/ui/ILaunchConfigurationTabExtension.java >diff -N ui/org/eclipse/debug/ui/ILaunchConfigurationTabExtension.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/debug/ui/ILaunchConfigurationTabExtension.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,50 @@ >+/******************************************************************************* >+ * 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; >+ >+/** >+ * Describes a contributed launch configuration tab >+ * >+ * <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 interface ILaunchConfigurationTabExtension { >+ >+ /** >+ * 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(); >+ >+ /** >+ * Returns the unique id ofthe tab >+ * @return the unique id of the tab >+ */ >+ public String getIdentifier(); >+ >+ /** >+ * 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(); >+ >+ /** >+ * Returns the instantiated class of this tab >+ * @return the instantiated class of this tab >+ */ >+ public ILaunchConfigurationTab getTab(); >+ >+} >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,79 @@ >+/******************************************************************************* >+ * 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.ConfigurationElementConstants; >+import org.eclipse.debug.ui.ILaunchConfigurationTabExtension; >+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 class LaunchConfigurationTabExtension implements ILaunchConfigurationTabExtension { >+ >+ /** >+ * 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; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.ui.IContributedLaunchConfigurationTab#getIdentifier() >+ */ >+ public String getIdentifier() { >+ return fElement.getAttribute(ConfigurationElementConstants.ID); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.ui.IContributedLaunchConfigurationTab#getName() >+ */ >+ public String getName() { >+ return fElement.getAttribute(ConfigurationElementConstants.NAME); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.ui.IContributedLaunchConfigurationTab#getTab() >+ */ >+ public ILaunchConfigurationTab getTab() { >+ try { >+ Object object = fElement.createExecutableExtension(ConfigurationElementConstants.CLASS); >+ if(object instanceof ILaunchConfigurationTab) { >+ return (ILaunchConfigurationTab) object; >+ } >+ } catch (CoreException e) {DebugUIPlugin.log(e);} >+ return null; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.ui.IContributedLaunchConfigurationTab#getTabGroupId() >+ */ >+ public String getTabGroupId() { >+ return fElement.getAttribute(ConfigurationElementConstants.GROUP); >+ } >+ >+}
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