limiting context menu (popup) item visibility in ViewPart [message #662897] |
Fri, 01 April 2011 12:21 |
Tom H Messages: 139 Registered: July 2009 |
Senior Member |
|
|
Hi,
I have a popup menu showing on my treeViewer with declarative syntax like so;
<menuContribution
locationURI="popup:MyProj.rap.view.navigator?after=additions ">
<menu
label="New"
tooltip="Select new resource that you want to create for the selected item">
<command
commandId="MyProj.rap.newAccountWizard"
label="Existing Account"
style="push"
tooltip="add details for an existing account">
<visibleWhen
checkEnabled="false">
<with
variable="selection">
<iterate
ifEmpty="false"
operator="or">
<or>
<instanceof
value="accounting.impl.CompanyImpl">
</instanceof>
</or>
</iterate>
</with>
</visibleWhen>
</command>
</menu>
<command
commandId="org.eclipse.ui.views.showView"
label="test"
style="push">
</command>
</menuContribution>
However the menu shows but the command is always hidden. (if I remove the visibleWhen element and its children the command shows in the popup menu)
I just noticed from the errata on the eclipse plugins books;
http://www.qualityeclipse.com/errata.html
that for Limiting context menu item visibility;
"On page 225 at the end of section 6.2.5.1, you need to add org.eclipse.core.resources in addition to the other required plug-in mentioned."
and I understand that org.eclipse.core.resources is not available for RAP.
Is this the correct understanding, and if so what is the recommended way to limited context menu visibility.
Otherwise am I doing something stupid in the plugin.xml declaration?
Thanks
[Updated on: Fri, 01 April 2011 12:22] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02819 seconds