tmf: Call synchingToTime in AbstractTimeGraphView when switching traces
authorPatrick Tasse <patrick.tasse@gmail.com>
Wed, 18 Nov 2015 16:18:26 +0000 (11:18 -0500)
committerPatrick Tasse <patrick.tasse@gmail.com>
Fri, 20 Nov 2015 20:41:35 +0000 (15:41 -0500)
When switching traces (or opening a trace for the first time) the method
synchingToTime should be called with the selection begin time, to
perform view-specific handling for the new selected time.

Change-Id: Ia1eaa248b7e6d9616bfc20375276dcc83527fb28
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/60736
Reviewed-by: Hudson CI
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractTimeGraphView.java

index d6909b4c7cb6b9de67d9eb40401b4a3a69c5dcde..ceb09de044612e24a09a1f378c6218218017c26a 100644 (file)
@@ -1596,9 +1596,10 @@ public abstract class AbstractTimeGraphView extends TmfView implements ITmfTimeA
                         fEntryList.clear();
                         fEntryList.addAll(list);
                     }
-                    hasEntries = fEntryList.size() != 0;
+                    hasEntries = !fEntryList.isEmpty();
                 }
-                if (fEntryList != fTimeGraphWrapper.getInput()) {
+                boolean inputChanged = fEntryList != fTimeGraphWrapper.getInput();
+                if (inputChanged) {
                     fTimeGraphWrapper.setInput(fEntryList);
                     /* restore the previously saved filters, if any */
                     fTimeGraphWrapper.setFilters(fFiltersMap.get(fTrace));
@@ -1623,6 +1624,10 @@ public abstract class AbstractTimeGraphView extends TmfView implements ITmfTimeA
                 fTimeGraphWrapper.getTimeGraphViewer().setSelectionRange(selectionBeginTime, selectionEndTime, false);
                 fTimeGraphWrapper.getTimeGraphViewer().setStartFinishTime(startTime, endTime);
 
+                if (inputChanged && selectionBeginTime != SWT.DEFAULT) {
+                    synchingToTime(selectionBeginTime);
+                }
+
                 if (fTimeGraphWrapper instanceof TimeGraphComboWrapper && !fPackDone) {
                     for (TreeColumn column : ((TimeGraphComboWrapper) fTimeGraphWrapper).getTreeViewer().getTree().getColumns()) {
                         column.pack();
This page took 0.028782 seconds and 5 git commands to generate.