Issue
On the eclipse plugin that I am working on I want to add a context menu "myAction" on the Package Explorer view, just after "Delete" when you right click on a java class in the package explorer for example.
Right now I have a menuContribution, popup:
<menuContribution
allPopups="false"
locationURI="popup:org.eclipse.ui.edit?after=additions">
<command
commandId="plugin.myActionCommand"
icon="icons/myAction.gif"
style="push"
tooltip="hello">
</command>
</menuContribution>
I found this LocationURI by doing (ALT+SHIFT+F2) on "Delete" as mentioned in this post : How to add a submenu entry to Eclipse Package Explorer context menu item using org.eclipse.ui.menus? But it does not work.
My questions are : Should I use popup: or menu: in my LocationURI? Which URI is it for Package Explorer view -> (right click) Delete? And does there is now a better way than this old SO post, that could make it work?
PS : I know you could say it's duplicated BUT I am wondering if the answer is not outdated, and he didn't clearly answer the orginal question.
Solution
Context menus are popup:
menus.
The Package Explorer view context menu id is org.eclipse.jdt.ui.PackageExplorer
The group in the context menu containing 'Delete' is group.edit
.
All the above confirmed by reading the Package Explorer source code (org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart
).
So this menuContribution
adds after Delete:
<menuContribution
allPopups="false"
locationURI="popup:org.eclipse.jdt.ui.PackageExplorer?endof=group.edit">
Answered By - greg-449
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.