tmf: Fix Select Next/Previous Marker navigation
authorPatrick Tasse <patrick.tasse@gmail.com>
Wed, 2 Mar 2016 00:18:54 +0000 (19:18 -0500)
committerPatrick Tasse <patrick.tasse@gmail.com>
Fri, 18 Mar 2016 06:27:08 +0000 (02:27 -0400)
Because the markers are sorted by time, when navigating to the next or
previous marker, the marker start time should always be visible.

The action should not rely on the 'ensureVisible' implementation of the
method setSelectionRangeNotify(), as this method will ensure that the
end time of the selection will be made visible when the start time has
not changed. This causes problems if there are two markers with the same
start time but the end time of the second is out of visible range. Since
the window range is modified, the resulting marker list may no longer
include the marker that should have been next in the navigation order.

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

index 44b32075e40b0c9fa58518e21d2307158c7ea6b9..ee8f7b7db24646db278c892192d3a31e9f34e0ef 100644 (file)
@@ -2313,7 +2313,9 @@ public class TimeGraphViewer implements ITimeDataProvider, IMarkerAxisListener,
             if ((marker.getTime() > time ||
                     (marker.getTime() == time && marker.getDuration() > duration))
                     && !fSkippedMarkerCategories.contains(marker.getCategory())) {
-                setSelectionRangeNotify(marker.getTime(), marker.getTime() + marker.getDuration(), true);
+                setSelectionRangeNotify(marker.getTime(), marker.getTime() + marker.getDuration(), false);
+                ensureVisible(marker.getTime());
+                notifyRangeListeners();
                 fTimeGraphCtrl.updateStatusLine();
                 return;
             }
@@ -2336,7 +2338,9 @@ public class TimeGraphViewer implements ITimeDataProvider, IMarkerAxisListener,
             if ((marker.getTime() < time ||
                     (marker.getTime() == time && marker.getDuration() < duration))
                     && !fSkippedMarkerCategories.contains(marker.getCategory())) {
-                setSelectionRangeNotify(marker.getTime(), marker.getTime() + marker.getDuration(), true);
+                setSelectionRangeNotify(marker.getTime(), marker.getTime() + marker.getDuration(), false);
+                ensureVisible(marker.getTime());
+                notifyRangeListeners();
                 fTimeGraphCtrl.updateStatusLine();
                 return;
             }
This page took 0.026222 seconds and 5 git commands to generate.