Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Adding new items to the source menu
Adding new items to the source menu [message #255653] Thu, 14 August 2008 13:42 Go to next message
Mateusz Matela is currently offline Mateusz MatelaFriend
Messages: 3
Registered: July 2009
Junior Member
Hello,

I'm creating a plugin that should add an item to the source menu. I
managed to add it to main menu, editor context menu and appropriate
context menus in package explorer. (Actually, there's a problem with
ordering - my item is added at the bottom of its group in main menu and at
the top in context menu - so if you have an idea how to fix this, it would
be great).

My main question is how to add an item to the menu that shows up after
pressing Alt+Shift+S (it's called quick menu, I guess?)

Here's my plugin.xml file for reference:

<extension point="org.eclipse.ui.popupMenus">

<!-- java editor context menu -->
<viewerContribution
id="org.gsoc.eclipse.tostringgenerator.popupMenu"
targetID="#CompilationUnitEditorContext">
<action
label="Generate to&amp;String()..."
menubarPath="org.eclipse.jdt.ui.source.menu/generateGroup"
class=" org.gsoc.eclipse.tostringgenerator.actions.GenerateToStringA ctionDelegate "
id="org.gsoc.eclipse.tostringgenerator.action">
</action>
</viewerContribution>

<!-- class context menu -->
<objectContribution
adaptable="false"
id="org.gsoc.eclipse.tostringgenerator.ITypeObjectContribution "
objectClass="org.eclipse.jdt.core.IType">
<action
class=" org.gsoc.eclipse.tostringgenerator.actions.GenerateToStringA ctionDelegate "
id="org.gsoc.eclipse.tostringgenerator.action"
label="Generate to&amp;String()..."
menubarPath="org.eclipse.jdt.ui.source.menu/generateGroup">
</action>
</objectContribution>

<!-- java file context menu -->
<objectContribution
adaptable="false"
id=" org.gsoc.eclipse.tostringgenerator.ICompilationUnitContribut ion "
objectClass="org.eclipse.jdt.core.ICompilationUnit">
<action
class=" org.gsoc.eclipse.tostringgenerator.actions.GenerateToStringA ctionDelegate "
id="org.gsoc.eclipse.tostringgenerator.action"
label="Generate to&amp;String()..."
menubarPath="org.eclipse.jdt.ui.source.menu/generateGroup">
</action>
</objectContribution>
</extension>

<!-- main menu -->
<extension
point="org.eclipse.ui.actionSets">
<actionSet
label="Java Coding"
description="Action set containing coding related Java actions"
visible="true"
id="org.eclipse.jdt.ui.CodingActionSet2">
<menu
label="&amp;Source"
path="edit"
id="org.eclipse.jdt.ui.source.menu">
</menu>
<action
class=" org.gsoc.eclipse.tostringgenerator.actions.GenerateToStringA ctionDelegate "
id="org.gsoc.eclipse.tostringgenerator.action"
label="Generate to&amp;String()..."
menubarPath="org.eclipse.jdt.ui.source.menu/generateGroup">
</action>
</actionSet>
</extension>
Re: Adding new items to the source menu [message #641097 is a reply to message #255653] Wed, 24 November 2010 09:26 Go to previous message
大漠苍狼 is currently offline 大漠苍狼Friend
Messages: 1
Registered: November 2010
Junior Member
Very Happy hello .
I have the same question for you!
Did you have solved this problem ?please help me !
Previous Topic:jar export issues
Next Topic:Problem with editor screen.
Goto Forum:
  


Current Time: Sun Dec 21 16:04:07 GMT 2014

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

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