Example usage for org.eclipse.jface.action GroupMarker GroupMarker

List of usage examples for org.eclipse.jface.action GroupMarker GroupMarker

Introduction

In this page you can find the example usage for org.eclipse.jface.action GroupMarker GroupMarker.

Prototype

public GroupMarker(String groupName) 

Source Link

Document

Create a new group marker with the given name.

Usage

From source file:msi.gama.lang.gaml.web.workbench.BasicWorkbenchActionBarAdvisor.java

License:Open Source License

/**
 * Creates the 'Collaborative' menu./*from   ww  w. ja v  a  2s .  c  om*/
 * 
 * @param window
 * @return
 */
protected IMenuManager createCollaborativeMenu(IWorkbenchWindow window) {
    IMenuManager menu = new MenuManager("Collaborative", IWorkbenchActionConstants.M_WINDOW);
    menu.add(new GroupMarker(IWorkbenchActionConstants.OPEN_EXT));
    addToMenuAndRegister(menu, ActionFactory.NEW_EDITOR.create(window));

    addToMenuAndRegister(menu, ActionFactory.REDO.create(window));
    menu.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT));
    menu.add(new Separator());
    addToMenuAndRegister(menu, ActionFactory.CUT.create(window));
    IWorkbenchAction copyAction = ActionFactory.COPY.create(window);
    addToMenuAndRegister(menu, copyAction);
    addToMenuAndRegister(menu, ActionFactory.PASTE.create(window));
    menu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));
    menu.add(new Separator());

    menu.add(new Separator());

    menu.add(new GroupMarker(IWorkbenchActionConstants.ADD_EXT));

    menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_END));
    menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    return menu;
}

From source file:msi.gama.lang.gaml.web.workbench.BasicWorkbenchActionBarAdvisor.java

License:Open Source License

/**
 * Creates the 'Tools'menu./*from w w  w . j ava  2 s  . c  o  m*/
 * 
 * @param window
 * @return
 */
protected IMenuManager createToolsMenu(IWorkbenchWindow window) {
    IMenuManager menu = new MenuManager("Tools", IWorkbenchActionConstants.M_EDIT);
    menu.add(new GroupMarker(TOOLS_START));
    return menu;
}

From source file:msi.gama.lang.gaml.web.workbench.BasicWorkbenchActionBarAdvisor.java

License:Open Source License

/**
 * Creates the 'Help' menu./* w w  w.j  a va  2  s.  c o m*/
 * 
 * @param window
 * @return
 */
protected IMenuManager createHelpMenu(IWorkbenchWindow window) {
    IMenuManager menu = new MenuManager("Help", IWorkbenchActionConstants.M_HELP);
    menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_START));
    menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_END));
    return menu;
}

From source file:net.bioclipse.cdk.jchempaint.editor.JChemPaintEditor.java

License:Open Source License

private void createMenu() {

    MenuManager menuMgr = new MenuManager();
    menuMgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    getSite().registerContextMenu("net.bioclipse.cdk.ui.editors.jchempaint", menuMgr, widget);

    menu = menuMgr.createContextMenu(widget);
    widget.setMenu(menu);//from  w ww .  j  a  va 2s.  c  o m
    widget.addMenuDetectListener(new MenuDetectListener() {

        public void menuDetected(MenuDetectEvent e) {
            IChemModelRelay chemModelRelay = widget.getControllerHub();
            RendererModel rModel = chemModelRelay.getRenderer().getRenderer2DModel();

            IAtom atom = rModel.getHighlightedAtom();
            IBond bond = rModel.getHighlightedBond();

            IChemObjectSelection localSelection = rModel.getSelection();
            IChemObject chemObject = atom != null ? atom : bond;

            if (!localSelection.contains(chemObject)) {
                if (chemObject != null)
                    localSelection = new SingleSelection<IChemObject>(chemObject);
                else
                    localSelection = AbstractSelection.EMPTY_SELECTION;
            }
            rModel.setSelection(localSelection);
            widget.setSelection(widget.getSelection());
            e.doit = true;
        }

    });

}

From source file:net.bioclipse.cdk.jchempaint.view.JChemPaintView.java

License:Open Source License

private void fillContextMenu(IMenuManager mgr) {
    mgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}

From source file:net.bioclipse.cdk.ui.sdfeditor.editor.MoleculesEditor.java

License:Open Source License

@Override
public void createPartControl(Composite parent) {

    molTableViewer = new MoleculeTableViewer(parent, SWT.NONE);
    //        molTableViewer.setContentProvider( contentProvider =
    //                                        new MoleculeViewerContentProvider() );

    //molTableViewer.setInput( getEditorInput() );
    getIndexFromInput(getEditorInput());

    MenuManager menuMgr = new MenuManager("Molecuels table", "net.bioclipse.cdk.ui.sdfeditor.menu");
    menuMgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    getSite().registerContextMenu("net.bioclipse.cdk.ui.sdfeditor.menu", menuMgr, molTableViewer);
    Menu menu = menuMgr.createContextMenu(molTableViewer.getControl());
    molTableViewer.getControl().setMenu(menu);
    logger.debug("Menu id for SDFEditor " + menuMgr.getId());

    getSite().setSelectionProvider(molTableViewer);

}

From source file:net.bioclipse.ui.ApplicationActionBarAdvisor.java

License:Open Source License

/**
 * Fill the standard menus//from  w w  w.  j av  a 2s.com
 */
protected void fillMenuBar(IMenuManager menuBar) {

    /*
     * File menu
     */
    MenuManager fileMenu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE);
    fileMenu.add(new Separator());
    fileMenu.add(newAction);
    fileMenu.add(saveAction);
    fileMenu.add(saveAsAction);
    fileMenu.add(saveAllAction);
    fileMenu.add(revertAction);
    fileMenu.add(new Separator("SWITCHWORKSPACE"));
    fileMenu.add(switchWorkspaceAction);
    fileMenu.add(new Separator("IMPORTandEXPORT"));
    fileMenu.add(importAction);
    fileMenu.add(exportAction);
    // menu.add(ContributionItemFactory.REOPEN_EDITORS.create(getWindow()));
    fileMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    fileMenu.add(new Separator());
    fileMenu.add(quitAction);

    /*
     * Edit menu
     */
    MenuManager editMenu = new MenuManager("&Edit", IWorkbenchActionConstants.M_EDIT);
    editMenu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_START));
    editMenu.add(undoAction);
    editMenu.add(redoAction);
    editMenu.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT));
    editMenu.add(cutAction);
    editMenu.add(copyAction);
    editMenu.add(pasteAction);
    editMenu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));
    editMenu.add(selectAllAction);
    editMenu.add(new Separator());
    editMenu.add(findAction);
    editMenu.add(new GroupMarker(IWorkbenchActionConstants.FIND_EXT));
    editMenu.add(new GroupMarker(IWorkbenchActionConstants.ADD_EXT));
    editMenu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_END));
    editMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));

    /*
     * Window menu
     */
    MenuManager windowMenu = new MenuManager("&Window", IWorkbenchActionConstants.M_WINDOW);
    MenuManager showViewMenuMgr = new MenuManager("Show View", "showView");
    showViewMenuMgr.add(showViewItem);
    windowMenu.add(showViewMenuMgr);

    MenuManager showPerspectivesMenuMgr = new MenuManager("Open Perspective", "openPerspective");
    showPerspectivesMenuMgr.add(showPerspectivesItem);
    windowMenu.add(showPerspectivesMenuMgr);

    windowMenu.add(new Separator());
    windowMenu.add(resetPerspectiveAction);
    windowMenu.add(new Separator());
    windowMenu.add(preferencesAction);

    /*
     * Help menu
     */
    MenuManager helpMenu = new MenuManager("&Help", IWorkbenchActionConstants.M_HELP);

    //Intro action
    helpMenu.add(introAction);
    helpMenu.add(helpAction);
    helpMenu.add(dynamicHelpAction);
    helpMenu.add(new GroupMarker(IWorkbenchActionConstants.HELP_START));
    helpMenu.add(new GroupMarker(IWorkbenchActionConstants.HELP_END));
    helpMenu.add(new Separator());
    helpMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    helpMenu.add(new Separator());

    // About should always be at the bottom
    helpMenu.add(new Separator());
    helpMenu.add(aboutAction);

    menuBar.add(fileMenu);
    menuBar.add(editMenu);
    menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    menuBar.add(windowMenu);
    menuBar.add(helpMenu);

}

From source file:net.bioclipse.ui.ApplicationActionBarAdvisor.java

License:Open Source License

protected void fillCoolBar(ICoolBarManager coolBar) {

    IActionBarConfigurer2 actionBarConfigurer = (IActionBarConfigurer2) getActionBarConfigurer();
    { // Set up the context Menu
        coolbarPopupMenuManager = new MenuManager();
        coolBar.setContextMenuManager(coolbarPopupMenuManager);
        IMenuService menuService = (IMenuService) window.getService(IMenuService.class);
        menuService.populateContributionManager(coolbarPopupMenuManager, "popup:windowCoolbarContextMenu"); //$NON-NLS-1$
    }//  w  w w  .  j av a2 s  .  co  m

    IToolBarManager manager = actionBarConfigurer.createToolBarManager();
    manager.add(newAction);
    manager.add(saveAction);
    manager.add(printAction);
    manager.add(new Separator());
    manager.add(cutAction);
    manager.add(copyAction);
    manager.add(pasteAction);
    manager.add(undoAction);
    manager.add(redoAction);

    coolBar.add(
            actionBarConfigurer.createToolBarContributionItem(manager, IWorkbenchActionConstants.TOOLBAR_FILE));

    coolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    manager.add(new Separator());

    manager.add(helpSearchAction);

    manager.add(helpAction);

}

From source file:net.certiv.fluentmark.outline.FluentOutlinePage.java

License:Open Source License

protected void contextMenuAboutToShow(IMenuManager mgr) {
    if (mgr.isEmpty()) {
        mgr.add(new GroupMarker(ICommonMenuConstants.GROUP_GOTO));
        mgr.add(new Separator(ICommonMenuConstants.GROUP_EDIT));
        mgr.add(new Separator(ICommonMenuConstants.GROUP_ADDITIONS));
        mgr.add(new Separator(ICommonMenuConstants.GROUP_PROPERTIES));

        mgr.appendToGroup(ICommonMenuConstants.GROUP_EDIT, actions.get(ACTION_COPY));
        mgr.appendToGroup(ICommonMenuConstants.GROUP_EDIT, actions.get(ACTION_CUT));
        mgr.appendToGroup(ICommonMenuConstants.GROUP_EDIT, actions.get(ACTION_PASTE));
        mgr.appendToGroup(ICommonMenuConstants.GROUP_EDIT, actions.get(ACTION_DELETE));
    }//from   www.ja  v  a  2 s  . com

    actionGroups.setContext(new ActionContext(getSite().getSelectionProvider().getSelection()));
    actionGroups.fillContextMenu(mgr);
}

From source file:net.heartsome.cat.te.ApplicationActionBarAdvisor.java

@Override
protected void fillMenuBar(IMenuManager menuBar) {
    menuBar.add(createFileMenu());//from  w  ww .  j  ava  2  s . co m
    menuBar.add(createEditMenu());
    menuBar.add(new GroupMarker("view"));
    menuBar.add(new GroupMarker("translation"));
    menuBar.add(new GroupMarker("project"));
    menuBar.add(new GroupMarker("database"));
    menuBar.add(new GroupMarker("qa"));
    menuBar.add(new GroupMarker("advance"));
    menuBar.add(createHelpMenu());
}