T
- the value type.public class ValueLabel<T> extends LabelBase<T> implements TakesValue<T>, IsEditor<LeafValueEditor<T>>
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
HasHorizontalAlignment.AutoHorizontalAlignmentConstant, HasHorizontalAlignment.HorizontalAlignmentConstant
DEBUG_ID_PREFIX
ALIGN_CONTENT_END, ALIGN_CONTENT_START
ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_JUSTIFY, ALIGN_LEFT, ALIGN_LOCALE_END, ALIGN_LOCALE_START, ALIGN_RIGHT
Modifier | Constructor and Description |
---|---|
|
ValueLabel() |
protected |
ValueLabel(Element element,
Renderer<? super T> renderer)
This constructor may be used by subclasses to explicitly use an existing
element.
|
|
ValueLabel(Renderer<? super T> renderer)
Creates an empty value label.
|
Modifier and Type | Method and Description |
---|---|
LeafValueEditor<T> |
asEditor()
Returns the Editor encapsulated by the view object.
|
T |
getValue()
Returns the current value.
|
void |
setValue(T value)
Sets the value.
|
static <T> ValueLabel<T> |
wrap(Element element,
Renderer<? super T> renderer)
Creates a ValueLabel widget that wraps an existing <span> element.
|
static <T> ValueLabel<T> |
wrap(Element element,
Renderer<? super T> renderer,
Parser<? extends T> parser)
Creates a ValueLabel widget that wraps an existing <span> element.
|
getAutoHorizontalAlignment, getDirectionEstimator, getHorizontalAlignment, getWordWrap, setAutoHorizontalAlignment, setDirectionEstimator, setDirectionEstimator, setHorizontalAlignment, setWordWrap, updateHorizontalAlignment
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
public ValueLabel()
@UiConstructor public ValueLabel(Renderer<? super T> renderer)
renderer
- public static <T> ValueLabel<T> wrap(Element element, Renderer<? super T> renderer)
The ValueLabel's value will be null
, whether the element being
wrapped has content or not. Use wrap(Element, Renderer, Parser)
to
parse the initial element's content to initialize the ValueLabel's value.
This element must already be attached to the document. If the element is
removed from the document, you must call
RootPanel.detachNow(Widget)
.
element
- the element to be wrappedrenderer
- the renderer used to render values into the elementpublic static <T> ValueLabel<T> wrap(Element element, Renderer<? super T> renderer, Parser<? extends T> parser) throws ParseException
The ValueLabel's value will be initialized with the element's content,
passed through the parser
.
This element must already be attached to the document. If the element is
removed from the document, you must call
RootPanel.detachNow(Widget)
.
element
- the element to be wrappedrenderer
- the renderer used to render values into the elementparser
- the parser used to initialize the ValueLabel's value from the
element's contentParseException
public LeafValueEditor<T> asEditor()
IsEditor
asEditor
in interface IsEditor<LeafValueEditor<T>>
Editor
of type Epublic T getValue()
TakesValue
getValue
in interface TakesValue<T>
TakesValue.setValue(V)
public void setValue(T value)
TakesValue
setValue
in interface TakesValue<T>
value
- a value object of type VTakesValue.getValue()
Copyright © 2018. All rights reserved.