Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 54072 - [java launching] Provide API to extend launch shortcuts with different modes
Summary: [java launching] Provide API to extend launch shortcuts with different modes
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.4 M2   Edit
Assignee: Darin Wright CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 61361 127590 170233 (view as bug list)
Depends on:
Blocks: 126584
  Show dependency tree
 
Reported: 2004-03-08 14:24 EST by Curtis d'Entremont CLA
Modified: 2007-09-07 15:05 EDT (History)
9 users (show)

See Also:


Attachments
first run (43.62 KB, patch)
2007-08-30 14:44 EDT, Michael Rennie CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis d'Entremont CLA 2004-03-08 14:24:29 EST
(See #53736 for the history behind this)

Currently, it is not possible to extend your launch shortcuts to add another 
mode without using internal JDT API. The launch shortcuts themselves are 
internal, and they also have internal dependencies. Duplicating the entire 
internal dependency tree is just not feasible.

I would like to request that some API be provided in order to extend your 
launch shortcuts. Perhaps one way to do this is to make the launch shortcuts 
themselves public? Or, make the immediate (first-level) dependencies public.
Comment 1 Darin Wright CLA 2004-03-18 10:21:50 EST
Deferred. In the meantime, I suggest subclassing the internal actions. Post 
3.0, we can look at moving these actions to API.
Comment 2 Curtis d'Entremont CLA 2004-04-14 10:41:48 EDT
Another extensibility problem here is the list of perspectives a shortcut 
should appear in. Consider the scenario where I create a new perspective, and I 
want to have the run/debug toolbar launch buttons. The only way I can get the 
launch shortcuts to show up in my perspective is to redefine them in my 
plugin.xml.
Comment 3 Darin Wright CLA 2006-05-12 12:52:43 EDT
*** Bug 61361 has been marked as a duplicate of this bug. ***
Comment 4 amehrega CLA 2007-05-02 11:40:18 EDT
The only two internal APIs required by TPTP are:
org.eclipse.jdt.internal.debug.ui.launcher.JavaAppletLaunchShortcut
org.eclipse.jdt.internal.debug.ui.launcher.JavaApplicationLaunchShortcut
Comment 5 Darin Wright CLA 2007-06-13 13:18:24 EDT
*** Bug 127590 has been marked as a duplicate of this bug. ***
Comment 6 Darin Wright CLA 2007-06-13 13:19:17 EDT
*** Bug 170233 has been marked as a duplicate of this bug. ***
Comment 7 Darin Wright CLA 2007-08-24 17:20:52 EDT
Re-opening
Comment 8 Eugene Chan CLA 2007-08-24 17:28:51 EDT
TPTP still have the following dependencies on JDT internal code.

plugins/org.eclipse.hyades.trace.ui/src/org/eclipse/hyades/trace/ui/internal/launcher/ProfileJavaAppletShortcut.java:
 	- it extends org.eclipse.jdt.internal.debug.ui.launcher.JavaAppletLaunchShortcut;
	+ within this class, following methods are called:
	  - getConfigurationType()
	  - findLaunchConfiguration(type, configType)
	  - chooseType(types, mode)
	  - chooseConfiguration(configList)
	  - createConfiguration(type))

plugins/org.eclipse.hyades.trace.ui/src/org/eclipse/hyades/trace/ui/internal/launcher/ProfileJavaApplicationShortcut.java:
	- it extends org.eclipse.jdt.internal.debug.ui.launcher.JavaApplicationLaunchShortcut;
	+ within this class, following methods are called:
	  - getConfigurationType()
	  - findLaunchConfiguration(type, configType)
	  - chooseConfiguration(configList)
	  - createConfiguration(type))
	
Comment 9 Michael Rennie CLA 2007-08-30 14:44:04 EDT
Created attachment 77400 [details]
first run

This patch provides 3 classes as new API, provided in the package org.eclipse.jdt.debug.ui.launcher.

1. JavaLaunchShortcut the abstract parent class of the two shortcuts in question (in the event contributors want base java functionality for their new shortcut(s))

2. JavaApplicationLaunchShortcut, jdt.debug's implementation for java application launching

3. JavaAppletLaunchShortcut, jdt.debug's implementaiton for java applet launching

Methods exposed through new API

1. getConfigurationType()
2. createConfiguration(IType type)
3. chooseType(IType[] types, String title)
4. findTypes(Object[] elements, IRunnableContext context)
5. getTypeSelectionTitle()
6. getEditorEmptyMessage()
7. getSelectionEmptyMessage()
8. findLaunchConfiguration(IType type, ILaunchConfigurationType configType)
9. chooseConfiguration(List configList)

This review patch does not include documentation updates

Eugene, could review the patch to see if all of TPTP's API requirements would be satisfied with this implementation?
Comment 10 Eugene Chan CLA 2007-08-30 17:38:14 EDT
Thanks Michael, The patch looks good to me. Could you also make getShell() protected?

Comment 11 Michael Rennie CLA 2007-09-07 11:47:01 EDT
released to HEAD adding in the getShell() method.
Comment 12 Michael Rennie CLA 2007-09-07 11:47:47 EDT
please verify Darin W
Comment 13 Darin Wright CLA 2007-09-07 15:05:45 EDT
Verified. Moved the classes to the existing package org.eclipse.jdt.debug.ui.launchConfigurations to avoid adding a new API package. Updated javadoc and changed 'findLaunchConfiguration' to only find existing configurations rather than create a new one.