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:com.ibm.mq.explorer.ms0s.mqsceditor.MQSCActionContributor.java

License:Open Source License

public MQSCActionContributor() {
    super();//from w  w w .  j av  a  2  s  .  c o m
    ResourceBundle bundle = MQSCEditorMessages.getResourceBundle();

    fContentAssistProposal = new RetargetTextEditorAction(bundle, "ContentAssistProposal."); //$NON-NLS-1$
    fContentAssistProposal.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
    fContentAssistTip = new RetargetTextEditorAction(bundle, "ContentAssistTip."); //$NON-NLS-1$
    fContentAssistTip.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION);
    fFormatProposal = new RetargetTextEditorAction(bundle, "ContentFormatProposal.");
    IActionBars bars = getActionBars();
    if (bars != null) {
        IMenuManager menuManager = bars.getMenuManager();
        if (menuManager != null) {
            menuManager.add(new GroupMarker(IWorkbenchActionConstants.FIND_EXT));
        }
    }
    fTogglePresentation = new MQSCPresentationAction();
}

From source file:com.ibm.mq.explorer.ms0s.mqsceditor.MQSCActionContributor.java

License:Open Source License

public void init(IActionBars bars) {
    int notanumber;
    notanumber = 0;//w w w  .j a v  a 2  s . c  o m
    notanumber++;
    IMenuManager menuManager = bars.getMenuManager();
    if (menuManager != null) {
        menuManager.add(new GroupMarker(IWorkbenchActionConstants.FIND_EXT));
    }
    IMenuManager editMenu = menuManager.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
    if (editMenu != null) {
        editMenu.add(new GroupMarker(IWorkbenchActionConstants.FIND_EXT));
        editMenu.add(new Separator());
        editMenu.add(fFormatProposal);
        editMenu.add(fContentAssistProposal);
        editMenu.add(fContentAssistTip);
    }
    super.init(bars);
}

From source file:com.ibm.mq.explorer.ms0s.mqsceditor.MQSCActionContributor.java

License:Open Source License

private void doSetActiveEditor(IEditorPart part) {
    super.setActiveEditor(part);

    ITextEditor editor = null;//from  w  w  w .j ava 2 s  .  c  o m
    if (part instanceof ITextEditor)
        editor = (ITextEditor) part;
    IActionBars bars = getActionBars();
    if (bars != null) {
        IMenuManager menuManager = bars.getMenuManager();
        if (menuManager != null) {
            menuManager.add(new GroupMarker(IWorkbenchActionConstants.FIND_EXT));
        }
    }
    fContentAssistProposal.setAction(getAction(editor, "ContentAssistProposal")); //$NON-NLS-1$
    fContentAssistTip.setAction(getAction(editor, "ContentAssistTip")); //$NON-NLS-1$
    fFormatProposal.setAction(getAction(editor, "ContentFormatProposal"));

    fTogglePresentation.setEditor(editor);
    fTogglePresentation.update();
}

From source file:com.ibm.mq.explorer.ms0s.mqsceditor.MQSCEditor.java

License:Open Source License

protected void editorContextMenuAboutToShow(IMenuManager menu) {
    menu.add(new GroupMarker(IWorkbenchActionConstants.FIND_EXT));
    super.editorContextMenuAboutToShow(menu);
    addAction(menu, "ContentAssistProposal"); //$NON-NLS-1$
    addAction(menu, "ContentAssistTip"); //$NON-NLS-1$
    addAction(menu, "ContentFormatProposal"); //$NON-NLS-1$
}

From source file:com.iks.hto.karteikastensystem.simple.rcp.views.KarteikastenSystemExplorerPart.java

License:Open Source License

private TreeViewer init(Composite parent, KarteikastenSystem karteikastensystem) {

    KarteikastensystemItemProviderAdapterFactory adapterFactory = new KarteikastensystemItemProviderAdapterFactory();

    TreeViewer viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    viewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
    viewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));

    viewer.setInput(karteikastensystem);

    MenuManager mgr = new MenuManager();
    mgr.add(new GroupMarker("additions"));
    viewer.getControl().setMenu(mgr.createContextMenu(viewer.getControl()));

    site.registerContextMenu(Activator.PLUGIN_ID + ".karteikastenSystemAdditions", mgr, viewer);

    IObservableValue treeObs = ViewerProperties.singleSelection().observe(viewer);
    treeObs.addValueChangeListener(new IValueChangeListener() {

        public void handleValueChange(ValueChangeEvent event) {
            ISourceProviderService s = (ISourceProviderService) site.getService(ISourceProviderService.class);
            ResourceProvider p = (ResourceProvider) s.getSourceProvider(ResourceProvider.MODEL_RESOURCE_NAME);

            if (event.diff.getNewValue() instanceof Person) {
                Person person = (Person) event.diff.getNewValue();
                p.setBenutzer(person);// ww w .  j av a2  s  .  co  m
                p.setKarteikasten(null);
                p.setFach(null);
            } else if (event.diff.getNewValue() instanceof Karteikasten) {
                Karteikasten kk = (Karteikasten) event.diff.getNewValue();
                p.setBenutzer(kk.getPerson());
                p.setKarteikasten(kk);
                p.setFach(null);
            } else if (event.diff.getNewValue() instanceof Fach) {
                Fach f = (Fach) event.diff.getNewValue();
                p.setBenutzer(f.getKarteikasten().getPerson());
                p.setKarteikasten(f.getKarteikasten());
                p.setFach(f);
            } else {
                p.setBenutzer(null);
                p.setKarteikasten(null);
                p.setFach(null);
            }
        }
    });

    return viewer;
}

From source file:com.iw.plugins.spindle.editors.Editor.java

License:Mozilla Public License

protected void editorContextMenuAboutToShow(IMenuManager menu) {
    super.editorContextMenuAboutToShow(menu);
    menu.appendToGroup(ITextEditorActionConstants.GROUP_UNDO, new Separator(NAV_GROUP));
    menu.insertAfter(NAV_GROUP, new GroupMarker(SHOW_GROUP));
    menu.insertAfter(ITextEditorActionConstants.GROUP_COPY, new Separator(SOURCE_GROUP));
}

From source file:com.laex.cg2d.core.ApplicationActionBarAdvisor.java

License:Open Source License

protected void fillMenuBar(IMenuManager menuBar) {
    MenuManager fileMenu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE);
    MenuManager helpMenu = new MenuManager("&Help", IWorkbenchActionConstants.M_HELP);
    MenuManager prefsMenu = new MenuManager("&Window", IWorkbenchActionConstants.M_WINDOW);

    menuBar.add(fileMenu);/*from   www . j a va  2s.c  o  m*/
    // Add a group marker indicating where action set menus will appear.
    menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    menuBar.add(prefsMenu);
    menuBar.add(helpMenu);
    fileMenu.add(newWizardDropDownAction_1);

    // fileMenu.add(saveAction);
    fileMenu.add(new Separator());
    fileMenu.add(saveAction);
    fileMenu.add(saveAllAction);
    fileMenu.add(new Separator());
    fileMenu.add(printAction);
    fileMenu.add(new Separator());
    fileMenu.add(quitAction);

    // prefs
    prefsMenu.add(preferncesAction);
    prefsMenu.add(new Separator());
    prefsMenu.add(showTextureViewAction);
    prefsMenu.add(showLayersViewAction);
    prefsMenu.add(showViewsListAction);

}

From source file:com.maccasoft.ui.internal.application.ApplicationActionBarAdvisor.java

License:Open Source License

@Override
protected void fillCoolBar(ICoolBarManager coolBar) {
    coolBar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_FILE));
    {/* w  ww . jav  a  2  s  . c om*/
        IToolBarManager fileToolBar = new ToolBarManager(SWT.FLAT);
        fileToolBar.add(new Separator(IWorkbenchActionConstants.NEW_GROUP));
        fileToolBar.add(newWizardDropDownAction);
        fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));
        fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.SAVE_GROUP));
        fileToolBar.add(saveAction);
        fileToolBar.add(saveAllAction);
        fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
        fileToolBar.add(printAction);
        fileToolBar.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));

        // Add to the cool bar manager
        coolBar.add(new ToolBarContributionItem(fileToolBar, IWorkbenchActionConstants.TOOLBAR_FILE));
    }

    coolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    coolBar.add(new GroupMarker("group.nav"));
    coolBar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_EDITOR));

    coolBar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_HELP));
    { // Help group
        IToolBarManager helpToolBar = new ToolBarManager(SWT.FLAT);
        helpToolBar.add(new Separator(IWorkbenchActionConstants.GROUP_HELP));
        // Add the group for applications to contribute
        helpToolBar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_APP));
        // Add to the cool bar manager
        coolBar.add(new ToolBarContributionItem(helpToolBar, IWorkbenchActionConstants.TOOLBAR_HELP));
    }
}

From source file:com.maccasoft.ui.internal.application.ApplicationActionBarAdvisor.java

License:Open Source License

@Override
protected void fillMenuBar(IMenuManager menuBar) {
    menuBar.add(createFileMenu(menuBar));
    menuBar.add(createEditMenu(menuBar));
    menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    menuBar.add(createWindowMenu(menuBar));
    menuBar.add(createHelpMenu(menuBar));
}

From source file:com.maccasoft.ui.internal.application.ApplicationActionBarAdvisor.java

License:Open Source License

private MenuManager createFileMenu(IMenuManager menuBar) {
    MenuManager menu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE);
    menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
    {//from  w w  w.  ja va 2 s .c  o m
        String newId = ActionFactory.NEW.getId();
        MenuManager newMenu = new MenuManager("&New", newId) {

            @Override
            public String getMenuText() {
                String result = super.getMenuText();
                if (newQuickMenu == null) {
                    return result;
                }
                String shortCut = newQuickMenu.getShortCutString();
                if (shortCut == null) {
                    return result;
                }
                return result + "\t" + shortCut; //$NON-NLS-1$
            }
        };
        newMenu.add(new Separator(newId));
        this.newWizardMenu = new NewWizardMenu(getWindow());
        newMenu.add(this.newWizardMenu);
        newMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
        menu.add(newMenu);
    }

    menu.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));
    menu.add(new Separator());

    menu.add(saveAction);
    menu.add(saveAsAction);
    menu.add(saveAllAction);
    menu.add(new Separator());
    menu.add(printAction);

    menu.add(new Separator());
    menu.add(importResourcesAction);
    menu.add(exportResourcesAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.IMPORT_EXT));

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

    menu.add(new Separator(IWorkbenchActionConstants.FILE_END));
    menu.add(propertiesAction);
    menu.add(new Separator());
    menu.add(quitAction);
    return menu;
}