예제 #1
0
  @Override
  public void start(BundleContext context) throws Exception {
    super.start(context);
    plugin = this;
    TmfUiRefreshHandler.getInstance(); // to classload/initialize it
    TmfUiTracer.init();
    TmfTraceElement.init();
    TmfExperimentElement.init();

    fTmfEventAdapterFactory = new TmfEventAdapterFactory();
    Platform.getAdapterManager().registerAdapters(fTmfEventAdapterFactory, ITmfEvent.class);
    fLostEventMarkerEventSourceFactory = new LostEventsMarkerEventSourceFactory();
    TmfTraceAdapterManager.registerFactory(fLostEventMarkerEventSourceFactory, ITmfTrace.class);
  }
  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {

    // Check if we are closing down
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (window == null) {
      return null;
    }

    // Fire the Select Traces Wizard
    IWorkbench workbench = PlatformUI.getWorkbench();
    Shell shell = workbench.getActiveWorkbenchWindow().getShell();
    TmfExperimentElement experiment = fExperiment;
    if (experiment != null) {
      TmfExperimentFolder experiments = (TmfExperimentFolder) experiment.getParent();
      TmfProjectElement project = (TmfProjectElement) experiments.getParent();
      SelectTracesWizard wizard = new SelectTracesWizard(project, experiment);
      wizard.init(PlatformUI.getWorkbench(), null);
      WizardDialog dialog = new WizardDialog(shell, wizard);
      dialog.open();
    }

    return null;
  }