Search in sources :

Example 41 with IMenuManager

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);
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) Separator(org.eclipse.jface.action.Separator)

Example 42 with IMenuManager

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);
}
Also used : IMenuManager(org.eclipse.jface.action.IMenuManager) MenuManager(org.eclipse.jface.action.MenuManager)

Example 43 with IMenuManager

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);
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu) IMenuListener(org.eclipse.jface.action.IMenuListener)

Example 44 with IMenuManager

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);
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuListener(org.eclipse.jface.action.IMenuListener)

Example 45 with IMenuManager

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);
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuListener(org.eclipse.jface.action.IMenuListener)

Aggregations

IMenuManager (org.eclipse.jface.action.IMenuManager)88 MenuManager (org.eclipse.jface.action.MenuManager)72 IMenuListener (org.eclipse.jface.action.IMenuListener)48 Menu (org.eclipse.swt.widgets.Menu)43 Separator (org.eclipse.jface.action.Separator)31 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)16 IAction (org.eclipse.jface.action.IAction)9 TreeViewer (org.eclipse.jface.viewers.TreeViewer)9 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)8 GridData (org.eclipse.swt.layout.GridData)8 Action (org.eclipse.jface.action.Action)7 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)7 Composite (org.eclipse.swt.widgets.Composite)7 GridLayout (org.eclipse.swt.layout.GridLayout)6 List (java.util.List)5 ICoolBarManager (org.eclipse.jface.action.ICoolBarManager)5 FocusEvent (org.eclipse.swt.events.FocusEvent)5 ActionManager (com.cubrid.common.ui.spi.action.ActionManager)4 IContributionItem (org.eclipse.jface.action.IContributionItem)4 Point (org.eclipse.swt.graphics.Point)4