lttng/tmf: add a "unit-less" representation of time in timechart
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / widgets / timegraph / widgets / Utils.java
index 92bd9e799a21496ba3cfe4ba86b362a3b8cf75c5..7b06092208ca91469f760e74b4b680c7facd32dd 100644 (file)
@@ -15,6 +15,7 @@
 
 package org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets;
 
+import java.text.NumberFormat;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.Iterator;
@@ -42,7 +43,9 @@ public class Utils {
         /** Relative to the start of the trace */
         RELATIVE,
         /** Absolute timestamp (ie, relative to the Unix epoch) */
-        ABSOLUTE
+        CALENDAR,
+        /** timestamp displayed as a simple number */
+        NUMBER,
     }
 
     static public final int IMG_THREAD_RUNNING = 0;
@@ -299,8 +302,10 @@ public class Utils {
      */
     static public String formatTime(long time, TimeFormat format, Resolution resolution) {
         // if format is absolute (Calendar)
-        if (format == TimeFormat.ABSOLUTE) {
+        if (format == TimeFormat.CALENDAR) {
             return formatTimeAbs(time, resolution);
+        } else if (format == TimeFormat.NUMBER) {
+            return NumberFormat.getInstance().format(time);
         }
 
         StringBuffer str = new StringBuffer();
This page took 0.030772 seconds and 5 git commands to generate.