Eclipse - Adding A Shortcut In Navigator
From ArgeoWiki
Source: http://www.eclipseplugincentral.com/PNphpBB2-printview-t-4335-start-0.html
Plugin Design - "Run as" shortcut in the Navigator View does not a gabipetrovay - Jun 06, 2007 - 06:46 PM Post subject: "Run as" shortcut in the Navigator View does not a Hi all,
I have a plug-in project that implements an editor for a certain file type.I would like to have the lunch shortcut icon also in the popup menu in the Navigator View. I managed to make it work from the Main Menu or from the editor conntext menu.
But I don't have any Run or Debug As in the Navigator context menu.
Do I have to enable smth? (I repeat, it is working properly in the editor and in the main menu but not in the Navigator)
I use these extensions: org.eclipse.debug.ui.launchShortcuts org.eclipse.debug.ui.launchConfigurationTabGroups org.eclipse.debug.core.launchConfigurationTypes org.eclipse.debug.ui.launchConfigurationTypeImages
I implement as well the corresponding classes. For the launchShortcuts extension point, I define the enablement to be instance of java.lang.Object so I make sure this is not causing the problem.
Thanks! Gabriel Petrovay gabipetrovay - Jun 07, 2007 - 04:50 PM Post subject: RE: "Run as" shortcut in the Navigator View does n Found the problem and the solution. Looking into the code of JDT. So:
When developing a plug-in project that needs launch capabilities, when
implementing org.eclipse.debug.ui.launchShortcuts extension, the "Run As" and
"Debug As" menus are not available in the context menu of the views (Resource
Navigator, Package Explorer, etc).
There is an undocumented feature that needs to be also implemented in order to do this:
<extension point="org.eclipse.core.runtime.adapters "> <factory adaptableType="org.eclipse.core.resources.IResource" class=""> <adapter type="org.eclipse.debug.ui.actions.ILaunchable "/> </factory> </extension>
Seems like IResources that appear in the View must be tagged as ILaunchable in order to be able to get the shortcuts.
Regards! Gabriel Petrovay
