Community
Participate
Working Groups
Hello, for contributions to the context-menu the visibleWhen-filter in project-explorer behaves different than in package-explorer: Items for JavaProjects filtered by '<adapt type="org.eclipse.jdt.core.IJavaProject" />' are shown in pacakge-explorer but not in project-explorer. Here's a simple menu which you can use to see the different handling on simple- and java-projects in package-/project-explorer: <?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.4"?> <plugin> <extension point="org.eclipse.ui.commands" > <category name="MISSING MENU" id="missing.menu.category" > </category> <command id="missing.menu.MissingMenuCommand" categoryId="com.bsbanksysteme.utils.category" name="missing.menu.category" description="Test Missing Menu/Items" defaultHandler="missing.menu.MissingMenuCommand" > </command> </extension> <extension point="org.eclipse.ui.menus"> <menuContribution locationURI="popup:org.eclipse.ui.popup.any?before=additions"> <menu label="MISSING IJavaProject TEST"> <command label="menuitem always visible" commandId="missing.menu.MissingMenuCommand"> </command> <command label="visibleWhen instanceof IProject" commandId="missing.menu.MissingMenuCommand"> <visibleWhen checkEnabled="false"> <iterate ifEmpty="false"> <instanceof value="org.eclipse.core.resources.IProject" /> </iterate> </visibleWhen> </command> <command label="visibleWhen adapt IProject" commandId="missing.menu.MissingMenuCommand"> <visibleWhen checkEnabled="false"> <iterate ifEmpty="false"> <adapt type="org.eclipse.core.resources.IProject" /> </iterate> </visibleWhen> </command> <command label="visibleWhen instanceof IJavaProject" commandId="missing.menu.MissingMenuCommand"> <visibleWhen checkEnabled="false"> <iterate ifEmpty="false"> <instanceof value="org.eclipse.jdt.core.IJavaProject" /> </iterate> </visibleWhen> </command> <command label="visibleWhen adapt IJavaProject" commandId="missing.menu.MissingMenuCommand"> <visibleWhen checkEnabled="false"> <iterate ifEmpty="false"> <adapt type="org.eclipse.jdt.core.IJavaProject" /> </iterate> </visibleWhen> </command> <command label="visibleWhen javanature" commandId="missing.menu.MissingMenuCommand"> <visibleWhen checkEnabled="false"> <iterate ifEmpty="false"> <test property="org.eclipse.core.resources.projectNature" value="org.eclipse.jdt.core.javanature" /> </iterate> </visibleWhen> </command> </menu> </menuContribution> </extension> </plugin>
Created attachment 284516 [details] update of plugin.xml Trying to find a filter-expression which works in package- and project-explorer the same, I fell about another possible bug. I try to define an expression which I can use in the visibleWhen-expression of a menu-command. The expressions is.a.java.project-1 and is.a.java.project-2 (in attached plugin.xml) differ only in the order of the statements in the OR-tag. I expected them bring the same result in both explorer views - they don't. Number 1 does not show up on a java-project in package-explorer - but does in project-explorer on the same java-project.