Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » context menu visibleWhen package selected and nature correspond
context menu visibleWhen package selected and nature correspond [message #1403031] Sun, 20 July 2014 11:00
Eclipse UserFriend
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
Previous Topic:windowBuilder freeze
Next Topic:An internal error occurred during: Building JPA Project:
Goto Forum:
  


Current Time: Thu Feb 13 14:07:33 GMT 2025

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

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

Back to the top