Hide ActionSets in a Plug-In [message #466732] |
Tue, 24 April 2007 11:32 |
Eclipse User |
|
|
|
Originally posted by: reto.huber.alabus.com
Hi
I have an Eclipse-Plugin, which provides me a menu to call all the different
build files. For this the "org.eclipse.ui.actionSet" extension point is
used. Now I would like to hide (not disable) some actions depending on my
project settings. I have already read about the function
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().hideActionSet( "ActionSetId")
but I don't know where to call it. The suggestion was in
WorkbenchWindowAdvisor#postWindowOpen() but I couldn't find such a method or
class in my plug-in. Is there an other way to do It? Or does somebody know
how I can get and extend the WorkbenchWindowAdvisor? I'm grateful for every
hint.
Kindest Regards,
Reto
|
|
|
Re: Hide ActionSets in a Plug-In [message #466840 is a reply to message #466732] |
Wed, 25 April 2007 16:25 |
Eclipse User |
|
|
|
Originally posted by: reto.huber.alabus.com
I have found a solution. I'll put my code to the "init" method of my
"org.eclipse.ui.actions.ActionDelegate" extension. Probably there is a
better solution but I'm not that familiar with rcp. So if you have a proper
one, please post it.
Thanks,
Reto
/**
* @see
org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclip se.ui.IWorkbenchWindow)
*/
public void init(IWorkbenchWindow window) {
this.window = window;
IWorkbenchPage actPage =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage();
if(isSpecialPluginProject()) {
actPage.showActionSet("com.company.project.tools.buildutility.actionsets ");
} else {
actPage.hideActionSet("com.company.project.tools.buildutility.actionsets ");
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.02684 seconds