Contributing popup menu item only for selected project nature [message #325146] |
Mon, 11 February 2008 02:49  |
Eclipse User |
|
|
|
Originally posted by: ptrinchini.quipo.it
I would contribute some commands to the pop-up menu of the project
explorer view; for this purpose I defined the following menu contribution:
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI=" popup:org.eclipse.ui.navigator.ProjectExplorer#PopupMenu?aft er=additions ">
<command
commandId="myplugin.command.mycommand"
icon="icons/etool16/mycommand.png"
label="Run mycommand"
mnemonic="M1+P"
tooltip="Do something with this project">
</command>
</menuContribution>
</extension>
this works fine, i.e. the command appears in the popup menu.
However, when I try to add a filter to have the command visible only
when a project with a given nature is selected:
<visibleWhen>
<test property="org.eclipse.core.resources.projectNature"
value="myplugin.natures.mynature">
</test>
</visibleWhen>
the command simply disappears!
This happens also for any other kind of visibleWhen filter; maybe I'm
missing something, but what?
Thanks a lot for your time reading this post
Regards,
Patrizio
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04047 seconds