Fix for bug 385437: Control Flow view's "Previous event" button skips
authorPatrick Tasse <patrick.tasse@gmail.com>
Thu, 19 Jul 2012 18:06:14 +0000 (14:06 -0400)
committerPatrick Tasse <patrick.tasse@gmail.com>
Thu, 19 Jul 2012 20:23:09 +0000 (16:23 -0400)
over state transition.

Change-Id: Id78590a2cf5c1398ee10d3894b56436db4732081
Reviewed-on: https://git.eclipse.org/r/6868
Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
IP-Clean: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Tested-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java

index b0a6b48d12cd66956834d69436262515dd33a480..8bce4c89b23c0b5a10f148ddcb15140120d080ad 100644 (file)
@@ -540,7 +540,7 @@ public class TimeGraphControl extends TimeGraphBaseControl implements FocusListe
      * Select an event\r
      *\r
      * @param n\r
-     *            1 to enable, -1 to disable\r
+     *            1 for next event, -1 for previous event\r
      */\r
     public void selectEvent(int n) {\r
         if (null == _timeProvider) {\r
@@ -572,6 +572,11 @@ public class TimeGraphControl extends TimeGraphBaseControl implements FocusListe
                 if (nextTime > endTime) {\r
                     nextTime = endTime;\r
                 }\r
+            } else if (n == -1) {\r
+                // for previous event go to its end time unless we were already there\r
+                if (nextEvent.getTime() + nextEvent.getDuration() < selectedTime) {\r
+                    nextTime = nextEvent.getTime() + nextEvent.getDuration();\r
+                }\r
             }\r
             _timeProvider.setSelectedTimeNotify(nextTime, true);\r
             fireSelectionChanged();\r
This page took 0.032805 seconds and 5 git commands to generate.