Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Enabling and disabling actions
Enabling and disabling actions [message #460998] Wed, 03 January 2007 08:37 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: Enabling and disabling actions [message #461005 is a reply to message #461000] Wed, 03 January 2007 09:41 Go to previous message
Eclipse UserFriend
I'm sorry.

I posted it once on the eclipse forum and again in the EclipseZone forum.
I did not realize that it was actually the same forum.

C.A.
Previous Topic:Is RCP only for Desktop application not for Client Server Application
Next Topic:Problem starting Editor - no Tool tip title
Goto Forum:
  


Current Time: Tue Apr 15 02:49:44 EDT 2025

Powered by FUDForum. Page generated in 0.02102 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top