1 /*******************************************************************************
2 * Copyright (c) 2011, 2012 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Francois Chouinard - Initial API and implementation
11 * Francois Chouinard - Moved from LTTng to TMF
12 *******************************************************************************/
14 package org
.eclipse
.linuxtools
.tmf
.ui
.views
.histogram
;
16 import org
.eclipse
.swt
.widgets
.Composite
;
19 * <b><u>HistogramTimeRangeControl</u></b>
21 * This control provides a group containing a text control.
23 public class HistogramTimeRangeControl
extends HistogramTextControl
{
25 // ------------------------------------------------------------------------
27 // ------------------------------------------------------------------------
29 public HistogramTimeRangeControl(HistogramView parentView
, Composite parent
, int textStyle
, int groupStyle
) {
30 this(parentView
, parent
, textStyle
, groupStyle
, "", HistogramUtils
.nanosecondsToString(0L)); //$NON-NLS-1$
33 public HistogramTimeRangeControl(HistogramView parentView
, Composite parent
, int textStyle
, int groupStyle
, String groupValue
, String textValue
) {
34 super(parentView
, parent
, textStyle
, groupStyle
, groupValue
, textValue
);
37 // ------------------------------------------------------------------------
39 // ------------------------------------------------------------------------
42 protected void updateValue() {
43 String stringValue
= fTextValue
.getText();
44 long value
= HistogramUtils
.stringToNanoseconds(stringValue
);
46 if (getValue() != value
) {
47 fParentView
.updateTimeRange(value
);