Пример #1
0
 /** @since 2.1 */
 @Override
 public void gotoMarker(IMarker marker) {
   if (fTrace == null || fEventsTable == null) {
     fPendingGotoMarker = marker;
   } else {
     fEventsTable.gotoMarker(marker);
   }
 }
Пример #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();
    }
  }