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:gov.nasa.ensemble.core.rcp.EnsembleActionBarAdvisor.java

License:Open Source License

protected ToolBarContributionItem createEditToolbar(ICoolBarManager coolBar) {
    IToolBarManager toolBar = new ToolBarManager(coolBar.getStyle());
    toolBar.add(new GroupMarker(IWorkbenchActionConstants.EDIT_START));
    toolBar.add(getGlobalAction(ActionFactory.UNDO));
    toolBar.add(getGlobalAction(ActionFactory.REDO));
    toolBar.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT));
    toolBar.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));
    toolBar.add(new GroupMarker(IWorkbenchActionConstants.ADD_EXT));
    toolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    toolBar.add(new GroupMarker(IWorkbenchActionConstants.EDIT_END));
    return new ToolBarContributionItem(toolBar, IWorkbenchActionConstants.M_EDIT);
}

From source file:gov.redhawk.explorer.ApplicationActionBarAdvisor.java

License:Open Source License

@Override
protected void fillMenuBar(final IMenuManager menuBar) {
    menuBar.add(createFileMenu());/*from  w w  w.j a v a 2 s .  c  o  m*/
    menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    menuBar.add(createHelpMenu());
}

From source file:gov.redhawk.ide.sandbox.console.py.RHSandboxConsoleView.java

License:Open Source License

public void createConsoleControl() {
    if ((this.console != null) || (this.page != null)) {
        throw new IllegalStateException();
    }/*from   w  ww.ja  v  a2s.  c  om*/

    getViewSite().getActionBars().getToolBarManager().removeAll();
    getViewSite().getActionBars().getToolBarManager().add(new GroupMarker("launchGroup"));
    getViewSite().getActionBars().getToolBarManager().add(new GroupMarker("outputGroup"));

    try {
        console = SandboxConsole.create();
        page = console.createPage(this);
        page.init(this);
        page.createControl(consoleArea);
        consoleArea.update();
        consoleArea.redraw();
        this.console.addTerminateListener(this);
    } catch (CoreException e) {
        RHLocalConsolePlugin.getDefault().getLog().log(new Status(e.getStatus().getSeverity(),
                RHLocalConsolePlugin.PLUGIN_ID, "Failed to create Sandbox console", e));
        this.console = null;
    }
}

From source file:gov.redhawk.sca.internal.ui.actions.OpenWithActionProvider.java

License:Open Source License

private void addOpenWithMenu(final IMenuManager aMenu) {
    final IStructuredSelection ss = (IStructuredSelection) getContext().getSelection();

    if (ss == null || ss.size() != 1) {
        return;/*from  w  w  w  .  j  a  v  a 2  s .  c  o  m*/
    }

    final Object o = ss.getFirstElement();

    final EObject openable = PluginUtil.adapt(EObject.class, o);
    final IScaEditorDescriptor[] editors = ScaContentTypeRegistry.INSTANCE.getAllScaEditorDescriptors(openable);

    if (openable != null && editors.length > 0) {
        // Create a menu flyout.
        final IMenuManager submenu = new MenuManager("Open Wit&h", ICommonMenuConstants.GROUP_OPEN_WITH);
        submenu.add(new GroupMarker(ICommonMenuConstants.GROUP_TOP));
        submenu.add(new OpenWithMenu(this.viewSite.getPage(), openable));
        submenu.add(new GroupMarker(ICommonMenuConstants.GROUP_ADDITIONS));

        // Add the submenu.
        if (submenu.getItems().length > 2 && submenu.isEnabled()) {
            aMenu.appendToGroup(ICommonMenuConstants.GROUP_OPEN_WITH, submenu);
        }
    }
}

From source file:gov.redhawk.ui.editor.ScaFormPage.java

License:Open Source License

/**
 * {@inheritDoc}/*w  ww  . j a  v a  2s . c  o  m*/
 */
@Override
protected void createFormContent(final IManagedForm managedForm) {
    final ScrolledForm form = managedForm.getForm();
    final FormToolkit toolkit = managedForm.getToolkit();
    // FormColors colors = toolkit.getColors();
    // form.getForm().setSeparatorColor(colors.getColor(FormColors.TB_BORDER));
    if (this.fNewStyleHeader) {
        // createNewStyleHeader(form, colors);
        toolkit.decorateFormHeading(form.getForm());
    }

    final IToolBarManager manager = form.getToolBarManager();
    // Create the group marker so that additional buttons can be added to this group
    // and be to the left of the help button.
    manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));

    getEditor().contributeToToolbar(manager);

    final String href = getHelpResource();
    if (href != null) {
        final Action helpAction = new Action("help") { //$NON-NLS-1$
            @Override
            public void run() {
                BusyIndicator.showWhile(form.getDisplay(), new Runnable() {
                    @Override
                    public void run() {
                        PlatformUI.getWorkbench().getHelpSystem().displayHelp(href);
                    }
                });
            }
        };
        helpAction.setToolTipText("Help");
        helpAction.setImageDescriptor(ScaPluginImages.DESC_HELP);
        manager.add(helpAction);
    }
    // check to see if our form parts are contributing actions
    final IFormPart[] parts = managedForm.getParts();
    for (int i = 0; i < parts.length; i++) {
        if (parts[i] instanceof IAdaptable) {
            final IAdaptable adapter = (IAdaptable) parts[i];
            final IAction[] actions = (IAction[]) adapter.getAdapter(IAction[].class);
            if (actions != null) {
                for (int j = 0; j < actions.length; j++) {
                    form.getToolBarManager().add(actions[j]);
                }
            }
        }
    }
    form.updateToolBar();
}

From source file:hierarchyviewer.ios.ApplicationActionBarAdvisor.java

License:GNU General Public License

protected void fillMenuBar(IMenuManager menuBar) {
    MenuManager fileMenu = new MenuManager(CustomString.getString("MENU_FILE"),
            IWorkbenchActionConstants.M_FILE);
    MenuManager toolMenu = new MenuManager(CustomString.getString("MENU_TOOL"),
            IWorkbenchActionConstants.M_NAVIGATE);
    MenuManager windowMenu = new MenuManager(CustomString.getString("MENU_WINDOW"),
            IWorkbenchActionConstants.M_WINDOW);
    MenuManager helpMenu = new MenuManager(CustomString.getString("MENU_HELP"),
            IWorkbenchActionConstants.M_HELP);

    menuBar.add(fileMenu);/*  w ww.  j  a  va 2  s.  co  m*/
    menuBar.add(toolMenu);
    menuBar.add(windowMenu);
    // Add a group marker indicating where action set menus will appear.
    menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    menuBar.add(helpMenu);

    // File
    fileMenu.add(openLogFileAction);
    fileMenu.add(refreshLogFileAction);
    fileMenu.add(new Separator());

    fileMenu.add(openAppAction);
    fileMenu.add(refreshAppElementAction);
    fileMenu.add(terminateAppAction);
    fileMenu.add(new Separator());

    fileMenu.add(saveHierarchyViewPictureAction);
    fileMenu.add(new Separator());

    fileMenu.add(preferencesAction);
    fileMenu.add(exitAction);

    //Tools
    toolMenu.add(iqueryCreatorDialogAction);

    //Window
    windowMenu.add(openScreenShotViewAction);
    windowMenu.add(openHierarchyViewAction);
    windowMenu.add(openPropertiesViewAction);
    windowMenu.add(openHierarchyOverViewAction);
    windowMenu.add(TreeViewListViewAction);

    // Help
    helpMenu.add(aboutAction);
}

From source file:io.aos.jface.sample.spl02.JFaceSample02.java

License:Apache License

private MenuManager createHelpMenu() {
    MenuManager menu = new MenuManager("Help", "Id01");
    menu.add(new GroupMarker("About"));
    menu.add(createAboutAction());/*from w  w w .ja v  a  2s.  c  om*/
    return menu;
}

From source file:io.usethesource.impulse.editor.internal.AbstractInformationControl.java

License:Open Source License

/**
 * Fills the view menu./*from w  w w  . j  a  v a2 s  .  co  m*/
 * Clients can extend or override.
 *
 * @param viewMenu the menu manager that manages the menu
 * @since 3.0
 */
protected void fillViewMenu(IMenuManager viewMenu) {
    viewMenu.add(new GroupMarker("SystemMenuStart")); //$NON-NLS-1$
    viewMenu.add(new MoveAction());
    viewMenu.add(new ResizeAction());
    viewMenu.add(new RememberBoundsAction());
    viewMenu.add(new Separator("SystemMenuEnd")); //$NON-NLS-1$
    //   if (fCustomFiltersActionGroup != null)
    //       fCustomFiltersActionGroup.fillViewMenu(viewMenu);
}

From source file:it.uniba.di.cdg.collaborativeworkbench.boot.ui.ApplicationActionBarAdvisor.java

License:Open Source License

protected void fillMenuBar(IMenuManager menuBar) {
    // File menu//from   w  ww .  ja  v  a  2s . c  o  m
    MenuManager fileMenu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE);
    menuBar.add(fileMenu);
    fileMenu.add(saveAction);
    fileMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    fileMenu.add(new Separator());
    //fileMenu.add( exitAction );

    // Workbench menu
    MenuManager workbenchMenu = new MenuManager("Workbench", UiConstants.M_WORKBENCH);
    menuBar.add(workbenchMenu);

    // Workbench / Switch perspective submenu
    MenuManager perspectivesMenu = new MenuManager("Switch &perspective", "perspectives");
    workbenchMenu.add(perspectivesMenu);
    perspectivesMenu.add(switchPerspectivesMenu);

    // Workbench / Show views perspective submenu
    MenuManager viewsMenu = new MenuManager("Show &view", "views");
    workbenchMenu.add(viewsMenu);
    viewsMenu.add(showViewsMenu);

    workbenchMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));

    // This will ensure that all new menus are added _before_ the "options" and "help" menus
    menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));

    // Options menu
    MenuManager optionsMenu = new MenuManager("&Options", UiConstants.M_OPTIONS);
    menuBar.add(optionsMenu);
    optionsMenu.add(connectAction);
    optionsMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    optionsMenu.add(new Separator());
    optionsMenu.add(preferencesAction);

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

    helpMenu.add(aboutAction);
    helpMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}

From source file:it.uniba.di.cdg.xcore.econference.ui.views.HandRaisingView.java

License:Open Source License

/**
 * Hook the context menu. Do not ask me how this works since it is copy'n'pasted  ;)
 *//* ww  w.j  a  va 2  s .c  o  m*/
private void hookContextMenu() {
    MenuManager menuMgr = new MenuManager("questionsPopup"); //$NON-NLS-1$
    menuMgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));

    Menu menu = menuMgr.createContextMenu(questionViewer.getControl());
    questionViewer.getControl().setMenu(menu);

    // Register viewer with site. This must be done before making the actions.
    getSite().registerContextMenu(menuMgr, questionViewer);
}