Commit | Line | Data |
---|---|---|
c392540b | 1 | /******************************************************************************* |
e0752744 | 2 | * Copyright (c) 2011, 2012 Ericsson |
c392540b FC |
3 | * |
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 | |
8 | * | |
9 | * Contributors: | |
10 | * Francois Chouinard - Initial API and implementation | |
e0752744 | 11 | * Francois Chouinard - Moved from LTTng to TMF |
c392540b FC |
12 | *******************************************************************************/ |
13 | ||
e0752744 | 14 | package org.eclipse.linuxtools.tmf.ui.views.histogram; |
c392540b FC |
15 | |
16 | import org.eclipse.swt.widgets.Composite; | |
17 | ||
18 | /** | |
19 | * <b><u>HistogramTimeRangeControl</u></b> | |
20 | * <p> | |
21 | * This control provides a group containing a text control. | |
22 | */ | |
23 | public class HistogramTimeRangeControl extends HistogramTextControl { | |
24 | ||
25 | // ------------------------------------------------------------------------ | |
26 | // Construction | |
27 | // ------------------------------------------------------------------------ | |
28 | ||
29 | public HistogramTimeRangeControl(HistogramView parentView, Composite parent, int textStyle, int groupStyle) { | |
30 | this(parentView, parent, textStyle, groupStyle, "", HistogramUtils.nanosecondsToString(0L)); //$NON-NLS-1$ | |
31 | } | |
32 | ||
33 | public HistogramTimeRangeControl(HistogramView parentView, Composite parent, int textStyle, int groupStyle, String groupValue, String textValue) { | |
34 | super(parentView, parent, textStyle, groupStyle, groupValue, textValue); | |
35 | } | |
36 | ||
37 | // ------------------------------------------------------------------------ | |
38 | // Operations | |
39 | // ------------------------------------------------------------------------ | |
40 | ||
41 | @Override | |
42 | protected void updateValue() { | |
43 | String stringValue = fTextValue.getText(); | |
44 | long value = HistogramUtils.stringToNanoseconds(stringValue); | |
45 | ||
46 | if (getValue() != value) { | |
47 | fParentView.updateTimeRange(value); | |
48 | } | |
49 | } | |
50 | ||
51 | } |