tmf: Refactor bookmarks file handling
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / trace / TmfTraceContext.java
index 58f99b0abc482c0393c6f126b41084c43bc2e1be..b2a3e689f21b9256d0c1371c292d8f44bdd99748 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2013 Ericsson
+ * Copyright (c) 2013, 2014 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -14,6 +14,7 @@
 
 package org.eclipse.linuxtools.tmf.core.trace;
 
+import org.eclipse.core.resources.IFile;
 import org.eclipse.linuxtools.tmf.core.filter.ITmfFilter;
 import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
@@ -31,27 +32,31 @@ import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
 final class TmfTraceContext {
 
     static final TmfTraceContext NULL_CONTEXT =
-            new TmfTraceContext(TmfTimestamp.BIG_CRUNCH, TmfTimestamp.BIG_CRUNCH, TmfTimeRange.NULL_RANGE);
+            new TmfTraceContext(TmfTimestamp.BIG_CRUNCH, TmfTimestamp.BIG_CRUNCH, TmfTimeRange.NULL_RANGE, null);
 
     private final TmfTimeRange fSelection;
     private final TmfTimeRange fWindowRange;
+    private final IFile fEditorFile;
     private final ITmfFilter fFilter;
 
-    public TmfTraceContext(ITmfTimestamp beginTs, ITmfTimestamp endTs, TmfTimeRange tr) {
+    public TmfTraceContext(ITmfTimestamp beginTs, ITmfTimestamp endTs, TmfTimeRange tr, IFile editorFile) {
         fSelection = new TmfTimeRange(beginTs, endTs);
         fWindowRange = tr;
+        fEditorFile = editorFile;
         fFilter = null;
     }
 
     public TmfTraceContext(TmfTraceContext prevCtx, ITmfTimestamp beginTs, ITmfTimestamp endTs) {
         fSelection = new TmfTimeRange(beginTs, endTs);
         fWindowRange = prevCtx.fWindowRange;
+        fEditorFile = prevCtx.fEditorFile;
         fFilter = prevCtx.fFilter;
     }
 
     public TmfTraceContext(TmfTraceContext prevCtx, TmfTimeRange tr) {
         fSelection = prevCtx.fSelection;
         fWindowRange = tr;
+        fEditorFile = prevCtx.fEditorFile;
         fFilter = prevCtx.fFilter;
     }
 
@@ -65,6 +70,7 @@ final class TmfTraceContext {
     public TmfTraceContext(TmfTraceContext prevCtx, ITmfFilter filter) {
         fSelection = prevCtx.fSelection;
         fWindowRange = prevCtx.fWindowRange;
+        fEditorFile = prevCtx.fEditorFile;
         fFilter = filter;
     }
 
@@ -80,6 +86,10 @@ final class TmfTraceContext {
         return fWindowRange;
     }
 
+    public IFile getEditorFile() {
+        return fEditorFile;
+    }
+
     /**
      * @return the current filter applied to the trace
      * @since 2.2
This page took 0.02638 seconds and 5 git commands to generate.