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 * This control provides a group containing a text control.
22 * @author Francois Chouinard
24 public class HistogramCurrentTimeControl
extends HistogramTextControl
{
26 // ------------------------------------------------------------------------
28 // ------------------------------------------------------------------------
31 * Constructor with default group and text value.
33 * @param parentView A parent histogram view
34 * @param parent A parent composite to draw in
35 * @param textStyle A test style
36 * @param groupStyle A group style
38 public HistogramCurrentTimeControl(HistogramView parentView
, Composite parent
, int textStyle
, int groupStyle
) {
39 this(parentView
, parent
, textStyle
, groupStyle
, "", HistogramUtils
.nanosecondsToString(0L)); //$NON-NLS-1$
45 * @param parentView A parent histogram view
46 * @param parent A parent composite to draw in
47 * @param textStyle A test style
48 * @param groupStyle A group style
49 * @param groupValue A group value
50 * @param textValue A text value
52 public HistogramCurrentTimeControl(HistogramView parentView
, Composite parent
, int textStyle
, int groupStyle
, String groupValue
, String textValue
) {
53 super(parentView
, parent
, textStyle
, groupStyle
, groupValue
, textValue
);
56 // ------------------------------------------------------------------------
58 // ------------------------------------------------------------------------
61 protected void updateValue() {
62 String stringValue
= fTextValue
.getText();
63 long value
= HistogramUtils
.stringToNanoseconds(stringValue
);
65 if (getValue() != value
) {
67 fParentView
.updateCurrentEventTime(value
);