Search in sources :

Example 76 with GroupMarker

use of org.eclipse.jface.action.GroupMarker 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 77 with GroupMarker

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

the class ApplicationActionBarAdvisor method fillCoolBar.

@Override
protected void fillCoolBar(ICoolBarManager coolBar) {
    // Set up the context Menu
    coolbarPopupMenuManager = new MenuManager();
    coolbarPopupMenuManager.add(new ActionContributionItem(lockToolBarAction));
    coolBar.setContextMenuManager(coolbarPopupMenuManager);
    IMenuService menuService = (IMenuService) window.getService(IMenuService.class);
    menuService.populateContributionManager(coolbarPopupMenuManager, "popup:windowCoolbarContextMenu");
    coolBar.add(new GroupMarker("group.file"));
    // File Group
    // IToolBarManager fileToolBar = new ToolBarManager(coolBar.getStyle());
    // fileToolBar.add(new Separator(IWorkbenchActionConstants.NEW_GROUP));
    // fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.OPEN_EXT));
    // fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.SAVE_GROUP));
    // // 为了使工具栏和菜单中的图片大小不一样,重新创建新建 Action
    // newAction = ActionFactory.NEW_WIZARD_DROP_DOWN.create(window);
    // register(newAction);
    // ImageDescriptor newImage =
    // net.heartsome.cat.ts.ui.Activator.getImageDescriptor(ImageConstant.TOOL_NEW_PROJECT);
    // newAction.setImageDescriptor(newImage);
    // // 解决在 Windows 下图片显示错误的问题
    // newAction.setDisabledImageDescriptor(newImage);
    // newAction.setToolTipText(Messages.getString("ts.ApplicationActionBarAdvisor.newAction"));
    // fileToolBar.add(newAction);
    // saveAction = ActionFactory.SAVE.create(window);
    // register(saveAction);
    // saveAction.setImageDescriptor(net.heartsome.cat.ts.ui.Activator.getImageDescriptor(ImageConstant.TOOL_SAVE));
    // saveAction.setToolTipText("保存");
    // fileToolBar.add(saveAction);
    // undoAction = ActionFactory.UNDO.create(window);
    // register(undoAction);
    // undoAction.setImageDescriptor(net.heartsome.cat.ts.ui.Activator.getImageDescriptor(ImageConstant.TOOL_UNDO));
    // undoAction.setToolTipText("撤销");
    // fileToolBar.add(undoAction);
    //
    // redoAction = ActionFactory.REDO.create(window);
    // register(redoAction);
    // redoAction.setImageDescriptor(net.heartsome.cat.ts.ui.Activator.getImageDescriptor(ImageConstant.TOOL_REDO));
    // redoAction.setToolTipText("重做");
    // fileToolBar.add(redoAction);
    // fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
    // 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("group.new.menu"));
    coolBar.add(new GroupMarker("group.undoredo"));
    coolBar.add(new GroupMarker("group.copySource"));
    coolBar.add(new GroupMarker("group.search"));
    //createToolItem(coolBar);
    coolBar.add(new GroupMarker("group.findreplace"));
    coolBar.add(new GroupMarker("group.completeTranslation"));
    coolBar.add(new GroupMarker("group.approve"));
    coolBar.add(new GroupMarker("group.addTerm"));
    coolBar.add(new GroupMarker("group.preview"));
    coolBar.add(new GroupMarker("group.tagoperation"));
    coolBar.add(new GroupMarker("group.sourceoperation"));
    coolBar.add(new GroupMarker("group.deleteTrans"));
    coolBar.add(new GroupMarker("group.changeLayout"));
    coolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    coolBar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_EDITOR));
    coolBar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_HELP));
// Help group
// IToolBarManager helpToolBar = new ToolBarManager(coolBar.getStyle());
// helpToolBar.add(new Separator(IWorkbenchActionConstants.GROUP_HELP));
// // 按照设计文档的要求,先注释 helpSearchAction
// // helpToolBar.add(helpSearchAction);
// // Add the group for applications to contribute
// helpToolBar.add(new GroupMarker("tagoperation"));
// helpToolBar.add(new GroupMarker("pretranslation"));
//
// // Add to the cool bar manager
// coolBar.add(new ToolBarContributionItem(helpToolBar, IWorkbenchActionConstants.TOOLBAR_HELP));
//coolBar.add(createToolItem(coolBar));
}
Also used : ActionContributionItem(org.eclipse.jface.action.ActionContributionItem) IMenuService(org.eclipse.ui.menus.IMenuService) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) GroupMarker(org.eclipse.jface.action.GroupMarker)

Example 78 with GroupMarker

use of org.eclipse.jface.action.GroupMarker in project cubrid-manager by CUBRID.

the class ApplicationActionBarAdvisor method fillMenuBar.

/**
	 * Fills the menu bar with the main menus for the window.
	 *
	 * @param menuBar the menu bar manager
	 */
protected void fillMenuBar(IMenuManager menuManager) {
    ActionManager manager = ActionManager.getInstance();
    MenuManager helpMenu = new MenuManager(Messages.mnu_helpMneuName, IWorkbenchActionConstants.M_HELP);
    helpMenu.add(manager.getAction(HelpDocumentAction.ID));
    // fill in help menu
    if ("ko".equals(Messages.language)) {
        helpMenu.add(newFeatureAction);
    }
    helpMenu.add(new Separator());
    helpMenu.add(reportBugAction);
    helpMenu.add(new Separator());
    helpMenu.add(cubridOnlineForumAction);
    helpMenu.add(cubridProjectSiteAction);
    helpMenu.add(new Separator());
    helpMenu.add(new GroupMarker("updates"));
    helpMenu.add(new Separator());
    helpMenu.add(manager.getAction(ViewServerVersionAction.ID));
    helpMenu.add(new Separator());
    ActionContributionItem aboutActionItem = new ActionContributionItem(aboutAction);
    helpMenu.add(aboutActionItem);
    if (Util.isMac()) {
        aboutActionItem.setVisible(false);
    }
    menuManager.add(helpMenu);
}
Also used : ActionManager(com.cubrid.common.ui.spi.action.ActionManager) ActionContributionItem(org.eclipse.jface.action.ActionContributionItem) 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 79 with GroupMarker

use of org.eclipse.jface.action.GroupMarker in project tdi-studio-se by Talend.

the class ApplicationActionBarAdvisor method fillMenuBar.

protected void fillMenuBar(IMenuManager menuBar) {
    MenuManager fileMenu = new MenuManager(Messages.getString("ApplicationActionBarAdvisor.fileMenu"), //$NON-NLS-1$
    IWorkbenchActionConstants.M_FILE);
    MenuManager windowMenu = new MenuManager(Messages.getString("ApplicationActionBarAdvisor.windowMenu"), //$NON-NLS-1$
    IWorkbenchActionConstants.M_WINDOW);
    MenuManager helpMenu = new MenuManager(Messages.getString("ApplicationActionBarAdvisor.helpMenu"), //$NON-NLS-1$
    IWorkbenchActionConstants.M_HELP);
    menuBar.add(fileMenu);
    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(new Separator());
    fileMenu.add(ActionFactory.SAVE.create(window));
    fileMenu.add(exitAction);
    // Window
    windowMenu.add(preferenceAction);
    windowMenu.add(new ShowViewAction());
    // Help
    helpMenu.add(aboutAction);
}
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 80 with GroupMarker

use of org.eclipse.jface.action.GroupMarker in project eclipse.platform.text by eclipse.

the class SearchPlugin method createStandardGroups.

/**
 * Creates the Search plugin standard groups in a context menu.
 *
 * @param menu the menu to create in
 * @deprecated old search
 */
@Deprecated
public static void createStandardGroups(IMenuManager menu) {
    if (!menu.isEmpty())
        return;
    menu.add(new Separator(IContextMenuConstants.GROUP_NEW));
    menu.add(new GroupMarker(IContextMenuConstants.GROUP_GOTO));
    menu.add(new GroupMarker(IContextMenuConstants.GROUP_OPEN));
    menu.add(new Separator(IContextMenuConstants.GROUP_SHOW));
    menu.add(new Separator(IContextMenuConstants.GROUP_BUILD));
    menu.add(new Separator(IContextMenuConstants.GROUP_REORGANIZE));
    menu.add(new Separator(IContextMenuConstants.GROUP_REMOVE_MATCHES));
    menu.add(new GroupMarker(IContextMenuConstants.GROUP_GENERATE));
    menu.add(new Separator(IContextMenuConstants.GROUP_SEARCH));
    menu.add(new Separator(IContextMenuConstants.GROUP_ADDITIONS));
    menu.add(new Separator(IContextMenuConstants.GROUP_VIEWER_SETUP));
    menu.add(new Separator(IContextMenuConstants.GROUP_PROPERTIES));
}
Also used : GroupMarker(org.eclipse.jface.action.GroupMarker) Separator(org.eclipse.jface.action.Separator)

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