Enabling and disabling actions [message #460998] |
Wed, 03 January 2007 08:37  |
Eclipse User |
|
|
|
Hi,
I am building an Eclipse RCP application using Acegi Security. After login, I need to show the actions allowed to the user in the coolbar and menus. However, I am having some trouble figuring out how to enable and disable actions.
First, I created my action as a subclass of org.eclipse.jface.action.Action and added to the Coolbar manually in the Application ActionBarAdvisor. However, I was not able to figure out the correct way of handling the enable and disable behavior.
Later, I found that I could add actions using the ActionsSet extension point. To do so, the action must implement org.eclipse.ui.IWorkbenchWindowActionDelegate. By doing this, I could define a way to enable and disable actions using the "enablement" and "visibility" elements of the action set extension point in my plugin.xml. However, this mechanism is oriented to handle enablement driven by user selection. The only two options which do not depend on user selection are "pluginState" and "systemProperty". The former does not apply to this case, and the latter seems kind of awkward for managing authorization. I am a little bit confused on how to do this in an elegant way.
Can anyone give me some ideas?
Thanks.
|
|
|
Re: Enabling and disabling actions [message #461000 is a reply to message #460998] |
Wed, 03 January 2007 08:59   |
Eclipse User |
|
|
|
Hi,
Well do you think it helps to post the same question twice within 12 hours?
Tom
Camilo Arango schrieb:
> Hi,
>
> I am building an Eclipse RCP application using Acegi Security. After login, I need to show the actions allowed to the user in the coolbar and menus. However, I am having some trouble figuring out how to enable and disable actions.
>
> First, I created my action as a subclass of org.eclipse.jface.action.Action and added to the Coolbar manually in the Application ActionBarAdvisor. However, I was not able to figure out the correct way of handling the enable and disable behavior.
>
> Later, I found that I could add actions using the ActionsSet extension point. To do so, the action must implement org.eclipse.ui.IWorkbenchWindowActionDelegate. By doing this, I could define a way to enable and disable actions using the "enablement" and "visibility" elements of the action set extension point in my plugin.xml. However, this mechanism is oriented to handle enablement driven by user selection. The only two options which do not depend on user selection are "pluginState" and "systemProperty". The former does not apply to this case, and the latter seems kind of awkward for managing authorization. I am a little bit confused on how to do this in an elegant way.
>
> Can anyone give me some ideas?
>
> Thanks.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02102 seconds