[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.newcomer] Adding perspectives menu

Hi,

how do I add a submenu for switching perspectives? The main problem I got: I use the org.eclipse.ui.menus-Extensionpoint to define my menus. Now I want to insert the ChangeToPerspectiveMenu as submenu into my menu structure.

I read about creating the perspectives menu in ApplicationActionBarAdvisor.makeActions() and add it in fillMenuBar():

protected void makeActions(final IWorkbenchWindow window) {
  this.perspectivesContributionItem =
    ContributionItemFactory.PERSPECTIVES_SHORTLIST.create(window);
}

protected void fillMenuBar(IMenuManager menuBar) {
menuBar.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
MenuManager perspectivesMenu = new MenuManager("Switch Perspectives", "perspectives");
perspectivesMenu.add(this.perspectivesContributionItem);
menuBar.add(perspectivesMenu);
}


But the perspectives menu appears now as top level menu. How do I add it as submenu into my menu structure?

Thanks