Search in sources :

Example 61 with GroupMarker

use of org.eclipse.jface.action.GroupMarker in project yamcs-studio by yamcs.

the class YamcsStudioActionBarAdvisor method fillCoolBar.

@Override
protected void fillCoolBar(ICoolBarManager coolbar) {
    IToolBarManager appToolBar = new ToolBarManager(coolbar.getStyle());
    coolbar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_APP));
    coolbar.add(new ToolBarContributionItem(appToolBar, IWorkbenchActionConstants.TOOLBAR_FILE));
    coolbar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    coolbar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_EDITOR));
    fillAppToolBar(appToolBar);
    // Doesn't seem to work...
    coolbar.setLockLayout(true);
}
Also used : ToolBarContributionItem(org.eclipse.jface.action.ToolBarContributionItem) IToolBarManager(org.eclipse.jface.action.IToolBarManager) GroupMarker(org.eclipse.jface.action.GroupMarker) IToolBarManager(org.eclipse.jface.action.IToolBarManager) ToolBarManager(org.eclipse.jface.action.ToolBarManager)

Example 62 with GroupMarker

use of org.eclipse.jface.action.GroupMarker in project hale by halestudio.

the class ApplicationActionBarAdvisor method fillCoolBar.

/**
 * @see org.eclipse.ui.application.ActionBarAdvisor#fillCoolBar(org.eclipse.jface.action.ICoolBarManager)
 */
@Override
protected void fillCoolBar(ICoolBarManager coolBar) {
    IActionBarConfigurer2 actionBarConfigurer = (IActionBarConfigurer2) getActionBarConfigurer();
    coolBar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_FILE));
    {
        // File Group
        IToolBarManager fileToolBar = actionBarConfigurer.createToolBarManager();
        fileToolBar.add(new Separator(IWorkbenchActionConstants.NEW_GROUP));
        fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));
        fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.SAVE_GROUP));
        fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
        fileToolBar.add(new Separator(IWorkbenchActionConstants.BUILD_GROUP));
        fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.BUILD_EXT));
        fileToolBar.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
        // Add to the cool bar manager
        coolBar.add(actionBarConfigurer.createToolBarContributionItem(fileToolBar, IWorkbenchActionConstants.TOOLBAR_FILE));
    }
    // coolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    coolBar.add(new GroupMarker("group.nav"));
    {
        // Navigate group
        IToolBarManager navToolBar = actionBarConfigurer.createToolBarManager();
        navToolBar.add(new Separator(IWorkbenchActionConstants.HISTORY_GROUP));
        navToolBar.add(new Separator(IWorkbenchActionConstants.GROUP_APP));
        navToolBar.add(new Separator(IWorkbenchActionConstants.PIN_GROUP));
        // Add to the cool bar manager
        coolBar.add(actionBarConfigurer.createToolBarContributionItem(navToolBar, IWorkbenchActionConstants.TOOLBAR_NAVIGATE));
    }
    coolBar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_EDITOR));
    coolBar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_HELP));
    {
        // Help group
        IToolBarManager helpToolBar = actionBarConfigurer.createToolBarManager();
        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(actionBarConfigurer.createToolBarContributionItem(helpToolBar, IWorkbenchActionConstants.TOOLBAR_HELP));
    }
}
Also used : IToolBarManager(org.eclipse.jface.action.IToolBarManager) GroupMarker(org.eclipse.jface.action.GroupMarker) IActionBarConfigurer2(org.eclipse.ui.internal.provisional.application.IActionBarConfigurer2) Separator(org.eclipse.jface.action.Separator)

Example 63 with GroupMarker

use of org.eclipse.jface.action.GroupMarker in project dbeaver by dbeaver.

the class BaseTextEditor method editorContextMenuAboutToShow.

@Override
protected void editorContextMenuAboutToShow(IMenuManager menu) {
    // super.editorContextMenuAboutToShow(menu);
    menu.add(new GroupMarker(GROUP_SQL_ADDITIONS));
    menu.add(new GroupMarker(GROUP_SQL_EXTRAS));
    menu.add(new Separator());
    menu.add(new Separator(ITextEditorActionConstants.GROUP_COPY));
    menu.add(new Separator(ITextEditorActionConstants.GROUP_PRINT));
    menu.add(new Separator(ITextEditorActionConstants.GROUP_EDIT));
    menu.add(new Separator(ITextEditorActionConstants.GROUP_FIND));
    menu.add(new Separator(IWorkbenchActionConstants.GROUP_ADD));
    menu.add(new Separator(ITextEditorActionConstants.GROUP_UNDO));
    menu.add(new GroupMarker(ITextEditorActionConstants.GROUP_SAVE));
    menu.add(new Separator(ITextEditorActionConstants.GROUP_REST));
    menu.add(new Separator());
    menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    menu.add(new Separator());
    menu.add(new GroupMarker(GROUP_SQL_PREFERENCES));
    if (isEditable()) {
        addAction(menu, ITextEditorActionConstants.GROUP_UNDO, ITextEditorActionConstants.UNDO);
        addAction(menu, ITextEditorActionConstants.GROUP_SAVE, ITextEditorActionConstants.SAVE);
        addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.CUT);
        addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.COPY);
        addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.PASTE);
        IAction action = getAction(ITextEditorActionConstants.QUICK_ASSIST);
        if (action != null && action.isEnabled()) {
            addAction(menu, ITextEditorActionConstants.GROUP_EDIT, ITextEditorActionConstants.QUICK_ASSIST);
        }
    } else {
        addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.COPY);
    }
    IAction preferencesAction = getAction(ITextEditorActionConstants.CONTEXT_PREFERENCES);
    if (preferencesAction != null) {
        menu.appendToGroup(GROUP_SQL_PREFERENCES, preferencesAction);
    }
    for (IActionContributor ac : actionContributors) {
        ac.contributeActions(menu);
    }
}
Also used : IAction(org.eclipse.jface.action.IAction) GroupMarker(org.eclipse.jface.action.GroupMarker) Separator(org.eclipse.jface.action.Separator)

Example 64 with GroupMarker

use of org.eclipse.jface.action.GroupMarker in project dbeaver by dbeaver.

the class ValueViewerPanel method fillToolBar.

private void fillToolBar(final IContributionManager contributionManager) {
    contributionManager.add(new Separator());
    if (valueManager != null) {
        try {
            valueManager.contributeActions(contributionManager, previewController, valueEditor);
        } catch (Exception e) {
            log.error("Can't contribute value manager actions", e);
        }
    }
    contributionManager.add(new GroupMarker(IValueManager.GROUP_ACTIONS_ADDITIONAL));
    if (valueEditor != null && !valueEditor.isReadOnly()) {
        contributionManager.add(ActionUtils.makeCommandContribution(presentation.getController().getSite(), ValueViewCommandHandler.CMD_SAVE_VALUE));
        contributionManager.add(new Action("Auto-apply value", Action.AS_CHECK_BOX) {

            {
                setImageDescriptor(DBeaverIcons.getImageDescriptor(UIIcon.AUTO_SAVE));
            }

            @Override
            public boolean isChecked() {
                return DBWorkbench.getPlatform().getPreferenceStore().getBoolean(ResultSetPreferences.RS_EDIT_AUTO_UPDATE_VALUE);
            }

            @Override
            public void run() {
                boolean newValue = !isChecked();
                DBWorkbench.getPlatform().getPreferenceStore().setValue(ResultSetPreferences.RS_EDIT_AUTO_UPDATE_VALUE, newValue);
                presentation.getController().updatePanelActions();
            }
        });
    }
}
Also used : Action(org.eclipse.jface.action.Action) GroupMarker(org.eclipse.jface.action.GroupMarker) Separator(org.eclipse.jface.action.Separator) DBException(org.jkiss.dbeaver.DBException)

Example 65 with GroupMarker

use of org.eclipse.jface.action.GroupMarker in project archi by archimatetool.

the class ArchimateDiagramEditorActionBarContributor method contributeToEditMenu.

@Override
protected IMenuManager contributeToEditMenu(IMenuManager menuManager) {
    IMenuManager editMenu = super.contributeToEditMenu(menuManager);
    // Text Positions
    IMenuManager textPositionMenu = new MenuManager(Messages.ArchimateDiagramEditorActionBarContributor_1);
    for (String id : TextPositionAction.ACTION_IDS) {
        textPositionMenu.add(getAction(id));
    }
    editMenu.appendToGroup(GROUP_EDIT_MENU, textPositionMenu);
    editMenu.insertAfter(ArchiActionFactory.DELETE.getId(), new GroupMarker(editDeleteMenuGroup));
    editMenu.appendToGroup(editDeleteMenuGroup, getAction(DeleteFromModelAction.ID));
    return editMenu;
}
Also used : IMenuManager(org.eclipse.jface.action.IMenuManager) MenuManager(org.eclipse.jface.action.MenuManager) GroupMarker(org.eclipse.jface.action.GroupMarker) IMenuManager(org.eclipse.jface.action.IMenuManager)

Aggregations

GroupMarker (org.eclipse.jface.action.GroupMarker)117 Separator (org.eclipse.jface.action.Separator)93 IMenuManager (org.eclipse.jface.action.IMenuManager)44 MenuManager (org.eclipse.jface.action.MenuManager)42 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)17 IToolBarManager (org.eclipse.jface.action.IToolBarManager)12 IAction (org.eclipse.jface.action.IAction)10 IMenuListener (org.eclipse.jface.action.IMenuListener)10 Menu (org.eclipse.swt.widgets.Menu)8 Action (org.eclipse.jface.action.Action)7 ISelection (org.eclipse.jface.viewers.ISelection)5 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)5 ActionContributionItem (org.eclipse.jface.action.ActionContributionItem)4 ToolBarContributionItem (org.eclipse.jface.action.ToolBarContributionItem)4 ToolBarManager (org.eclipse.jface.action.ToolBarManager)4 Iterator (java.util.Iterator)2 AddPVAction (org.csstudio.trends.databrowser3.ui.AddPVAction)2 IFindReplaceTarget (org.eclipse.jface.text.IFindReplaceTarget)2 Point (org.eclipse.swt.graphics.Point)2 Shell (org.eclipse.swt.widgets.Shell)2