Adding new items to the source menu [message #255653] |
Thu, 14 August 2008 09:42  |
Eclipse User |
|
|
|
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&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&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&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="&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&String()..."
menubarPath="org.eclipse.jdt.ui.source.menu/generateGroup">
</action>
</actionSet>
</extension>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03920 seconds