Search in sources :

Example 1 with GroupMarker

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

Example 2 with GroupMarker

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

the class ApplicationActionBarAdvisor method createFileMenu.

/**
	 * 创建文件菜单
	 * @return 返回文件菜单的 menu manager;
	 */
private MenuManager createFileMenu() {
    MenuManager menu = new MenuManager(Messages.getString("ts.ApplicationActionBarAdvisor.menu.file"), // &File
    IWorkbenchActionConstants.M_FILE);
    menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
    // 添加 new.ext group,这样 IDE 中定义的 Open File... 可以显示在最顶端
    // menu.add(newAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));
    menu.add(new Separator());
    menu.add(closeAction);
    menu.add(closeAllAction);
    menu.add(refreshAction);
    // menu.add(new Separator("net.heartsome.cat.ts.ui.menu.file.separator"));
    menu.add(new GroupMarker("xliff.switch"));
    menu.add(new GroupMarker("rtf.switch"));
    menu.add(new GroupMarker("xliff.split"));
    menu.add(new Separator());
    // 设置保存文件记录条数为 5 条
    WorkbenchPlugin.getDefault().getPreferenceStore().setValue(IPreferenceConstants.RECENT_FILES, 5);
    // 添加文件访问列表
    ContributionItemFactory REOPEN_EDITORS = new //$NON-NLS-1$
    ContributionItemFactory(//$NON-NLS-1$
    "reopenEditors") {

        /* (non-javadoc) method declared on ContributionItemFactory */
        public IContributionItem create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            return new ReopenEditorMenu(window, getId(), false);
        }
    };
    menu.add(REOPEN_EDITORS.create(window));
    menu.add(exitAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
    return menu;
}
Also used : ContributionItemFactory(org.eclipse.ui.actions.ContributionItemFactory) IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) ReopenEditorMenu(org.eclipse.ui.internal.ReopenEditorMenu) 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 3 with GroupMarker

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

the class ApplicationActionBarAdvisor method fillMenuBar.

@Override
protected void fillMenuBar(IMenuManager menuBar) {
    menuBar.add(createFileMenu());
    menuBar.add(createEditMenu());
    menuBar.add(new GroupMarker("view"));
    menuBar.add(new GroupMarker("translation"));
    menuBar.add(new GroupMarker("project"));
    menuBar.add(new GroupMarker("database"));
    menuBar.add(new GroupMarker("qa"));
    menuBar.add(createToolMenu());
    menuBar.add(new GroupMarker("advance"));
    // menuBar.add(createAutoPluginMenu());
    menuBar.add(createHelpMenu());
}
Also used : GroupMarker(org.eclipse.jface.action.GroupMarker)

Example 4 with GroupMarker

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

the class TextSearchGroup method fillContextMenu.

@Override
public void fillContextMenu(IMenuManager menu) {
    MenuManager textSearchMM = new MenuManager(fMenuText, CTX_MENU_ID);
    int i = 0;
    for (i = 0; i < fActions.length - 1; i++) {
        textSearchMM.add(fActions[i]);
    }
    textSearchMM.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    textSearchMM.add(new Separator());
    textSearchMM.add(fActions[i]);
    menu.appendToGroup(fAppendToGroup, textSearchMM);
}
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 5 with GroupMarker

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

the class SearchView method createToolBarGroups.

/**
 * Creates the groups and separators for the search view's
 * tool bar
 *
 * @param toolbar the toolbar
 */
public static void createToolBarGroups(IToolBarManager toolbar) {
    toolbar.add(new Separator(IContextMenuConstants.GROUP_NEW));
    toolbar.add(new GroupMarker(IContextMenuConstants.GROUP_GOTO));
    toolbar.add(new GroupMarker(IContextMenuConstants.GROUP_OPEN));
    toolbar.add(new Separator(IContextMenuConstants.GROUP_SHOW));
    toolbar.add(new Separator(IContextMenuConstants.GROUP_BUILD));
    toolbar.add(new Separator(IContextMenuConstants.GROUP_REORGANIZE));
    toolbar.add(new Separator(IContextMenuConstants.GROUP_EDIT));
    toolbar.add(new GroupMarker(IContextMenuConstants.GROUP_REMOVE_MATCHES));
    toolbar.add(new GroupMarker(IContextMenuConstants.GROUP_GENERATE));
    toolbar.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    toolbar.add(new Separator(IContextMenuConstants.GROUP_VIEWER_SETUP));
    toolbar.add(new Separator(IContextMenuConstants.GROUP_PROPERTIES));
    toolbar.add(new Separator(IContextMenuConstants.GROUP_SEARCH));
}
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