Search in sources :

Example 41 with Separator

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

the class PortingActionProvider method addExportMenu.

private void addExportMenu(IMenuManager aMenu) {
    exportWizardActionGroup.setContext(getContext());
    if (exportWizardActionGroup.getWizardActionIds().length == 0) {
        aMenu.appendToGroup(ICommonMenuConstants.GROUP_PORT, exportAction);
        return;
    }
    IMenuManager submenu = new MenuManager(WorkbenchNavigatorMessages.PortingActionProvider_ExportResourcesMenu_label, COMMON_NAVIGATOR_EXPORT_MENU);
    exportWizardActionGroup.fillContextMenu(submenu);
    submenu.add(new Separator(ICommonMenuConstants.GROUP_ADDITIONS));
    submenu.add(new Separator());
    submenu.add(exportAction);
    aMenu.appendToGroup(ICommonMenuConstants.GROUP_PORT, submenu);
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) Separator(org.eclipse.jface.action.Separator)

Example 42 with Separator

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

the class BodyMenuConfiguration method createMenu.

/**
	 * 编辑界面右键菜单
	 * @param menu
	 *            ;
	 */
private void createMenu() {
    MenuManager menuMgr = new MenuManager();
    bodyMenu = menuMgr.createContextMenu(table.getShell());
    if (!CommonFunction.checkEdition("L")) {
        menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null, "net.heartsome.cat.database.ui.tm.command.ConcordanceSearch", Collections.EMPTY_MAP, Activator.getImageDescriptor(ImageConstant.TU_STATE_SEARCHTM), null, null, Messages.getString("menu.BodyMenuConfiguration.searchTM"), null, null, CommandContributionItem.STYLE_PUSH, null, false)));
        menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null, "net.heartsome.cat.database.ui.tb.command.TermBaseSearch", Collections.EMPTY_MAP, Activator.getImageDescriptor(ImageConstant.TU_STATE_SEARCHTB), null, null, Messages.getString("menu.BodyMenuConfiguration.searchTermItem"), null, null, CommandContributionItem.STYLE_PUSH, null, false)));
        menuMgr.add(new Separator());
    }
    // add by yule -webSearch
    menuMgr.add(new Separator());
    menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null, "net.heartsome.cat.ts.websearch.search", Collections.EMPTY_MAP, Activator.getImageDescriptor(ImageConstant.WEB_SEARCH), null, null, Messages.getString("menu.BodyMenuConfiguration.webSearch"), null, null, CommandContributionItem.STYLE_PUSH, null, false)));
    menuMgr.add(new Separator());
    menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null, ActionFactory.CUT.getCommandId(), Collections.EMPTY_MAP, null, null, null, Messages.getString("menu.BodyMenuConfiguration.cut"), null, null, CommandContributionItem.STYLE_PUSH, null, false)));
    menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null, ActionFactory.COPY.getCommandId(), Collections.EMPTY_MAP, null, null, null, Messages.getString("menu.BodyMenuConfiguration.copy"), null, null, CommandContributionItem.STYLE_PUSH, null, false)));
    menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null, ActionFactory.PASTE.getCommandId(), Collections.EMPTY_MAP, null, null, null, Messages.getString("menu.BodyMenuConfiguration.paste"), null, null, CommandContributionItem.STYLE_PUSH, null, false)));
    menuMgr.add(new Separator());
    // 此处显示出来不做任何事情,是因为用户可以通过右键看到当前状态列中显示的图标是什么含义
    // 在状态列中,是无法知道某一图标的具体含义的
    menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null, "net.heartsome.cat.ts.ui.xliffeditor.nattable.command.untranslated", Collections.EMPTY_MAP, Activator.getImageDescriptor("images/state/not-translated.png"), null, null, Messages.getString("menu.BodyMenuConfiguration.emptyTranslationItem"), null, null, CommandContributionItem.STYLE_PUSH, null, false)));
    menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null, "net.heartsome.cat.ts.ui.xliffeditor.nattable.command.draft", Collections.EMPTY_MAP, Activator.getImageDescriptor("images/state/draft.png"), null, null, Messages.getString("menu.BodyMenuConfiguration.draftItem"), null, null, CommandContributionItem.STYLE_PUSH, null, false)));
    Map<String, String> mapParameter = new HashMap<String, String>();
    mapParameter.put("addSegmentToTM", "addToTM");
    menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null, "net.heartsome.cat.ts.ui.xliffeditor.menu.translation.command.completeTranslation", mapParameter, Activator.getImageDescriptor("images/state/translated.png"), null, null, Messages.getString("menu.BodyMenuConfiguration.translatedItem"), null, null, CommandContributionItem.STYLE_PUSH, null, false)));
    mapParameter = new HashMap<String, String>();
    mapParameter.put("approveSegment", "approveSelectSegment");
    menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null, "net.heartsome.cat.ts.ui.xliffeditor.nattable.command.ApproveSelectSegment", mapParameter, Activator.getImageDescriptor("images/state/approved.png"), null, null, Messages.getString("menu.BodyMenuConfiguration.approveItem"), null, null, CommandContributionItem.STYLE_PUSH, null, false)));
    menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null, "net.heartsome.cat.ts.ui.xliffeditor.nattable.command.signedOff", Collections.EMPTY_MAP, Activator.getImageDescriptor("images/state/sign-off.png"), null, null, Messages.getString("menu.BodyMenuConfiguration.signItem"), null, null, CommandContributionItem.STYLE_PUSH, null, false)));
    menuMgr.add(new Separator());
    menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null, "net.heartsome.cat.ts.ui.xliffeditor.menu.translation.lockSegment.command.lockSegment", Collections.EMPTY_MAP, Activator.getImageDescriptor("images/state/locked.png"), null, null, Messages.getString("menu.BodyMenuConfiguration.isLockItem"), null, null, CommandContributionItem.STYLE_PUSH, null, false)));
    menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null, "net.heartsome.cat.ts.ui.xliffeditor.nattable.command.needReview", Collections.EMPTY_MAP, Activator.getImageDescriptor("images/state/questioning.png"), null, null, Messages.getString("menu.BodyMenuConfiguration.problemItem"), null, null, CommandContributionItem.STYLE_PUSH, null, false)));
    menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null, "net.heartsome.cat.ts.ui.xliffeditor.nattable.command.notSendToTM", Collections.EMPTY_MAP, Activator.getImageDescriptor("images/state/not-sent-db.png"), null, null, Messages.getString("menu.BodyMenuConfiguration.disAddToTMItem"), null, null, CommandContributionItem.STYLE_PUSH, null, false)));
    menuMgr.add(new Separator());
    menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null, "net.heartsome.cat.ts.ui.xliffeditor.nattable.command.AddNote", Collections.EMPTY_MAP, Activator.getImageDescriptor(ImageConstant.TU_STATE_ADDNOTE), null, null, Messages.getString("menu.BodyMenuConfiguration.addNoteItem"), null, null, CommandContributionItem.STYLE_PUSH, null, false)));
    menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null, "net.heartsome.cat.ts.ui.xliffeditor.nattable.command.EditNote", Collections.EMPTY_MAP, Activator.getImageDescriptor(ImageConstant.TU_STATE_EDITNOTE), null, null, Messages.getString("menu.BodyMenuConfiguration.editNoteItem"), null, null, CommandContributionItem.STYLE_PUSH, null, false)));
    menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null, "net.heartsome.cat.ts.ui.xliffeditor.menu.translateContent.command.deleteCurrentSegmentNotes", Collections.EMPTY_MAP, Activator.getImageDescriptor(ImageConstant.TU_STATE_DELETENOTE), null, null, Messages.getString("menu.BodyMenuConfiguration.deleteNoteItem"), null, null, CommandContributionItem.STYLE_PUSH, null, false)));
    menuMgr.add(new Separator());
    menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null, "net.heartsome.cat.ts.ui.xliffeditor.menu.translateContent.command.deleteCurrentSegmentTranslations", Collections.EMPTY_MAP, Activator.getImageDescriptor(ImageConstant.TU_STATE_DELETETRANS), null, null, Messages.getString("menu.BodyMenuConfiguration.deleteTransItem"), null, null, CommandContributionItem.STYLE_PUSH, null, false)));
    if (CommonFunction.checkEdition("F") || CommonFunction.checkEdition("U")) {
        menuMgr.add(new Separator());
        menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null, "net.heartsome.cat.ts.handlexlf.commands.setSplitPointByWordNumCommand", Collections.EMPTY_MAP, null, null, null, Messages.getString("menu.BodyMenuConfiguration.setSplitPointByWordNum"), null, null, CommandContributionItem.STYLE_PUSH, null, false)));
        menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null, "net.heartsome.cat.ts.handlexlf.commands.nextSplitPointCommand", Collections.EMPTY_MAP, null, null, null, Messages.getString("menu.BodyMenuConfiguration.nextSplitPoint"), null, null, CommandContributionItem.STYLE_PUSH, null, false)));
        menuMgr.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(), null, "net.heartsome.cat.ts.ui.xliffeditor.nattable.command.splitXLIFFPoint", Collections.EMPTY_MAP, Activator.getImageDescriptor("images/state/cut-point.png"), null, null, Messages.getString("menu.BodyMenuConfiguration.splitPointItem"), null, null, CommandContributionItem.STYLE_PUSH, null, false)));
    }
}
Also used : HashMap(java.util.HashMap) CommandContributionItemParameter(org.eclipse.ui.menus.CommandContributionItemParameter) MenuManager(org.eclipse.jface.action.MenuManager) CommandContributionItem(org.eclipse.ui.menus.CommandContributionItem) Separator(org.eclipse.jface.action.Separator)

Example 43 with Separator

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

the class TmMatchEditorBodyMenu method createMenu.

private void createMenu() {
    MenuManager menuMgr = new MenuManager();
    bodyMenu = menuMgr.createContextMenu(viewer.getControl());
    copyAction = new CopyAction();
    cutAction = new CutAction();
    pasteAction = new PasteAction();
    undoAction = new UndoAction();
    redoAction = new RedoAction();
    menuMgr.add(undoAction);
    menuMgr.add(redoAction);
    menuMgr.add(new Separator());
    menuMgr.add(copyAction);
    menuMgr.add(cutAction);
    menuMgr.add(pasteAction);
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) Separator(org.eclipse.jface.action.Separator)

Example 44 with Separator

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

the class ApplicationActionBarAdvisor method createEditMenu.

/**
	 * 创建编辑菜单
	 * @return 返回编辑菜单的 menu manager;
	 */
private MenuManager createEditMenu() {
    MenuManager menu = new MenuManager(Messages.getString("ts.ApplicationActionBarAdvisor.menu.edit"), // &Edit
    IWorkbenchActionConstants.M_EDIT);
    menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_START));
    // menu.add(undoAction);
    // menu.add(redoAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT));
    menu.add(new Separator());
    menu.add(cutAction);
    menu.add(copyAction);
    menu.add(pasteAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));
    // menu.add(deleteAction);
    menu.add(renameAction);
    menu.add(new Separator());
    menu.add(findAction);
    menu.add(selectAllAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.FIND_EXT));
    // menu.add(new Separator());
    // menu.add(preferenceAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_END));
    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)

Example 45 with Separator

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

the class ViewValuePanel method fillToolBar.

private void fillToolBar(final IContributionManager contributionManager) {
    contributionManager.add(new Separator());
    //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(ActionUtils.makeCommandContribution(presentation.getController().getSite(), ValueViewCommandHandler.CMD_SAVE_VALUE));
    contributionManager.add(new Action("Auto-save value", Action.AS_CHECK_BOX) {

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

        @Override
        public boolean isChecked() {
            return DBeaverCore.getGlobalPreferenceStore().getBoolean(DBeaverPreferences.RS_EDIT_AUTO_UPDATE_VALUE);
        }

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

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