Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Perspective and Dynamic Menu
Perspective and Dynamic Menu [message #464861] Fri, 16 March 2007 12:59 Go to next message
Eclipse UserFriend
Originally posted by: eisenman.ilog.fr

Hi,

I'm trying to achieve the following for a RCP application:
(1)- define a menu that will appear only within a given perspective
(2)- menu contents must be set dynamically (not in plugin.xml)
(3)- menu contents and perspective are defined within a plugin.

(1) is easy. I cannot get (2) to work. There are several issues:
- how to access the main menubar from the plugin?
. casting IWorkbenchWindow to WorkbenchWindow?
- how to change the menu dynamically?
. I tried using a PerspectiveListener but it is notified too early
(actions are updated later)
. I tried setting a MenuListener on the menu but with no success either

Can someone please give me an advice on how to do this?
Is the above feature supported within the new dynamic menu scheme (Eclipse
3.3)?

Thanks in advance

Michel
Re: Perspective and Dynamic Menu [message #465178 is a reply to message #464861] Sat, 24 March 2007 22:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eisenman.ilog.fr

Is there nobody to answer this question?
Thanks

Michel

>
> I'm trying to achieve the following for a RCP application:
> (1)- define a menu that will appear only within a given perspective
> (2)- menu contents must be set dynamically (not in plugin.xml)
> (3)- menu contents and perspective are defined within a plugin.
>
> (1) is easy. I cannot get (2) to work. There are several issues:
> - how to access the main menubar from the plugin?
> . casting IWorkbenchWindow to WorkbenchWindow?
> - how to change the menu dynamically?
> . I tried using a PerspectiveListener but it is notified too early
> (actions are updated later)
> . I tried setting a MenuListener on the menu but with no success either
>
> Can someone please give me an advice on how to do this?
> Is the above feature supported within the new dynamic menu scheme (Eclipse
> 3.3)?
>
> Thanks in advance
>
> Michel
>
>
Re: Perspective and Dynamic Menu [message #465590 is a reply to message #465178] Mon, 02 April 2007 18:55 Go to previous message
Matthias Roth is currently offline Matthias RothFriend
Messages: 2
Registered: July 2009
Junior Member
It is more a workaround then a solution:
make a brakepoint in your Perspective in the function
createInitialLayout.

writte down all ActionSets in the layout variable you whant to remove.

In your ApplicationWorkbenchWindowAdvisor class add the method
postWindowOpen and hide the ActionSets you do not like.

For example:


postWindowOpen(){
IWorkbenchPage page = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage();
page.hideActionSet("org.eclipse.ui.WorkingSetActionSet");
page.hideActionSet("org.eclipse.ui.edit.text.actionSet.openExternalFile ");
page.hideActionSet("org.eclipse.ui.edit.text.actionSet.annotationNavigation ");
page.hideActionSet("org.eclipse.ui.edit.text.actionSet.navigation ");
page.hideActionSet("org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo ");
page.hideActionSet("org.eclipse.ui.actionSet.keyBindings");
page.hideActionSet("org.eclipse.update.ui.softwareUpdates");
}
Previous Topic:Wierd problem with Wizard Pages calling getNextPage
Next Topic:Spring Resource Problem
Goto Forum:
  


Current Time: Thu Apr 25 22:28:35 GMT 2024

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

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

Back to the top