|
|
|
|
|
|
|
|
Re: Enable/Disable menu item in eclipse plugin [message #895301 is a reply to message #895298] |
Thu, 12 July 2012 12:07 |
becks m Messages: 59 Registered: June 2012 |
Member |
|
|
Yes, I did register the tree viewer as the selection provider.
I don't know what you mean by enablewhen clause
but this is the part from plugin.xml if it could help
<extension
point="org.eclipse.ui.handlers">
<handler
class="copycmd"
commandId="copycmd">
<enabledWhen>
<with
variable="selection">
<and>
<count
value="1">
</count>
<iterate
ifEmpty="false"
operator="and">
<instanceof
value="document">
</instanceof>
</iterate>
</and>
</with>
</enabledWhen>
</handler>
</extension>
The menu item I want to enable or disable has dynamic menu items that show up or now show up according to selection of certain tree items in the tree.
so, the behavior is:
When I do right click on item of incorrect type I get the copy menu enabled ! but when I do click on it, it gets disabled!
and for the correct type , if the copy menu is disabled from the first selection m it gets enabled when I do click on the copy menu.
This is weird behavior.
[Updated on: Thu, 12 July 2012 12:08] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03967 seconds