Enabling/Disabling Interdependant Actions [message #461191] |
Sat, 06 January 2007 05:54  |
Eclipse User |
|
|
|
Hello,
I've got an RCP application connecting to a JBoss server.
I want to create 2 simple actions: login and logoff.
After creating those 2 actions in the ActionBarAdvisor, I want them to be dependant on some "isLogged()" plugin method, so that I can use the Action.setEnabled(boolean)" method.
If I'm logged in, the "login" action is disabled, the "logoff" action is enabled.
If I'm logged off, the "login" action is enabled, the "logoff" action is disabled.
What's your best way to implement this?
1- Observing a system property?
2- Each action to implement IPropertyListener?
3- Some other way???
The problem is that thru the RCP registry I haven't found any way to access actions after having created them in ActionBarAdvisor.
Something like PlatformUI.getActionSet().getAction(ID) ?
I've looking for such solutions in doc, tutorials and forums but didn't found any clue.
Thanks
Fred
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03056 seconds