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);
}
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);
}
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);
}
use of org.eclipse.jface.action.GroupMarker in project org.csstudio.display.builder by kasemir.
the class DataBrowserEditor method fillContextMenu.
/**
* Dynamically fill context menu
* @param manager
*/
private void fillContextMenu(final IMenuManager manager) {
final Activator activator = Activator.getDefault();
final Shell shell = getSite().getShell();
final UndoableActionManager op_manager = plot.getPlot().getUndoableActionManager();
manager.add(toggle_toolbar);
manager.add(toggle_legend);
manager.add(new Separator());
manager.add(new AddPVAction(op_manager, shell, model, false));
manager.add(new AddPVAction(op_manager, shell, model, true));
final boolean is_rcp = SingleSourcePlugin.getUIHelper().getUI() == UI.RCP;
if (is_rcp) {
try {
for (IAction imp : SampleImporters.createImportActions(op_manager, shell, model)) manager.add(imp);
} catch (Exception ex) {
ExceptionDetailsErrorDialog.openError(shell, Messages.Error, ex);
}
}
manager.add(new RemoveUnusedAxesAction(op_manager, model));
manager.add(new RefreshAction(controller));
manager.add(new Separator());
manager.add(new OpenPropertiesAction());
manager.add(new OpenViewAction(SearchView.ID, Messages.OpenSearchView, activator.getImageDescriptor("icons/search.gif")));
if (is_rcp)
manager.add(new OpenViewAction(ExportView.ID, Messages.OpenExportView, activator.getImageDescriptor("icons/export.png")));
manager.add(new OpenViewAction(SampleView.ID, Messages.InspectSamples, activator.getImageDescriptor("icons/inspect.gif")));
manager.add(new OpenPerspectiveAction(activator.getImageDescriptor("icons/databrowser.png"), Messages.OpenDataBrowserPerspective, Perspective.ID));
manager.add(new OpenViewAction(WaveformView.ID, Messages.OpenWaveformView, activator.getImageDescriptor("icons/wavesample.gif")));
manager.add(new Separator());
manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
if (is_rcp) {
manager.add(new Separator());
manager.add(snapshot);
if (EMailSender.isEmailSupported())
manager.add(new SendEMailAction(shell, plot.getPlot()));
manager.add(new PrintAction(shell, plot.getPlot()));
if (SendToElogAction.isElogAvailable())
manager.add(new SendToElogAction(shell, plot.getPlot()));
}
}
use of org.eclipse.jface.action.GroupMarker in project org.csstudio.display.builder by kasemir.
the class ContextMenuSupport method fillContextMenu.
private void fillContextMenu(final IMenuManager manager) {
final Widget context_menu_widget = view.getActiveWidget();
if (context_menu_widget == null) {
logger.log(Level.WARNING, "Missing context_menu_widget");
manager.add(new Action("No widget") {
});
} else {
// Widget info
manager.add(new WidgetInfoAction(context_menu_widget));
// Actions of the widget
for (ActionInfo info : context_menu_widget.propActions().getValue().getActions()) {
if (info.getType() == ActionType.OPEN_DISPLAY) {
// Add variant for all the available Target types: Replace, new Tab, ...
final OpenDisplayActionInfo open_info = (OpenDisplayActionInfo) info;
for (Target target : Target.values()) {
// STANDALONE can be achieved via StandaloneAction on new display
if (target == Target.STANDALONE)
continue;
final String desc = target == Target.REPLACE ? open_info.getDescription() : open_info.getDescription() + " (" + target + ")";
manager.add(new ActionInfoWrapper(context_menu_widget, new OpenDisplayActionInfo(desc, open_info.getFile(), open_info.getMacros(), target)));
}
} else
manager.add(new ActionInfoWrapper(context_menu_widget, info));
}
// Actions of the widget runtime
final WidgetRuntime<Widget> runtime = RuntimeUtil.getRuntime(context_menu_widget);
if (runtime == null)
throw new NullPointerException("Missing runtime for " + context_menu_widget);
for (RuntimeAction info : runtime.getRuntimeActions()) manager.add(new RuntimeActionWrapper(context_menu_widget, info));
}
// Placeholder for ProcessVariable object contributions
manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
manager.add(new Separator());
if (context_menu_widget != null) {
final Node node = JFXBaseRepresentation.getJFXNode(context_menu_widget);
final Scene scene = node.getScene();
manager.add(new SaveSnapshotAction(shell, scene));
manager.add(new PrintAction(shell, scene));
manager.add(new SendEMailAction(shell, scene));
manager.add(new SendLogbookAction(shell, scene));
manager.add(new FullScreenAction(view.getSite().getPage()));
if (support_standalone)
manager.add(new StandaloneAction(view));
}
// Placeholder for the display editor.
// If editor.rcp plugin is included, it adds "Open in editor"
manager.add(new Separator("display_editor"));
manager.add(new ReloadDisplayAction());
}
Aggregations