Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Define a "Run As" submenus on method level(Eclipse RCP)
Define a "Run As" submenus on method level [message #1840782] Fri, 23 April 2021 15:21 Go to next message
surfspider surfspider is currently offline surfspider surfspiderFriend
Messages: 3
Registered: July 2020
Junior Member
How can I define a submenu for "Run As" in the Package Explorer View on Java / Groovy method level (i.e. for a single JUnit Test Case method). If I declare it as "launchShortcut" I can only see the submenu in the package explorer on class/file level (not on method level). see: https://www.eclipse.org/forums/index.php/t/172141/
Re: Define a "Run As" submenus on method level [message #1840827 is a reply to message #1840782] Mon, 26 April 2021 08:40 Go to previous messageGo to next message
Rolf Theunissen is currently offline Rolf TheunissenFriend
Messages: 260
Registered: April 2012
Senior Member
This stack overflow entry could be helpful for you: https://stackoverflow.com/questions/10592493/how-do-i-use-org-eclipse-debug-ui-launchshortcuts
Re: Define a "Run As" submenus on method level [message #1840882 is a reply to message #1840827] Wed, 28 April 2021 07:13 Go to previous messageGo to next message
surfspider surfspider is currently offline surfspider surfspiderFriend
Messages: 3
Registered: July 2020
Junior Member
Thank you for your answer. This way I can see the submenu for the "Run as" and "Debug as" launcher on class/file level but not on method level. How can I achieve this?
Re: Define a "Run As" submenus on method level [message #1840972 is a reply to message #1840882] Thu, 29 April 2021 15:04 Go to previous message
Rolf Theunissen is currently offline Rolf TheunissenFriend
Messages: 260
Registered: April 2012
Senior Member
Never used it myself in this context, but it should be possible to use the selection to adapt to an Java element. For full documentation of the extension point, check this:
https://help.eclipse.org/2021-03/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fextension-points%2Forg_eclipse_debug_ui_launchShortcuts.html

To get some inspiration on how the adapt can be used in your case, check the JDT Junit configuration:
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.junit/plugin.xml#n233

I guess that you need to adapt to IJavaElement or one of its sub-interfaces.
https://help.eclipse.org/2021-03/index.jsp?topic=%2Forg.eclipse.jdt.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fjdt%2Fcore%2FIJavaElement.html
Previous Topic:setEditorAreaVisible(false) ignored when switching between perspectives
Next Topic:Defining position of menu item in Project Explorer context menu
Goto Forum:
  


Current Time: Thu Dec 05 01:05:16 GMT 2024

Powered by FUDForum. Page generated in 0.03391 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top