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 be2a5e76226a8ce71d33e68872344462617a550e..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;
@@ -97,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();
             }
@@ -110,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) {
@@ -275,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.025346 seconds and 5 git commands to generate.