Re-structure LTTng sub-project as per the Linux Tools guidelines
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / lttng / ui / views / timeframe / SpinnerGroup.java
index f8e9c3d605159744272992aa952185d7a80c9545..50aef6671283209d1320a83c689225d79ad4acdd 100644 (file)
@@ -12,8 +12,8 @@
 
 package org.eclipse.linuxtools.lttng.ui.views.timeframe;
 
-import org.eclipse.linuxtools.tmf.event.TmfTimeRange;
-import org.eclipse.linuxtools.tmf.event.TmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
+import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
@@ -43,8 +43,8 @@ public class SpinnerGroup {
     private static final byte NS_SCALING_FACTOR = -9;
 
     // Labels
-    private static final String SECONDS_LABEL = "sec";
-    private static final String NANOSEC_LABEL = "ns";
+    private static final String SECONDS_LABEL = "sec"; //$NON-NLS-1$
+    private static final String NANOSEC_LABEL = "ns"; //$NON-NLS-1$
 
     // Widgets
     private Group group;
@@ -66,6 +66,7 @@ public class SpinnerGroup {
     private int currentSeconds;
     private int currentNanosec;
     
+       @SuppressWarnings("unused")
        private TimeFrameView fOwner;
 
     /**
@@ -96,7 +97,8 @@ public class SpinnerGroup {
         // Create and position the widgets
         seconds = new Spinner(group, SWT.BORDER);
         seconds.addModifyListener(new ModifyListener() {
-            public void modifyText(ModifyEvent e) {
+            @Override
+                       public void modifyText(ModifyEvent e) {
                 currentSeconds = seconds.getSelection();
                 refreshCurrentTime();
             }
@@ -109,7 +111,8 @@ public class SpinnerGroup {
 
         nanosec = new Spinner(group, SWT.BORDER);
         nanosec.addModifyListener(new ModifyListener() {
-            public void modifyText(ModifyEvent e) {
+            @Override
+                       public void modifyText(ModifyEvent e) {
                 currentNanosec = nanosec.getSelection();
                 // Correct for nanosec underflow
                 if (currentNanosec < 0) {
@@ -157,7 +160,7 @@ public class SpinnerGroup {
     }
 
     public TmfTimestamp getSpan() {
-        TmfTimestamp span = new TmfTimestamp(startTime.getAdjustment(endTime), NS_SCALING_FACTOR, 0);
+        TmfTimestamp span = new TmfTimestamp(startTime.getAdjustment(endTime, NS_SCALING_FACTOR), NS_SCALING_FACTOR, 0);
         return span;
     }
 
@@ -274,8 +277,11 @@ public class SpinnerGroup {
      * Perform the update on the UI thread
      */
     public void updateSpinners() {
-
+       // Ignore update if disposed
+       if (seconds.isDisposed()) return;
+       
         seconds.getDisplay().asyncExec(new Runnable() {
+                       @Override
                        public void run() {
                                if (!seconds.isDisposed() && !nanosec.isDisposed()) {
                            // If we are on the start second, ensure that [currentNS >= startNS]
This page took 0.025051 seconds and 5 git commands to generate.