Window -> Open Perspective & Show View [message #448204] |
Wed, 19 April 2006 03:47 |
Eclipse User |
|
|
|
Originally posted by: sjohnston.21technologies.com
Hey,
Is there an easy way to get the "Open Perspective" & "Show View" items
under the "Window" entry in the menu bar? I figured that these may be
pre-built items that I could just add to the menu.
Thanks,
-Stephen
|
|
|
|
Re: Window -> Open Perspective & Show View [message #448302 is a reply to message #448229] |
Thu, 20 April 2006 18:02 |
Eclipse User |
|
|
|
Originally posted by: sjohnston.21technologies.com
Awesome... worked out perfectly for me Gail.
Thanks for the help!
-Stephen
Gail Jakubowski wrote:
> In your WorkbenchAdvisor, from fillActionBars you can do this:
>
> IMenuManager menuBar = configurer.getMenuManager();
> MenuManager winMenuMgr = createWindowMenu(window);
> menuBar.add(winMenuMgr);
> menuBar.update();
>
> private MenuManager createWindowMenu(IWorkbenchWindow window)
> {
> MenuManager menu = new MenuManager("Window"),
> IWorkbenchActionConstants.M_WINDOW);
> menu.add(ActionFactory.OPEN_NEW_WINDOW.create(window));
>
> menu.add(new Separator());
> MenuManager perspectiveMenu = new MenuManager("Open Perspective"),
> "openPerspective");
> IContributionItem perspectiveList =
> ContributionItemFactory.PERSPECTIVES_SHORTLIST.create(window );
> perspectiveMenu.add(perspectiveList);
> menu.add(perspectiveMenu);
>
> MenuManager viewMenu = new MenuManager("Show View"));
> IContributionItem viewList =
> ContributionItemFactory.VIEWS_SHORTLIST.create(window);
> viewMenu.add(viewList);
> menu.add(viewMenu);
>
> menu.update();
>
> return menu;
> }
>
|
|
|
Powered by
FUDForum. Page generated in 0.03451 seconds