Search in sources :

Example 71 with GroupMarker

use of org.eclipse.jface.action.GroupMarker in project core by jcryptool.

the class ApplicationActionBarAdvisor method fillCoolBar.

@Override
protected void fillCoolBar(ICoolBarManager coolBar) {
    // ToolBar File & Additions
    IToolBarManager fileToolBar = new ToolBarManager(coolBar.getStyle());
    IServiceLocator serviceLocator = PlatformUI.getWorkbench();
    fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
    fileToolBar.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.FILE_SAVE));
    fileToolBar.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.FILE_SAVE_ALL));
    fileToolBar.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.FILE_PRINT));
    fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
    fileToolBar.add(new Separator());
    fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    // $NON-NLS-1$
    coolBar.add(new ToolBarContributionItem(fileToolBar, CorePlugin.PLUGIN_ID + ".toolbar"));
    // ToolBar Help
    IToolBarManager helpToolBar = new ToolBarManager(coolBar.getStyle());
    // $NON-NLS-1$
    coolBar.add(new ToolBarContributionItem(helpToolBar, CorePlugin.PLUGIN_ID + ".helpToolBar"));
    // CoolBar Context Menu
    // $NON-NLS-1$
    MenuManager coolBarContextMenuManager = new MenuManager(null, CorePlugin.PLUGIN_ID + ".contextMenu");
    coolBar.setContextMenuManager(coolBarContextMenuManager);
    coolBarContextMenuManager.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.WINDOW_LOCK_TOOLBAR));
    coolBarContextMenuManager.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.WINDOW_CUSTOMIZE_PERSPECTIVE));
    coolBarContextMenuManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}
Also used : ToolBarContributionItem(org.eclipse.jface.action.ToolBarContributionItem) IToolBarManager(org.eclipse.jface.action.IToolBarManager) IServiceLocator(org.eclipse.ui.services.IServiceLocator) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) GroupMarker(org.eclipse.jface.action.GroupMarker) IToolBarManager(org.eclipse.jface.action.IToolBarManager) ToolBarManager(org.eclipse.jface.action.ToolBarManager) Separator(org.eclipse.jface.action.Separator)

Example 72 with GroupMarker

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

the class DataClusterDialog method hookContextMenu.

private void hookContextMenu() {
    MenuManager menuMgr = new MenuManager();
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        public void menuAboutToShow(IMenuManager manager) {
            manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
            manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new NewItemAction(site.getShell()));
        }
    });
    Menu menu = menuMgr.createContextMenu(clusterComposite.getResultsViewer().getControl());
    clusterComposite.getResultsViewer().getControl().setMenu(menu);
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) GroupMarker(org.eclipse.jface.action.GroupMarker) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu) IMenuListener(org.eclipse.jface.action.IMenuListener)

Example 73 with GroupMarker

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

the class ItemsTrashBrowserMainPage method hookContextMenu.

private void hookContextMenu() {
    MenuManager menuMgr = new MenuManager();
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        public void menuAboutToShow(IMenuManager manager) {
            // ItemsTrashBrowserMainPage.this.fillContextMenu(manager);
            manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
            manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new RestoreAction(ItemsTrashBrowserMainPage.this.getSite().getShell(), ItemsTrashBrowserMainPage.this.resultsViewer));
            manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new RemoveAction(ItemsTrashBrowserMainPage.this.getSite().getShell(), ItemsTrashBrowserMainPage.this.resultsViewer));
        }
    });
    Menu menu = menuMgr.createContextMenu(resultsViewer.getControl());
    resultsViewer.getControl().setMenu(menu);
    getSite().registerContextMenu(menuMgr, resultsViewer);
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) GroupMarker(org.eclipse.jface.action.GroupMarker) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu) IMenuListener(org.eclipse.jface.action.IMenuListener)

Example 74 with GroupMarker

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

the class RoutingEngineV2BrowserMainPage method hookContextMenu.

private void hookContextMenu() {
    MenuManager menuMgr = new MenuManager();
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        public void menuAboutToShow(IMenuManager manager) {
            manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
            manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new EditItemAction(RoutingEngineV2BrowserMainPage.this.getSite().getShell(), RoutingEngineV2BrowserMainPage.this.resultsViewer));
            manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new DeleteItemsAction(RoutingEngineV2BrowserMainPage.this.getSite().getShell(), RoutingEngineV2BrowserMainPage.this, RoutingEngineV2BrowserMainPage.this.resultsViewer));
            manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new ExecuteRoutingOrdersAction(RoutingEngineV2BrowserMainPage.this.getSite().getShell(), RoutingEngineV2BrowserMainPage.this, RoutingEngineV2BrowserMainPage.this.resultsViewer, true));
            manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new ExecuteRoutingOrdersAction(RoutingEngineV2BrowserMainPage.this.getSite().getShell(), RoutingEngineV2BrowserMainPage.this, // asynchronously
            RoutingEngineV2BrowserMainPage.this.resultsViewer, // asynchronously
            false));
        }
    });
    Menu menu = menuMgr.createContextMenu(resultsViewer.getControl());
    resultsViewer.getControl().setMenu(menu);
    getSite().registerContextMenu(menuMgr, resultsViewer);
}
Also used : ExecuteRoutingOrdersAction(com.amalto.workbench.editors.actions.ExecuteRoutingOrdersAction) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) GroupMarker(org.eclipse.jface.action.GroupMarker) EditItemAction(com.amalto.workbench.editors.actions.EditItemAction) DeleteItemsAction(com.amalto.workbench.editors.actions.DeleteItemsAction) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu) IMenuListener(org.eclipse.jface.action.IMenuListener)

Example 75 with GroupMarker

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

the class ApplicationActionBarAdvisor method createToolMenu.

/**
	 * 创建工具菜单
	 * @return 返回工具菜单的 menu manager;
	 */
private MenuManager createToolMenu() {
    MenuManager menu = new MenuManager(Messages.getString("ts.ApplicationActionBarAdvisor.menu.tool"), // &Tool
    "net.heartsome.cat.ts.ui.menu.tool");
    menu.add(new GroupMarker("pluginConfigure"));
    menu.add(new GroupMarker("preference.groupMarker"));
    //		 menu.add(preferenceAction);
    return menu;
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) GroupMarker(org.eclipse.jface.action.GroupMarker)

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