Different command handler policy between a toolbar and a menu bar [message #605571] |
Wed, 14 April 2010 02:10 |
Eclipse User |
|
|
|
Originally posted by: edmon70.gmail.com
Hello,
I am using a Command (using AbstractHandler as parent of the handler implementation) that execute
some code for a given view. This command is accessible from the view toolbar and the main menu bar.
When the view is on focus, I would like the item of the command enabled in the main bar and disabled
when the focus in not on the view. I do that using org.eclipse.core.expressions.definitions:
<definition id="is.view.selected">
<with variable="activePartId">
<equals value="myview"/>
</with>
</definition>
However, this also disables the item in the view toolbar which I would like to keep enable all the
time. The only solution I found at the moment is to use a different command. I was wondering if
there would be a better solution. Maybe adding an or statement in the definition such as: if
itemIsInToolbar then true. Suggestions?
Thanks,
Thomas
|
|
|
Powered by
FUDForum. Page generated in 0.02624 seconds