Search in sources :

Example 1 with ExecuteRoutingOrdersAction

use of com.amalto.workbench.editors.actions.ExecuteRoutingOrdersAction 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)

Aggregations

DeleteItemsAction (com.amalto.workbench.editors.actions.DeleteItemsAction)1 EditItemAction (com.amalto.workbench.editors.actions.EditItemAction)1 ExecuteRoutingOrdersAction (com.amalto.workbench.editors.actions.ExecuteRoutingOrdersAction)1 GroupMarker (org.eclipse.jface.action.GroupMarker)1 IMenuListener (org.eclipse.jface.action.IMenuListener)1 IMenuManager (org.eclipse.jface.action.IMenuManager)1 MenuManager (org.eclipse.jface.action.MenuManager)1 Menu (org.eclipse.swt.widgets.Menu)1