Search in sources :

Example 1 with Separator

use of org.eclipse.jface.action.Separator in project dbeaver by serge-rider.

the class ContentValueManager method contributeContentActions.

public static void contributeContentActions(@NotNull IContributionManager manager, @NotNull final IValueController controller, final IValueEditor activeEditor) throws DBCException {
    if (controller.getValue() instanceof DBDContent && !((DBDContent) controller.getValue()).isNull()) {
        manager.add(new Action(CoreMessages.model_jdbc_save_to_file_, DBeaverIcons.getImageDescriptor(UIIcon.SAVE_AS)) {

            @Override
            public void run() {
                DialogUtils.saveToFile(controller);
            }
        });
    }
    manager.add(new Action(CoreMessages.model_jdbc_load_from_file_, DBeaverIcons.getImageDescriptor(UIIcon.LOAD)) {

        @Override
        public void run() {
            if (DialogUtils.loadFromFile(controller)) {
                try {
                    activeEditor.primeEditorValue(controller.getValue());
                } catch (DBException e) {
                    UIUtils.showErrorDialog(null, "Load from file", "Error loading contents from file", e);
                }
            }
        }
    });
    manager.add(new Separator());
}
Also used : DBException(org.jkiss.dbeaver.DBException) Action(org.eclipse.jface.action.Action) DBDContent(org.jkiss.dbeaver.model.data.DBDContent) Separator(org.eclipse.jface.action.Separator)

Example 2 with Separator

use of org.eclipse.jface.action.Separator in project dbeaver by serge-rider.

the class BaseTextEditor method editorContextMenuAboutToShow.

@Override
protected void editorContextMenuAboutToShow(IMenuManager menu) {
    //super.editorContextMenuAboutToShow(menu);
    menu.add(new Separator(ITextEditorActionConstants.GROUP_UNDO));
    menu.add(new GroupMarker(ITextEditorActionConstants.GROUP_SAVE));
    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_REST));
    menu.add(new Separator());
    menu.add(new GroupMarker(GROUP_SQL_ADDITIONS));
    menu.add(new GroupMarker(GROUP_SQL_EXTRAS));
    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);
    }
}
Also used : IAction(org.eclipse.jface.action.IAction) GroupMarker(org.eclipse.jface.action.GroupMarker) Separator(org.eclipse.jface.action.Separator)

Example 3 with Separator

use of org.eclipse.jface.action.Separator in project meclipse by flaper87.

the class MeclipseView method fillLocalPullDown.

private void fillLocalPullDown(IMenuManager manager) {
    manager.add(connection);
    manager.add(new Separator());
}
Also used : Separator(org.eclipse.jface.action.Separator)

Example 4 with Separator

use of org.eclipse.jface.action.Separator in project meclipse by flaper87.

the class Database method fillContextMenu.

@Override
public void fillContextMenu(IMenuManager manager) {
    manager.add(createCollection);
    manager.add(new Separator());
    manager.add(setProfileLevel0);
    manager.add(setProfileLevel1);
    manager.add(setProfileLevel2);
    manager.add(new Separator());
    super.fillContextMenu(manager);
}
Also used : Separator(org.eclipse.jface.action.Separator)

Example 5 with Separator

use of org.eclipse.jface.action.Separator in project translationstudio8 by heartsome.

the class ApplicationActionBarAdvisor method createHelpMenu.

/**
	 * 创建帮助菜单
	 * @return 返回帮助菜单的 menu manager;
	 */
private MenuManager createHelpMenu() {
    MenuManager menu = new MenuManager(Messages.getString("ts.ApplicationActionBarAdvisor.menu.help"), IWorkbenchActionConstants.M_HELP);
    // menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_START));
    menu.add(helpAction);
    // menu.add(helpSearchAction);
    // menu.add(dynamicHelpAction);
    // menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_END));
    menu.add(new GroupMarker("help.keyAssist"));
    menu.add(new Separator());
    menu.add(new GroupMarker("help.updatePlugin"));
    menu.add(new Separator());
    menu.add(new GroupMarker("help.license"));
    // 关于菜单需要始终显示在最底端
    menu.add(new GroupMarker("group.about"));
    // menu.add(aboutItem);
    return menu;
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) GroupMarker(org.eclipse.jface.action.GroupMarker) Separator(org.eclipse.jface.action.Separator)

Aggregations

Separator (org.eclipse.jface.action.Separator)89 MenuManager (org.eclipse.jface.action.MenuManager)39 IMenuManager (org.eclipse.jface.action.IMenuManager)37 IAction (org.eclipse.jface.action.IAction)14 Menu (org.eclipse.swt.widgets.Menu)10 Action (org.eclipse.jface.action.Action)9 IMenuListener (org.eclipse.jface.action.IMenuListener)9 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)9 ActionManager (com.cubrid.common.ui.spi.action.ActionManager)7 IToolBarManager (org.eclipse.jface.action.IToolBarManager)7 ActionContributionItem (org.eclipse.jface.action.ActionContributionItem)6 GroupMarker (org.eclipse.jface.action.GroupMarker)6 IContributionManager (org.eclipse.jface.action.IContributionManager)5 TreeViewer (org.eclipse.jface.viewers.TreeViewer)5 IActionBars (org.eclipse.ui.IActionBars)5 DBAServerSession (org.jkiss.dbeaver.model.admin.sessions.DBAServerSession)5 DBAServerSessionManager (org.jkiss.dbeaver.model.admin.sessions.DBAServerSessionManager)5 SessionManagerViewer (org.jkiss.dbeaver.ui.views.session.SessionManagerViewer)5 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)4 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)4