|Dynamically enable Action [message #1229444]
||Thu, 09 January 2014 08:08
| Andreas Weise
Registered: January 2014
I have an Action incl. ActionHandler on a ListProperty, that is displayed next to the AddButton of that List.|
Now the Action needs to be enabled depending on:
1. the selection of an item in the list (like the Delete button is only enabled when an item is selected)
2. the value of a property in the model.
I override the org.eclipse.sapphire.ui.SapphireActionSystemPart.isEnabled() method in my action handler, but that is only evaluated the first time the editor open. Also a refresh() of the model element (that contains the action) does not refresh the enabled state.
I also tried adding a Condition inside the action handler, but the evaluate() method is also only invoked when the editor opens, and not upon refresh() of the model element.
Is their a way to manipulate the action at runtime dynamically?
For programming against the selection of the table, I think I require access to the presentation (more specifically TablePropertyEditorPresentation). Is that correct? If yes, is it possible to get the presentation from a SapphirePart object?
Thanks you in advance.
Powered by FUDForum
. Page generated in 0.02049 seconds