Class TmfTraceContext

java.lang.Object
org.eclipse.tracecompass.tmf.core.trace.TmfTraceContext
All Implemented Interfaces:
ITraceContextSignalHandler
Direct Known Subclasses:
LinuxTraceContext

@NonNullByDefault public class TmfTraceContext extends Object implements ITraceContextSignalHandler
Context of a trace, which is the representation of the "view" the user currently has on this trace (window time range, selected time or time range). TODO could be extended to support the notion of current location too. FIXME Is this really the right place for the Editor File ?
Since:
1.0
Author:
Alexandre Montplaisir
  • Constructor Details

    • TmfTraceContext

      public TmfTraceContext(TmfTimeRange selection, TmfTimeRange windowRange, @Nullable org.eclipse.core.resources.IFile editorFile, @Nullable ITmfFilter filter)
      Build a new trace context.
      Parameters:
      selection - The selected time range
      windowRange - The visible window's time range
      editorFile - The file representing the selected editor
      filter - The currently applied filter. 'null' for none.
    • TmfTraceContext

      public TmfTraceContext(TmfTraceContext.Builder builder)
      Constructs a new trace context with data taken from a builder.
      Parameters:
      builder - the builder
      Since:
      2.3
  • Method Details

    • getSelectionRange

      public TmfTimeRange getSelectionRange()
      Return the time range representing the current active selection.
      Returns:
      The selected time range
    • getWindowRange

      public TmfTimeRange getWindowRange()
      Return the current window time range.
      Returns:
      The current window time range
    • isSynchronized

      public boolean isSynchronized()
      Gets whether the trace is time synchronized in selection and window range with other traces.
      Returns:
      true if the trace should be time synchronized, false otherwise
      Since:
      3.2
    • getInstanceNumber

      public int getInstanceNumber()
      Return the instance number of this trace.
      Returns:
      The instance number
      Since:
      3.2
    • getEditorFile

      public @Nullable org.eclipse.core.resources.IFile getEditorFile()
      Get the editor's file
      Returns:
      The editor file
    • getFilter

      public @Nullable ITmfFilter getFilter()
      Gets the filter applied to the current trace
      Returns:
      The current filter, or null if there is none
    • getData

      public @Nullable Object getData(String key)
      Get the data for the specific key
      Parameters:
      key - The id of the data
      Returns:
      The data or null if the key do not exist
      Since:
      2.1
    • getData

      public Map<String,Object> getData()
      Get a copy of the data map
      Returns:
      The data map copy
      Since:
      2.1
    • builder

      public TmfTraceContext.Builder builder()
      Returns a new builder that is initialized with the data from this trace context.
      Returns:
      the builder
      Since:
      2.3
    • toString

      public String toString()
      Overrides:
      toString in class Object