Merge branch 'master' into lttng_2_0_control_dev
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / histogram / HistogramCurrentTimeControl.java
1 /*******************************************************************************
2 * Copyright (c) 2011, 2012 Ericsson
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
11 * Francois Chouinard - Moved from LTTng to TMF
12 *******************************************************************************/
13
14 package org.eclipse.linuxtools.tmf.ui.views.histogram;
15
16 import org.eclipse.swt.widgets.Composite;
17
18 /**
19 * <b><u>HistogramCurrentTimeControl</u></b>
20 * <p>
21 * This control provides a group containing a text control.
22 */
23 public class HistogramCurrentTimeControl extends HistogramTextControl {
24
25 // ------------------------------------------------------------------------
26 // Construction
27 // ------------------------------------------------------------------------
28
29 public HistogramCurrentTimeControl(HistogramView parentView, Composite parent, int textStyle, int groupStyle) {
30 this(parentView, parent, textStyle, groupStyle, "", HistogramUtils.nanosecondsToString(0L)); //$NON-NLS-1$
31 }
32
33 public HistogramCurrentTimeControl(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 setValue(value);
48 fParentView.updateCurrentEventTime(value);
49 }
50 }
51
52 }
This page took 0.033343 seconds and 6 git commands to generate.