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:org.eclipse.datatools.enablement.rcp.ApplicationActionBarAdvisor.java

License:Open Source License

/**
* Creates and returns the Help menu.//  www.  j  a va 2  s  .  c o  m
*/
private MenuManager createHelpMenu() {
    MenuManager menu = new MenuManager(IDEWorkbenchMessages.Workbench_help, IWorkbenchActionConstants.M_HELP);
    addSeparatorOrGroupMarker(menu, "group.intro"); //$NON-NLS-1$
    // See if a welcome or intro page is specified
    if (introAction != null) {
        menu.add(introAction);
    } else if (quickStartAction != null) {
        menu.add(quickStartAction);
    }
    menu.add(new GroupMarker("group.intro.ext")); //$NON-NLS-1$
    addSeparatorOrGroupMarker(menu, "group.main"); //$NON-NLS-1$
    menu.add(helpContentsAction);
    menu.add(helpSearchAction);
    menu.add(dynamicHelpAction);
    addSeparatorOrGroupMarker(menu, "group.assist"); //$NON-NLS-1$
    // See if a tips and tricks page is specified
    if (tipsAndTricksAction != null) {
        menu.add(tipsAndTricksAction);
    }
    // HELP_START should really be the first item, but it was after
    // quickStartAction and tipsAndTricksAction in 2.1.
    menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_START));
    menu.add(new GroupMarker("group.main.ext")); //$NON-NLS-1$
    addSeparatorOrGroupMarker(menu, "group.tutorials"); //$NON-NLS-1$
    addSeparatorOrGroupMarker(menu, "group.tools"); //$NON-NLS-1$
    addSeparatorOrGroupMarker(menu, "group.updates"); //$NON-NLS-1$
    menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_END));
    addSeparatorOrGroupMarker(menu, IWorkbenchActionConstants.MB_ADDITIONS);
    // about should always be at the bottom
    menu.add(new Separator("group.about")); //$NON-NLS-1$

    ActionContributionItem aboutItem = new ActionContributionItem(aboutAction);
    aboutItem.setVisible(!"carbon".equals(SWT.getPlatform())); //$NON-NLS-1$
    menu.add(aboutItem);
    menu.add(new GroupMarker("group.about.ext")); //$NON-NLS-1$
    return menu;
}

From source file:org.eclipse.datatools.sqltools.data.internal.ui.editor.TableDataEditor.java

License:Open Source License

protected void createContextMenu() {

    final TableDataEditorActionBarContributor contributor = DataUIPlugin.getDefault()
            .getTableDataEditorContributor();

    // Create menu manager.
    MenuManager menuMgr = new MenuManager();
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {
        public void menuAboutToShow(IMenuManager mgr) {
            mgr.add(contributor.revertAction);
            mgr.add(contributor.refreshAction);
            mgr.add(new Separator());
            mgr.add(contributor.updateAction);
            mgr.add(contributor.setNullAction);
            //                mgr.add(contributor.setDefaultAction);
            mgr.add(contributor.insertAction);
            mgr.add(contributor.deleteAction);
            mgr.add(new Separator());
            mgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
            mgr.add(new Separator());
            mgr.add(contributor.saveAction);
            //               mgr.add( getEditorSite().getActionBars().getGlobalActionHandler(ActionFactory.REFRESH.getId()) );
        }//from w w w  .  j a v  a  2s  . c  om
    });

    // Create menu.
    Menu menu = menuMgr.createContextMenu(tableViewer.getTable());
    tableViewer.getTable().setMenu(menu);
    cursor.setMenu(menu);

    // Register menu for extension.
    getEditorSite().registerContextMenu(menuMgr, selectionProvider);

}

From source file:org.eclipse.datatools.sqltools.plan.internal.ui.view.PlanView.java

License:Open Source License

public static void createStandardGroups(IContributionManager menu) {
    menu.add(new Separator(GROUP_NAVIGATE));
    menu.add(new GroupMarker(GROUP_REMOVE));
    menu.add(new Separator(GROUP_IO));
    menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    menu.add(new Separator(GROUP_HISTORY));
    menu.add(new Separator(GROUP_MODE));
}

From source file:org.eclipse.dd.dsf.debug.internal.ui.disassembly.DisassemblyPart.java

License:Open Source License

protected void fillContextMenu(IMenuManager manager) {
    Point cursorLoc = getSite().getShell().getDisplay().getCursorLocation();
    fViewer.getTextWidget().toControl(cursorLoc);
    fActionToggleSource.update();/*from  w ww  .  j  av  a  2s .co m*/
    fActionToggleSymbols.update();
    manager.add(new GroupMarker("group.top")); // ICommonMenuConstants.GROUP_TOP //$NON-NLS-1$
    manager.add(new Separator("group.breakpoints")); //$NON-NLS-1$
    manager.add(new Separator(IWorkbenchActionConstants.GO_TO));
    manager.add(fActionGotoPC);
    manager.add(fActionGotoAddress);
    manager.add(fActionGotoSymbol);
    manager.add(new Separator("group.debug")); //$NON-NLS-1$
    manager.add(new Separator(ITextEditorActionConstants.GROUP_EDIT));
    manager.appendToGroup(ITextEditorActionConstants.GROUP_EDIT,
            fGlobalActions.get(ITextEditorActionConstants.COPY));
    manager.appendToGroup(ITextEditorActionConstants.GROUP_EDIT,
            fGlobalActions.get(ITextEditorActionConstants.SELECT_ALL));
    manager.add(new Separator(ITextEditorActionConstants.GROUP_SETTINGS));
    manager.add(fActionToggleSource);
    manager.add(fActionToggleSymbols);
    manager.add(fActionOpenPreferences);
    manager.add(new Separator());
    manager.add(fActionRefreshView);
    // Other plug-ins can contribute their actions here
    manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}

From source file:org.eclipse.dd.dsf.debug.internal.ui.disassembly.DisassemblyPart.java

License:Open Source License

protected void fillRulerContextMenu(IMenuManager manager) {
    fActionToggleBreakpoint.update();/* w  w  w  .j a v  a2  s  .  c o m*/
    fActionToggleBreakpointEnablement.update();
    fActionToggleAddressColumn.update();
    fActionToggleFunctionColumn.update();

    manager.add(new GroupMarker("group.top")); // ICommonMenuConstants.GROUP_TOP //$NON-NLS-1$
    manager.add(new Separator("group.breakpoints")); //$NON-NLS-1$
    manager.add(fActionToggleBreakpoint);
    manager.add(fActionToggleBreakpointEnablement);
    manager.add(new GroupMarker("debug")); //$NON-NLS-1$
    manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    manager.add(new GroupMarker(ITextEditorActionConstants.GROUP_RESTORE));
    manager.add(new Separator("add")); //$NON-NLS-1$
    manager.add(new Separator(ITextEditorActionConstants.GROUP_RULERS));
    manager.add(fActionToggleAddressColumn);
    manager.add(fActionToggleFunctionColumn);
    manager.add(new Separator(ITextEditorActionConstants.GROUP_REST));

    for (Object listener : fRulerContextMenuListeners.getListeners())
        ((IMenuListener) listener).menuAboutToShow(manager);

    manager.add(new Separator(ITextEditorActionConstants.GROUP_EDIT));
    manager.appendToGroup(ITextEditorActionConstants.GROUP_EDIT,
            fGlobalActions.get(ITextEditorActionConstants.COPY));
}

From source file:org.eclipse.debug.internal.ui.views.launch.LaunchView.java

License:Open Source License

protected void configureToolBar(IToolBarManager tbm) {
    tbm.add(new Separator(IDebugUIConstants.THREAD_GROUP));
    tbm.add(new Separator(IDebugUIConstants.STEP_GROUP));
    tbm.add(new GroupMarker(IDebugUIConstants.STEP_INTO_GROUP));
    tbm.add(new GroupMarker(IDebugUIConstants.STEP_OVER_GROUP));
    tbm.add(new GroupMarker(IDebugUIConstants.STEP_RETURN_GROUP));
    tbm.add(new GroupMarker(IDebugUIConstants.EMPTY_STEP_GROUP));
    tbm.add(new Separator(IDebugUIConstants.RENDER_GROUP));

    if (fDebugToolbarInView) {
        addDebugToolbarActions(tbm);//from w w  w .  j  a  v  a  2  s .co  m
    }
}

From source file:org.eclipse.debug.internal.ui.views.launch.LaunchView.java

License:Open Source License

protected void fillContextMenu(IMenuManager menu) {
    TreeSelection sel = (TreeSelection) fTreeViewerDebugContextProvider.getActiveContext();
    Object element = sel != null && sel.size() > 0 ? sel.getFirstElement() : null;

    menu.add(new Separator(IDebugUIConstants.EMPTY_EDIT_GROUP));
    menu.add(new Separator(IDebugUIConstants.EDIT_GROUP));
    menu.add(getAction(FIND_ACTION));// w w  w  .  j a va 2 s .co m
    menu.add(new Separator(IDebugUIConstants.EMPTY_STEP_GROUP));
    menu.add(new Separator(IDebugUIConstants.STEP_GROUP));
    menu.add(new GroupMarker(IDebugUIConstants.STEP_INTO_GROUP));
    menu.add(new GroupMarker(IDebugUIConstants.STEP_OVER_GROUP));
    menu.add(new GroupMarker(IDebugUIConstants.STEP_RETURN_GROUP));
    menu.add(new Separator(IDebugUIConstants.RENDER_GROUP));
    menu.add(new Separator(IDebugUIConstants.EMPTY_THREAD_GROUP));
    menu.add(new Separator(IDebugUIConstants.THREAD_GROUP));
    menu.add(new Separator(IDebugUIConstants.EMPTY_LAUNCH_GROUP));
    menu.add(new Separator(IDebugUIConstants.LAUNCH_GROUP));
    IStructuredSelection selection = (IStructuredSelection) getSite().getSelectionProvider().getSelection();
    updateAndAdd(menu, fEditConfigAction, selection);
    updateAndAdd(menu, fAddToFavoritesAction, selection);
    updateAndAdd(menu, fEditSourceAction, selection);
    updateAndAdd(menu, fLookupAction, selection);
    menu.add(new Separator(IDebugUIConstants.EMPTY_RENDER_GROUP));
    menu.add(new Separator(IDebugUIConstants.RENDER_GROUP));
    menu.add(new Separator(IDebugUIConstants.PROPERTY_GROUP));
    PropertyDialogAction action = (PropertyDialogAction) getAction("Properties"); //$NON-NLS-1$
    /**
     * TODO hack to get around bug 148424, remove if UI ever fixes the PropertyDialogAction to respect enablesWhen conditions
     */
    action.setEnabled(action.isApplicableForSelection() && !(element instanceof ILaunch));
    menu.add(action);
    menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));

    menu.appendToGroup(IDebugUIConstants.LAUNCH_GROUP, getAction(TERMINATE_AND_REMOVE));
    menu.appendToGroup(IDebugUIConstants.LAUNCH_GROUP, getAction(TERMINATE_ALL));

    menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(RESUME));
    menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(SUSPEND));
    menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(TERMINATE));
    menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(TERMINATE_AND_RELAUNCH));
    if (element instanceof IAdaptable && ((IAdaptable) element).getAdapter(IRestartHandler.class) != null) {
        menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(RESTART));
    }
    menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(DISCONNECT));

    menu.appendToGroup(IDebugUIConstants.STEP_INTO_GROUP, getAction(STEP_INTO));
    menu.appendToGroup(IDebugUIConstants.STEP_OVER_GROUP, getAction(STEP_OVER));
    menu.appendToGroup(IDebugUIConstants.STEP_RETURN_GROUP, getAction(STEP_RETURN));

    menu.appendToGroup(IDebugUIConstants.EMPTY_STEP_GROUP, getAction(DROP_TO_FRAME));

    menu.appendToGroup(IDebugUIConstants.RENDER_GROUP, getAction(TOGGLE_STEP_FILTERS));
}

From source file:org.eclipse.dltk.console.ui.internal.ScriptConsolePage.java

License:Open Source License

protected void createActions() {
    super.createActions();

    proposalsAction = new ContentAssistProposalsAction(getViewer());
    proposalsAction.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
    IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
    proposalsHandler = new ActionHandler(proposalsAction);
    handlerService.activateHandler(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, proposalsHandler);

    SaveConsoleSessionAction saveSessionAction = new SaveConsoleSessionAction((ScriptConsole) getConsole(),
            ScriptConsoleMessages.SaveSessionAction, ScriptConsoleMessages.SaveSessionTooltip);

    IAction closeConsoleAction = createTerminateConsoleAction();

    IActionBars bars = getSite().getActionBars();

    IToolBarManager toolbarManager = bars.getToolBarManager();

    toolbarManager.prependToGroup(IConsoleConstants.LAUNCH_GROUP,
            new GroupMarker(ScriptConsoleConstants.SCRIPT_GROUP));
    toolbarManager.appendToGroup(ScriptConsoleConstants.SCRIPT_GROUP, new Separator());

    if (closeConsoleAction != null) {
        toolbarManager.appendToGroup(ScriptConsoleConstants.SCRIPT_GROUP, closeConsoleAction);
    }/*from  w  ww .j a  va 2  s .  c om*/

    toolbarManager.appendToGroup(ScriptConsoleConstants.SCRIPT_GROUP, saveSessionAction);

    bars.updateActionBars();
}

From source file:org.eclipse.dltk.internal.ui.actions.ImportActionGroup.java

License:Open Source License

public void fillContextMenu(IMenuManager menu) {
    menu.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, new Separator(GROUP_IMPORT));
    menu.appendToGroup(GROUP_IMPORT, new GroupMarker(ICommonMenuConstants.GROUP_PORT));
    menu.appendToGroup(GROUP_IMPORT, fImportAction);
    menu.appendToGroup(GROUP_IMPORT, fExportAction);
    super.fillContextMenu(menu);
}

From source file:org.eclipse.dltk.internal.ui.editor.ScriptEditor.java

License:Open Source License

public void editorContextMenuAboutToShow(IMenuManager menu) {
    super.editorContextMenuAboutToShow(menu);

    menu.insertAfter(IContextMenuConstants.GROUP_OPEN, new GroupMarker(IContextMenuConstants.GROUP_SHOW));

    ActionContext context = new ActionContext(getSelectionProvider().getSelection());
    context.setInput(getEditorInput());//from   www.j a  va  2 s . c o m
    fContextMenuGroup.setContext(context);
    fContextMenuGroup.fillContextMenu(menu);
    fContextMenuGroup.setContext(null);
    // Quick views
    menu.appendToGroup(IContextMenuConstants.GROUP_OPEN,
            getAction(IScriptEditorActionDefinitionIds.SHOW_OUTLINE));
    menu.appendToGroup(IContextMenuConstants.GROUP_OPEN,
            getAction(IScriptEditorActionDefinitionIds.OPEN_HIERARCHY));
}