| Command at the wrong view active. [message #490816] |
Sun, 11 October 2009 10:10  |
Michelle Davidson Messages: 41 Registered: August 2009 |
Member |
|
|
Hello,
I have a problem with a active Handler.
I have a perspective with 3 views. On one is a tree, on one a table ane on the third some text fields.
If the view with the tree is active then 3 commands should be active and enabled. If the view with the table is active then another command shold be enabled, and the tree-commands should be disabled. And if the third View is enabled all commands should be disabled.
<extension
point="org.eclipse.ui.handlers">
<handler
class="de.rcp.command.AddPerson"
commandId="de.rcp.addPerson">
<activeWhen>
<with
variable="activePartId">
<equals
value="de.rcp.PersonTreeView">
</equals>
</with>
</activeWhen>
<enabledWhen>
<with
variable="selection">
<instanceof
value="de.rcp.model.Person">
</instanceof>
</with>
</enabledWhen>
</handler>
<handler
class="de.rcp.command.EditPersonProperties"
commandId="de.rcp.editPersonProperties">
<activeWhen>
<with
variable="activePartId">
<equals
value="de.rcp.PersonTableView">
</equals>
</with>
</activeWhen>
<enabledWhen>
<with
variable="selection">
<instanceof
value="de.rcp.model.Person">
</instanceof>
</with>
</enabledWhen>
</handler>
The problem is that the commands are active when the respective view isn´t active.
For example if PersonTreeView is active then the command EditPersonProperties is enabled. But this should be disabled for this view, And it is disabled if the PersonTableView is active.
What is my mistake and what must I change, that the commands are on the right view enabled
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01595 seconds