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 52498 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
launching.txt (text/plain), 20.54 KB, created by
Michael Rennie
on 2006-10-22 20:06:23 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Michael Rennie
Created:
2006-10-22 20:06:23 EDT
Size:
20.54 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.debug.ui >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.69 >diff -u -r1.69 LaunchConfigurationTabGroupViewer.java >--- ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java 20 Oct 2006 21:57:05 -0000 1.69 >+++ ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java 23 Oct 2006 00:05:30 -0000 >@@ -1042,7 +1042,7 @@ > if(wc != null) { > Set modes = wc.getModes(); > modes.add(getLaunchConfigurationDialog().getMode()); >- return wc.getType().supportsModeCombination(modes); >+ return wc.getType().supportsModes(modes); > } > } catch (CoreException e) { > } >Index: ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java,v >retrieving revision 1.2 >diff -u -r1.2 SelectLaunchModesDialog.java >--- ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java 20 Oct 2006 21:57:05 -0000 1.2 >+++ ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java 23 Oct 2006 00:05:30 -0000 >@@ -12,6 +12,7 @@ > > import java.util.ArrayList; > import java.util.Arrays; >+import java.util.Iterator; > import java.util.List; > import java.util.Set; > >@@ -72,7 +73,7 @@ > > private CheckboxTableViewer fTableViewer = null; > private Table fTable = null; >- private List fValidCombinations; >+ private List fValidModes = null; > > /** > * Constructor >@@ -85,12 +86,13 @@ > super.setMessage(LaunchConfigurationsMessages.SelectLaunchOptionsDialog_2); > super.setTitle(LaunchConfigurationsMessages.SelectLaunchOptionsDialog_3); > setShellStyle(getShellStyle() | SWT.RESIZE); >- Set[] combinations = configuration.getType().getSupportedModeCombinations(); >- fValidCombinations = new ArrayList(); >- for (int i = 0; i < combinations.length; i++) { >- Set set = combinations[i]; >- if (set.contains(mode)) { >- fValidCombinations.add(set); >+ fValidModes = new ArrayList(); >+ Set modes = configuration.getType().getSupportedModes(); >+ Set modeset = null; >+ for(Iterator iter = modes.iterator(); iter.hasNext();) { >+ modeset = (Set) iter.next(); >+ if(modeset.contains(mode)) { >+ fValidModes.add(modeset); > } > } > } >@@ -107,7 +109,7 @@ > fTableViewer = new CheckboxTableViewer(fTable); > fTableViewer.setLabelProvider(new OptionsLabelProvider()); > fTableViewer.setContentProvider(new ArrayContentProvider()); >- fTableViewer.setInput(fValidCombinations.toArray()); >+ fTableViewer.setInput(fValidModes.toArray()); > fTableViewer.addCheckStateListener(new ICheckStateListener() { > public void checkStateChanged(CheckStateChangedEvent event) { > fTableViewer.setAllChecked(false); >#P org.eclipse.debug.core >Index: schema/launchDelegates.exsd >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/schema/launchDelegates.exsd,v >retrieving revision 1.11 >diff -u -r1.11 launchDelegates.exsd >--- schema/launchDelegates.exsd 19 Oct 2006 21:37:53 -0000 1.11 >+++ schema/launchDelegates.exsd 23 Oct 2006 00:05:32 -0000 >@@ -47,6 +47,7 @@ > </annotation> > <complexType> > <sequence minOccurs="0" maxOccurs="unbounded"> >+ <element ref="modesCombination" minOccurs="1" maxOccurs="unbounded"/> > </sequence> > <attribute name="id" type="string" use="required"> > <annotation> >@@ -88,6 +89,9 @@ > <documentation> > A comma-separated list of the launch modes this lauch delegate supports. > </documentation> >+ <appInfo> >+ <meta.attribute deprecated="true"/> >+ </appInfo> > </annotation> > </attribute> > <attribute name="type" type="string"> >@@ -128,6 +132,31 @@ > </complexType> > </element> > >+ <element name="modesCombination"> >+ <annotation> >+ <documentation> >+ This element represents a colleciton of mode combinations that this delegate can launch >+ >+since 3.3 >+ >+EXPERIMENTAL >+ </documentation> >+ </annotation> >+ <complexType> >+ <attribute name="modes" type="string" use="required"> >+ <annotation> >+ <documentation> >+ the modes attribute represent a comma seperated listing of the combination of modes that the associated delegate can launch >+ >+since 3.3 >+ >+EXPERIMENTAL >+ </documentation> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ > <annotation> > <appInfo> > <meta.section type="since"/> >@@ -159,7 +188,6 @@ > </p> > > In the example above, the specified launch delegate is contributed to launch Java applications in profile mode. The delegate supports mixed mode launching. The delegate supports profiling when launching in run or debug mode. >- > </documentation> > </annotation> > >Index: schema/launchModes.exsd >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/schema/launchModes.exsd,v >retrieving revision 1.10 >diff -u -r1.10 launchModes.exsd >--- schema/launchModes.exsd 17 Oct 2006 20:08:37 -0000 1.10 >+++ schema/launchModes.exsd 23 Oct 2006 00:05:32 -0000 >@@ -13,7 +13,7 @@ > <element name="extension"> > <complexType> > <sequence> >- <element ref="launchMode" minOccurs="0" maxOccurs="unbounded"/> >+ <element ref="launchMode" minOccurs="1" maxOccurs="unbounded"/> > </sequence> > <attribute name="point" type="string" use="required"> > <annotation> >@@ -32,8 +32,6 @@ > </appInfo> > </annotation> > <complexType> >- <sequence> >- </sequence> > <attribute name="mode" type="string" use="required"> > <annotation> > <documentation> >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.36 >diff -u -r1.36 LaunchConfigurationType.java >--- core/org/eclipse/debug/internal/core/LaunchConfigurationType.java 20 Oct 2006 21:57:17 -0000 1.36 >+++ core/org/eclipse/debug/internal/core/LaunchConfigurationType.java 23 Oct 2006 00:05:32 -0000 >@@ -147,6 +147,9 @@ > throw new CoreException(status); > } > >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.core.ILaunchConfigurationType#getDelegates(java.util.Set) >+ */ > public ILaunchDelegateProxy[] getDelegates(Set modes) throws CoreException { > initializeDelegates(); > Object[] theModes = modes.toArray(); >@@ -164,18 +167,22 @@ > return (ILaunchDelegateProxy[]) delegates.toArray(new ILaunchDelegateProxy[delegates.size()]); > } > >+ /** >+ * Initializes the listing of launch delegates for this type >+ */ > private synchronized void initializeDelegates() { > if (fDelegates == null) { > // initialize delegate > fDelegates = new Hashtable(); > LaunchDelegate[] launchDelegates = getLaunchDelegateExtensions(); >+ LaunchDelegate delegate = null; >+ List modelist = null; > for (int i = 0; i < launchDelegates.length; i++) { >- LaunchDelegate delegate = launchDelegates[i]; >- List combintaions = delegate.getModeCombinations(); >- Iterator iterator = combintaions.iterator(); >- while (iterator.hasNext()) { >- Set combination = (Set) iterator.next(); >- registerDelegate(delegate, combination); >+ delegate = launchDelegates[i]; >+ modelist = delegate.getModes(); >+ for(int j = 0; j < modelist.size(); j++) { >+ //cache the delegate based on its set of modes and delegate >+ registerDelegate(delegate, (Set) modelist.get(j)); > } > } > } >@@ -190,6 +197,11 @@ > return ((LaunchManager) DebugPlugin.getDefault().getLaunchManager()).getLaunchDelegates(getIdentifier()); > } > >+ /** >+ * Caches a delegate keyed using the set of modes that it supports >+ * @param delegate the delegate to cache >+ * @param modes the set of modes that the specified delegate supports >+ */ > private void registerDelegate(LaunchDelegate delegate, Set modes) { > List delegatesForModes = (List) fDelegates.get(modes); > if (delegatesForModes == null) { >@@ -287,15 +299,13 @@ > */ > public Set getSupportedModes() { > if(fModes == null) { >+ initializeDelegates(); > fModes = new HashSet(); >- LaunchDelegate[] delegates = getLaunchDelegateExtensions(); >- for(int i= 0; i < delegates.length; i++) { >- fModes.addAll(delegates[i].getModes()); >- } >+ fModes = fDelegates.keySet(); > } > return fModes; > } >- >+ > /** > * determines if the specified candidate is suitable for migration by loading it delegate. > * @param candidate the candidate to inspect for migration suitability >@@ -368,7 +378,17 @@ > * @see org.eclipse.debug.core.ILaunchConfigurationType#supportsMode(java.lang.String) > */ > public boolean supportsMode(String mode) { >- return getSupportedModes().contains(mode); >+ if(fModes == null) { >+ getSupportedModes(); >+ } >+ Set modes = null; >+ for(Iterator iter = fModes.iterator(); iter.hasNext();) { >+ modes = (Set) iter.next(); >+ if(modes.size() == 1 & modes.contains(mode)) { >+ return true; >+ } >+ } >+ return false; > } > > /* (non-Javadoc) >@@ -386,25 +406,13 @@ > } > > /* (non-Javadoc) >- * @see org.eclipse.debug.core.ILaunchConfigurationType#getSupportedModeCombinations() >- */ >- public Set[] getSupportedModeCombinations() { >- initializeDelegates(); >- Set combinations = fDelegates.keySet(); >- Set[] sets = (Set[])combinations.toArray(new Set[combinations.size()]); >- Set[] copy = new Set[sets.length]; >- for (int i = 0; i < copy.length; i++) { >- copy[i] = new HashSet(sets[i]); >- } >- return copy; >- } >- >- /* (non-Javadoc) > * @see org.eclipse.debug.core.ILaunchConfigurationType#supportsModeCombination(java.util.Set) > */ >- public boolean supportsModeCombination(Set modes) { >- initializeDelegates(); >- return fDelegates.containsKey(modes); >+ public boolean supportsModes(Set modes) { >+ if(fModes == null) { >+ getSupportedModes(); >+ } >+ return fModes.contains(modes); > } > > } >Index: core/org/eclipse/debug/internal/core/LaunchDelegate.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchDelegate.java,v >retrieving revision 1.3 >diff -u -r1.3 LaunchDelegate.java >--- core/org/eclipse/debug/internal/core/LaunchDelegate.java 20 Oct 2006 21:57:17 -0000 1.3 >+++ core/org/eclipse/debug/internal/core/LaunchDelegate.java 23 Oct 2006 00:05:32 -0000 >@@ -11,9 +11,7 @@ > package org.eclipse.debug.internal.core; > > import java.util.ArrayList; >-import java.util.Collection; > import java.util.HashSet; >-import java.util.Iterator; > import java.util.List; > import java.util.Set; > >@@ -59,9 +57,9 @@ > */ > private ILaunchConfigurationDelegate fDelegate = null; > >- //lists of cached entries >+ //a listing of sets of >+ private List fLaunchModes = null; > private HashSet fModes = null; >- private HashSet fOptions = null; > private String fType = null; > > /** >@@ -72,6 +70,9 @@ > fElement = element; > } > >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.core.ILaunchDelegateProxy#getDelegate() >+ */ > public ILaunchConfigurationDelegate getDelegate() throws CoreException { > if(fDelegate == null) { > Object obj = fElement.createExecutableExtension(IConfigurationElementConstants.DELEGATE); >@@ -84,6 +85,9 @@ > return fDelegate; > } > >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.core.ILaunchDelegateProxy#getId() >+ */ > public String getId() { > return fElement.getAttribute(IConfigurationElementConstants.ID); > } >@@ -103,25 +107,16 @@ > } > return fType; > } >- >- 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; >- } > >- public Set getModes() { >+ /** >+ * Parese a list of modes and creates a new set of them >+ * @param element the configuraiton element to read from >+ * @return a set of launch modes created form a comma seperated list >+ */ >+ private Set getModes(IConfigurationElement element) { > if (fModes == null) { > fModes = new HashSet(); >- String modes = fElement.getAttribute(IConfigurationElementConstants.MODES); >+ String modes = element.getAttribute(IConfigurationElementConstants.MODES); > if (modes != null) { > String[] strings = modes.split(","); //$NON-NLS-1$ > for (int i = 0; i < strings.length; i++) { >@@ -132,6 +127,34 @@ > return fModes; > } > >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.core.ILaunchDelegateProxy#getModes() >+ */ >+ public List getModes() { >+ if(fLaunchModes == null) { >+ fLaunchModes = new ArrayList(); >+ IConfigurationElement[] children = fElement.getChildren(IConfigurationElementConstants.MODES_COMBINATION); >+ for (int i = 0; i < children.length; i++) { >+ fLaunchModes.add(getModes(children[i])); >+ } >+ if(fLaunchModes.size() == 0) { >+ //try to get the modes from the old definition and make each one >+ //a seperate set of one element >+ String modes = fElement.getAttribute(IConfigurationElementConstants.MODES); >+ if (modes != null) { >+ String[] strings = modes.split(","); //$NON-NLS-1$ >+ HashSet modeset = null; >+ for (int i = 0; i < strings.length; i++) { >+ modeset = new HashSet(); >+ modeset.add(strings[i].trim()); >+ fLaunchModes.add(modeset); >+ } >+ } >+ } >+ } >+ return fLaunchModes; >+ } >+ > /** > * Returns the human readable name for this launch delegate > * @return the human readable name for this launch delegate, or <code>null</code> if none >@@ -164,55 +187,4 @@ > public String getSourcePathComputerId() { > return fElement.getAttribute(IConfigurationElementConstants.SOURCE_PATH_COMPUTER); > } >- >- /** >- * Returns all combinations of supported options. >- * >- * @return combinations of supported options >- */ >- private Collection getOptionSets() { >- Set optionSets = new HashSet(); >- optionSets.add(new HashSet()); // seed with the empty option set >- Object[] options = getOptions().toArray(); >- boolean grew = false; >- do { >- grew = false; >- Set[] sets = (Set[]) optionSets.toArray(new Set[optionSets.size()]); >- for (int i = 0; i < sets.length; i++) { >- Set optionSet = sets[i]; >- for (int j = 0; j < options.length; j++) { >- Object option = options[j]; >- Set newOptionSet = new HashSet(optionSet); >- if (newOptionSet.add(option)) { >- if (optionSets.add(newOptionSet)) { >- grew = true; >- } >- } >- } >- } >- } while (grew); >- return optionSets; >- } >- >- /** >- * Returns all supported launch mode combinations as sets of modes. >- * >- * @return all supported launch mode combinations >- */ >- List getModeCombinations() { >- Collection optionSets = getOptionSets(); >- Object[] modes = getModes().toArray(); >- List combinations = new ArrayList(optionSets.size() * modes.length); >- Iterator iterator = optionSets.iterator(); >- while (iterator.hasNext()) { >- Set optionSet = (Set) iterator.next(); >- for (int i = 0; i < modes.length; i++) { >- Object mode = modes[i]; >- Set set = new HashSet(optionSet); >- set.add(mode); >- combinations.add(set); >- } >- } >- return combinations; >- } > } >Index: core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java,v >retrieving revision 1.2 >diff -u -r1.2 IConfigurationElementConstants.java >--- core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java 20 Oct 2006 22:02:12 -0000 1.2 >+++ core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java 23 Oct 2006 00:05:32 -0000 >@@ -82,6 +82,11 @@ > public static final String MODES = "modes"; //$NON-NLS-1$ > > /** >+ * the modesCombination node name for a configuraiton element >+ */ >+ public static final String MODES_COMBINATION = "modesCombination"; //$NON-NLS-1$ >+ >+ /** > * the mode node name for a configuration element > */ > public static final String MODE = "mode"; //$NON-NLS-1$ >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.29 >diff -u -r1.29 ILaunchConfigurationType.java >--- core/org/eclipse/debug/core/ILaunchConfigurationType.java 20 Oct 2006 21:57:17 -0000 1.29 >+++ core/org/eclipse/debug/core/ILaunchConfigurationType.java 23 Oct 2006 00:05:32 -0000 >@@ -151,21 +151,6 @@ > public ILaunchDelegateProxy[] getDelegates(Set modes) throws CoreException; > > /** >- * Returns a collection of all supported launch mode combinations for >- * this launch configuration type. >- * >- * @return all supported launch mode combinations >- * @since 3.3 >- * <p> >- * <strong>EXPERIMENTAL</strong>. This method has been added as >- * part of a work in progress. There is no guarantee that this API will >- * remain unchanged during the 3.3 release cycle. Please do not use this API >- * without consulting with the Platform/Debug team. >- * </p> >- */ >- public Set[] getSupportedModeCombinations(); >- >- /** > * Returns whether this launch configuration supports the specified launch > * mode combination. > * >@@ -179,7 +164,7 @@ > * without consulting with the Platform/Debug team. > * </p> > */ >- public boolean supportsModeCombination(Set modes); >+ public boolean supportsModes(Set modes); > > /** > * Returns the unique identifier for this type of launch configuration >@@ -237,6 +222,11 @@ > * Returns all of the registered supported modes for this launch configuration type. > * This method does not return null. > * >+ * <p> >+ * The Set returned is either empty, or a set of sets where each entry is an >+ * inclusive set of individually declared mode combination entries. >+ * </p> >+ * > * @return the set of all supported modes > * @since 3.2 > */ >Index: core/org/eclipse/debug/core/ILaunchDelegateProxy.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchDelegateProxy.java,v >retrieving revision 1.1 >diff -u -r1.1 ILaunchDelegateProxy.java >--- core/org/eclipse/debug/core/ILaunchDelegateProxy.java 20 Oct 2006 21:57:17 -0000 1.1 >+++ core/org/eclipse/debug/core/ILaunchDelegateProxy.java 23 Oct 2006 00:05:32 -0000 >@@ -10,7 +10,7 @@ > *******************************************************************************/ > package org.eclipse.debug.core; > >-import java.util.Set; >+import java.util.List; > > import org.eclipse.core.runtime.CoreException; > import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; >@@ -62,18 +62,11 @@ > public ILaunchConfigurationDelegate getDelegate() throws CoreException; > > /** >- * Returns the launch modes this delegate supports. >- * >- * @return launch modes as a set of launch mode identifiers >- */ >- public Set getModes(); >- >- /** >- * Returns the launch modes this delegate supports in combination with >- * its modes specified by <code>getModes()</code>. >- * >- * @return launch options as a set of launch mode identifiers >+ * Returns the complete set of launch modes as a list of sets. >+ * If no modes are available an empty list is returned, never <code>null</code> >+ * @return the complete set of launch modes for this delegate as a list >+ * of sets > */ >- public Set getOptions(); >+ public List getModes(); > > }
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