Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Chouinard2012-07-12 19:56:08 +0000
committerFrancois Chouinard2012-07-17 19:34:58 +0000
commit74a80d5c46a8f107d05c320a0d00ff9973ae1c3d (patch)
tree3e8417d6679e01d9dd6047a95bc6001062bb5cb0
parentf74d322b3f7753a487ab60c305d03c3bed94ce12 (diff)
downloadorg.eclipse.linuxtools-74a80d5c46a8f107d05c320a0d00ff9973ae1c3d.tar.gz
org.eclipse.linuxtools-74a80d5c46a8f107d05c320a0d00ff9973ae1c3d.tar.xz
org.eclipse.linuxtools-74a80d5c46a8f107d05c320a0d00ff9973ae1c3d.zip
Check TS boundary in HV Current Event control (Bug384982)
Signed-off-by: Francois Chouinard <fchouinard@gmail.com>
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramCurrentTimeControl.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramCurrentTimeControl.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramCurrentTimeControl.java
index 79a502633f..663b9874ae 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramCurrentTimeControl.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramCurrentTimeControl.java
@@ -13,6 +13,8 @@
package org.eclipse.linuxtools.tmf.ui.views.histogram;
+import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
+import org.eclipse.linuxtools.tmf.core.trace.TmfExperiment;
import org.eclipse.swt.widgets.Composite;
/**
@@ -63,6 +65,20 @@ public class HistogramCurrentTimeControl extends HistogramTextControl {
long value = HistogramUtils.stringToNanoseconds(stringValue);
if (getValue() != value) {
+ // Make sure that the new time is within range
+ TmfExperiment<?> exp = TmfExperiment.getCurrentExperiment();
+ if (exp != null) {
+ TmfTimeRange range = exp.getTimeRange();
+ long startTime = range.getStartTime().getValue();
+ long endTime = range.getEndTime().getValue();
+ if (value < startTime) {
+ value = startTime;
+ } else if (value > endTime) {
+ value = endTime;
+ }
+ }
+
+ // Set and propagate
setValue(value);
fParentView.updateCurrentEventTime(value);
}

Back to the top