Search in sources :

Example 1 with Activator

use of com.reprezen.swagedit.openapi3.Activator 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()));
    }
}
Also used : OpenPerspectiveAction(org.csstudio.ui.util.perspective.OpenPerspectiveAction) IAction(org.eclipse.jface.action.IAction) OpenViewAction(org.csstudio.apputil.ui.workbench.OpenViewAction) PartInitException(org.eclipse.ui.PartInitException) Shell(org.eclipse.swt.widgets.Shell) RemoveUnusedAxesAction(org.csstudio.trends.databrowser3.propsheet.RemoveUnusedAxesAction) RefreshAction(org.csstudio.trends.databrowser3.ui.RefreshAction) Activator(org.csstudio.trends.databrowser3.Activator) UndoableActionManager(org.csstudio.display.builder.util.undo.UndoableActionManager) AddPVAction(org.csstudio.trends.databrowser3.ui.AddPVAction) GroupMarker(org.eclipse.jface.action.GroupMarker) Separator(org.eclipse.jface.action.Separator)

Aggregations

OpenViewAction (org.csstudio.apputil.ui.workbench.OpenViewAction)1 UndoableActionManager (org.csstudio.display.builder.util.undo.UndoableActionManager)1 Activator (org.csstudio.trends.databrowser3.Activator)1 RemoveUnusedAxesAction (org.csstudio.trends.databrowser3.propsheet.RemoveUnusedAxesAction)1 AddPVAction (org.csstudio.trends.databrowser3.ui.AddPVAction)1 RefreshAction (org.csstudio.trends.databrowser3.ui.RefreshAction)1 OpenPerspectiveAction (org.csstudio.ui.util.perspective.OpenPerspectiveAction)1 GroupMarker (org.eclipse.jface.action.GroupMarker)1 IAction (org.eclipse.jface.action.IAction)1 Separator (org.eclipse.jface.action.Separator)1 Shell (org.eclipse.swt.widgets.Shell)1 PartInitException (org.eclipse.ui.PartInitException)1