|Working with Action not enabled exception [message #535160]
||Fri, 21 May 2010 13:11
| saurav sarkar
Registered: July 2009
I have tabbed property sheets, where in i have a table viewer.I have bound few keys with the actions.
When creating the actions, i have disabled the actions.
On the selection of the table viewer the actions are enabled/disabled depending upon the logic.
All the scenario works except one.
(1) When the user first comes in and clicks ctrl-c ------> ctrl-c works and the corresponding handlers is invoked.
(2) I press ctrl-v------------> Now the paste actions is disabled and the handler is not executed.
The above scenario is not working because the selection on the table viewer is not made for the paste.
Soln> To enable the paste action after the copy action has been perfromed.
But i dont see this as a proper solution as the the copy action/service should do its own stuff.Multiple instances of the tableviewer will again give me problems.
Is there any callabacks from the command framework where i can enable/disable the action depending on the logic. like overriding the isEnabled() method of the Action.
In this case it does not work because the Actionhandler (org.eclipse.ui.commands) does not check the isEnabled() method of the action rather the hashmap entitiies of the attributes.
Any help would be hugely appreciated.
Thanks and Regards,
Powered by FUDForum
. Page generated in 0.02371 seconds