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.