Is there a way to provide a static popup menu for a custom view in Eclipse Kepler? Creating a dynamic one is easy, but I would like to be able to define the commands in the
In your view part set up the context menu like this:
MenuManager contextMenu = new MenuManager();
contextMenu.setRemoveAllWhenShown(true);
Control control = viewer.getControl();
Menu menu = contextMenu.createContextMenu(control);
control.setMenu(menu);
getSite().registerContextMenu(contextMenu, viewer);
The registerContextMenu
call makes the menu available to the org.eclipse.ui.menus
extension point so you can define menu items like this:
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="popup:your view id here">
... you menu items ...