Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Window -> Open Perspective & Show View
Window -> Open Perspective & Show View [message #448204] Wed, 19 April 2006 03:47 Go to next message
Eclipse UserFriend
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 #448229 is a reply to message #448204] Wed, 19 April 2006 13:36 Go to previous messageGo to next message
Gail Jakubowski is currently offline Gail JakubowskiFriend
Messages: 36
Registered: July 2009
Member
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;
}

--
Gail Jakubowski
Web Performance, Inc. | http://www.webperformance.com

Website Load Testing and Stress Testing Software & Services
"Stephen Johnston" <sjohnston@21technologies.com> wrote in message
news:e24bt9$2vd$1@utils.eclipse.org...
> 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 Go to previous message
Eclipse UserFriend
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;
> }
>
Previous Topic:How to set minimal view height ?
Next Topic:Application not found
Goto Forum:
  


Current Time: Fri Dec 06 23:28:19 GMT 2024

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

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

Back to the top