context menu visibleWhen package selected and nature correspond [message #1403031] |
Sun, 20 July 2014 11:00 |
Eclipse User |
|
|
|
Hello guys,
I am working on a eclipse plugin and I would like to add some specials items to context menu.
I would like to do this :
When user right click on a package in project explorer -> if the project containing this package has nature "MyNature" AND selection is a package -> then display the custom menu. Else not.
I wrote this :
<visibleWhen>
<and>
<with variable="activeMenuSelection">
<iterate>
<test property="org.eclipse.core.resources.projectNature" value="com.sbeex.plugin.eclipse.sbeexNature" />
<or>
<adapt type="org.eclipse.jdt.core.IJavaProject"/>
<adapt type="org.eclipse.jdt.core.IPackageFragment"/>
</or>
</iterate>
</with>
</and>
</visibleWhen>
It doesnt show any more. And if I remove "<test property="org.eclipse.core.resources.projectNature" value="com.sbeex.plugin.eclipse.sbeexNature" />" the menu appears. If I remove the part <or> ... </or> menu appear only in project right click
Do you have some tips about how to do it ?
Thanks in advance for your attention
Cheers,
Sebastien
|
|
|
Powered by
FUDForum. Page generated in 0.03394 seconds