2010-06-05 fchouinard@gmail.com Contributions for bugs 292965, 292963, 293102,...
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / TmfEventsView.java
index c5901b08f8d511c2afc8e2fc7ab9d515841ce54a..bcc4c62e60bea1f4e632ae42d35df7a1b132bb6c 100644 (file)
@@ -150,7 +150,7 @@ public class TmfEventsView extends TmfView {
 
                        public void handleEvent(Event event) {
 
-                       TableItem item = (TableItem) event.item;
+                       final TableItem item = (TableItem) event.item;
                                final int index = fTable.indexOf(item);
 
                                // Note: this works because handleEvent() is called once for each row, in sequence  
@@ -176,15 +176,13 @@ public class TmfEventsView extends TmfView {
                                fExperiment.sendRequest(request);
                        try {
                                        request.waitForCompletion();
+                                       if (cache[0] != null && cacheStartIndex == index) {
+                                               item.setText(extractItemFields(cache[0]));
+                                               item.setData(new TmfTimestamp(cache[0].getTimestamp()));
+                                       }
                                } catch (InterruptedException e) {
                                        e.printStackTrace();
                                }
-                               
-                               if (cache[0] != null && cacheStartIndex == index) {
-                                       item.setText(extractItemFields(cache[0]));
-                                       item.setData(new TmfTimestamp(cache[0].getTimestamp()));
-                               }
-                               
                        }
         });
 
@@ -298,27 +296,27 @@ public class TmfEventsView extends TmfView {
                }
     }
 
-//    @TmfSignalHandler
-//    public void currentTimeUpdated(TmfTimeSynchSignal signal) {
-//     if (signal.getSource() != fTable && fExperiment != null) {
-//             final int index = (int) fExperiment.getRank(signal.getCurrentTime());
-//            // Perform the updates on the UI thread
-//            fTable.getDisplay().asyncExec(new Runnable() {
-//             public void run() {
-//                     fTable.setSelection(index);
-//                     // The timestamp might not correspond to an actual event
-//                     // and the selection will point to the next experiment event.
-//                     // But we would like to display both the event before and
-//                     // after the selected timestamp.
-//                     // This works fine by default except when the selected event
-//                     // is the top displayed event. The following ensures that we
-//                     // always see both events.
-//                     if ((index > 0) && (index == fTable.getTopIndex())) {
-//                             fTable.setTopIndex(index - 1);
-//                     }
-//             }
-//            });
-//     }
-//    }
+    @TmfSignalHandler
+    public void currentTimeUpdated(TmfTimeSynchSignal signal) {
+       if (signal.getSource() != fTable && fExperiment != null) {
+               final int index = (int) fExperiment.getRank(signal.getCurrentTime());
+            // Perform the updates on the UI thread
+            fTable.getDisplay().asyncExec(new Runnable() {
+               public void run() {
+                       fTable.setSelection(index);
+                       // The timestamp might not correspond to an actual event
+                       // and the selection will point to the next experiment event.
+                       // But we would like to display both the event before and
+                       // after the selected timestamp.
+                       // This works fine by default except when the selected event
+                       // is the top displayed event. The following ensures that we
+                       // always see both events.
+                       if ((index > 0) && (index == fTable.getTopIndex())) {
+                               fTable.setTopIndex(index - 1);
+                       }
+               }
+            });
+       }
+    }
 
 }
\ No newline at end of file
This page took 0.026451 seconds and 5 git commands to generate.