Problems with command expressions and enableWhen, activeWhen [message #495812] |
Fri, 06 November 2009 04:07  |
Eclipse User |
|
|
|
Hi @ll,
first of all I think I have a problem using enableWhen and activeWhen combined with commands. Maybe someone can give me a reference where I find more information when to use which of the expressions.
The concrete problem is: I have created a view which works perfectly. Now I have added a command and a key binding. The command should be always executed when ENTER is pressed.
Now I have the problem that always ENTER is pressed and the view is not active the command is executed. So I tried it with enableWhen and activeWhen that the command is only activated if the viewPart is in focus or active:
The code in XML looks as follows:
<handler
commandId="de.genesys_e.trace.ui.command.analyze">
<enabledWhen>
<with
variable="activePart">
<iterate>
<instanceof
value="de.genesys_e.trace.ui.views.AnalyzerView">
</instanceof>
</iterate>
</with>
</enabledWhen>
<activeWhen>
<with
variable="activePart">
<iterate>
<instanceof
value="de.genesys_e.trace.ui.views.AnalyzerView">
</instanceof>
</iterate>
</with>
</activeWhen>
</handler>
But it does not work. So, maybe someone can tell me what's wrong?!
Bjoern
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06906 seconds