Example #1
0
 @Override
 public void dispose() {
   if (getSite() != null) {
     getSite().getPage().removePartListener(this);
   }
   ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
   removePropertyListener(this);
   if (fTrace != null) {
     broadcast(new TmfTraceClosedSignal(this, fTrace));
   }
   if (fEventsTable != null) {
     fEventsTable.dispose();
   }
   super.dispose();
 }
Example #2
0
  @Override
  public void propertyChanged(final Object source, final int propId) {
    if (propId == IEditorPart.PROP_INPUT && getEditorInput() instanceof TmfEditorInput) {
      if (fTrace != null) {
        broadcast(new TmfTraceClosedSignal(this, fTrace));
      }
      fTraceSelected = false;
      fFile = ((TmfEditorInput) getEditorInput()).getFile();
      fTrace = ((TmfEditorInput) getEditorInput()).getTrace();
      /* change the input to a FileEditorInput to allow open handlers to find this editor */
      super.setInput(new FileEditorInput(fFile));
      fEventsTable.dispose();
      if (fTrace != null) {
        setPartName(fTrace.getName());
        fEventsTable = createEventsTable(fParent, fTrace.getCacheSize());
        fEventsTable.addSelectionChangedListener(this);
        fEventsTable.setTrace(fTrace, true);
        fEventsTable.refreshBookmarks(fFile);
        if (fPendingGotoMarker != null) {
          fEventsTable.gotoMarker(fPendingGotoMarker);
          fPendingGotoMarker = null;
        }

        /* ensure start time is set */
        final ITmfContext context = fTrace.seekEvent(0);
        fTrace.getNext(context);
        context.dispose();

        broadcast(new TmfTraceOpenedSignal(this, fTrace, fFile));
      } else {
        setPartName(getEditorInput().getName());
        fEventsTable = new TmfEventsTable(fParent, 0);
        fEventsTable.addSelectionChangedListener(this);
      }
      fParent.layout();
    }
  }