| Summary: | [Contributions] menus/commands added to popup:org.eclipse.ui.popup.any show up when they shouldnt | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Amy Wu <for.work.things> |
| Component: | UI | Assignee: | Paul Webster <pwebster> |
| Status: | RESOLVED INVALID | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | pwebster |
| Version: | 3.4 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
For legacy reasons, iterate returns true when the collection is empty and the iterate operator == and (the default). There should be an attribute that you can set to get your desired behaviour, iterate ifEmpty="false" would probably do it. PW Oh yeah, ifEmpty="false" did the trick. Thanks! You can go ahead and resolve this as invalid (I would, but I didn't know if you wanted a target milestone or not) Also, I'm not sure if you'd want to update http://wiki.eclipse.org/Menu_Contributions/IFile_objectContribution or not with that ifEmpty attribute (that's what I was referencing when I was trying to do mine) I've updated the wiki as well, Thanx, PW |
Using 3.4 m6. I'm not sure if this is really an issue with the menu/popup extension point or with the expression framework, but if I contribute a menu like the following, MySubMenu will show up in the popup menu even when I have nothing selected. You can see this by selecting nothing in the Project/Package explorer and invoking the context menu. You can also see this menu in views like the Javadoc view. <extension point="org.eclipse.ui.menus"> <menuContribution locationURI="popup:org.eclipse.ui.popup.any?after=additions"> <menu id="mySubMenu" label="MySubMenu"> <command commandId="org.eclipse.ui.help.aboutAction" style="push"> <visibleWhen checkEnabled="false"> <or> <iterate> <adapt type="org.eclipse.core.resources.IContainer"> <test property="org.eclipse.core.resources.name" value="*.xml"/> </adapt> </iterate> <iterate> <adapt type="org.eclipse.core.resources.IFile"> <test property="org.eclipse.core.resources.name" value="*.xml"/> </adapt> </iterate> </or> </visibleWhen> </command> </menu> </menuContribution> </extension>