|Can't get menu item with handler working properly [message #335787]
||Wed, 29 April 2009 16:31
| Jeff Johnston
Registered: July 2009
I'm trying to move some code using ActionSets to the newer ui menus, |
commands, and handlers but it isn't going well.
First of all, I have a menu item I want to add to
menu:project?after=additions. I specify checkEnabled true so it won't be
visible when not enabled.
I have a command "Run Command" set up.
I try and set up a handler. What I want is to have the handler
active/enabled whenever an IResource is selected that is part of a project
with projectNature=X. I tried the iterate operator and with test for
org.eclipse.core.resources.projectNature of X, but I couldn't get this to
So I backed off and tried a simpler check for my handler so it is both
count = 1
This allows me to see my menu item if it is the project or a folder within
a C/C++ project and I can click on the menu item and have it execute
The problem is that I can only click on it once. The next time I bring up
the Project menu, it is gone whether I select the project or folder, even
if it just worked previously. My handler code is hardcoded to return true
for isenabled() and ishandled() and returns null from execute() as
specified in the docs.
Can anybody suggest how I should do this based on my original desired
behavior and/or why the menu item disappears after the first click? There
are no errors in the error log. I am using Eclipse 3.4.1.