Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Hide ActionSets in a Plug-In
Hide ActionSets in a Plug-In [message #466732] Tue, 24 April 2007 11:32 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 ");
}
}
Previous Topic:Is it a eclipse 3.3m6 bug?
Next Topic:About RCP application
Goto Forum:
  


Current Time: Wed Apr 24 16:58:36 GMT 2024

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

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

Back to the top