use of org.eclipse.jface.action.IMenuManager in project translationstudio8 by heartsome.
the class PortingActionProvider method addExportMenu.
private void addExportMenu(IMenuManager aMenu) {
exportWizardActionGroup.setContext(getContext());
if (exportWizardActionGroup.getWizardActionIds().length == 0) {
aMenu.appendToGroup(ICommonMenuConstants.GROUP_PORT, exportAction);
return;
}
IMenuManager submenu = new MenuManager(WorkbenchNavigatorMessages.PortingActionProvider_ExportResourcesMenu_label, COMMON_NAVIGATOR_EXPORT_MENU);
exportWizardActionGroup.fillContextMenu(submenu);
submenu.add(new Separator(ICommonMenuConstants.GROUP_ADDITIONS));
submenu.add(new Separator());
submenu.add(exportAction);
aMenu.appendToGroup(ICommonMenuConstants.GROUP_PORT, submenu);
}
use of org.eclipse.jface.action.IMenuManager in project translationstudio8 by heartsome.
the class ApplicationActionBarAdvisor method fillMenuBar.
@Override
protected void fillMenuBar(IMenuManager menuBar) {
MenuManager fileMenu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE);
menuBar.add(fileMenu);
fileMenu.add(exitAction);
MenuManager editMenu = new MenuManager("&Edit", IWorkbenchActionConstants.M_EDIT);
menuBar.add(editMenu);
editMenu.add(preferenceAction);
}
use of org.eclipse.jface.action.IMenuManager in project GT by Tencent.
the class DevicesView method createTargetContextMenu.
private void createTargetContextMenu() {
MenuManager menuMgr = new MenuManager();
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
@Override
public void menuAboutToShow(IMenuManager manager) {
DevicesView.this.fillTargetContextMenu(manager);
}
});
Menu menu = menuMgr.createContextMenu(targetPkgTableViewer.getControl());
targetPkgTableViewer.getControl().setMenu(menu);
getSite().registerContextMenu(menuMgr, targetPkgTableViewer);
}
use of org.eclipse.jface.action.IMenuManager in project dbeaver by serge-rider.
the class Spreadsheet method hookContextMenu.
private void hookContextMenu() {
MenuManager menuMgr = new MenuManager();
Menu menu = menuMgr.createContextMenu(this);
menuMgr.addMenuListener(new IMenuListener() {
@Override
public void menuAboutToShow(IMenuManager manager) {
// Let controller to provide it's own menu items
GridPos focusPos = getFocusPos();
presentation.fillContextMenu(manager, focusPos.col >= 0 && focusPos.col < columnElements.length ? columnElements[focusPos.col] : null, focusPos.row >= 0 && focusPos.row < rowElements.length ? rowElements[focusPos.row] : null);
}
});
menuMgr.setRemoveAllWhenShown(true);
super.setMenu(menu);
site.registerContextMenu(menuMgr, null);
}
use of org.eclipse.jface.action.IMenuManager in project dbeaver by serge-rider.
the class AbstractPresentation method registerContextMenu.
protected void registerContextMenu() {
// Register context menu
MenuManager menuMgr = new MenuManager();
Menu menu = menuMgr.createContextMenu(getControl());
menuMgr.addMenuListener(new IMenuListener() {
@Override
public void menuAboutToShow(IMenuManager manager) {
controller.fillContextMenu(manager, getCurrentAttribute(), controller.getCurrentRow());
}
});
menuMgr.setRemoveAllWhenShown(true);
getControl().setMenu(menu);
controller.getSite().registerContextMenu(menuMgr, null);
}
Aggregations