use of com.amalto.workbench.editors.actions.DeleteItemsAction 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);
}
Aggregations