@Tag(value="label") public class Label extends HtmlContainer
<label>
element.Constructor and Description |
---|
Label()
Creates a new empty label.
|
Label(String text)
Creates a new label with the given text content.
|
Modifier and Type | Method and Description |
---|---|
Optional<String> |
getFor()
Gets the id of the component that this label describes.
|
void |
setFor(Component forComponent)
Sets the component that this label describes.
|
void |
setFor(String forId)
Sets the id of the component that this label describes.
|
getTitle, setTitle
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, add, addComponentAsFirst, addComponentAtIndex, remove, removeAll
isEnabled, setEnabled
getElement
getHeight, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, setHeight, setHeightFull, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidthFull
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
addAttachListener
addDetachListener
public Label()
public Label(String text)
text
- the text contentpublic void setFor(Component forComponent)
The provided component must have an id set. This component will still use the old id if the id of the provided component is changed after this method has been called.
forComponent
- the component that this label describes, not null
, must have an idIllegalArgumentException
- if the provided component has no idpublic void setFor(String forId)
forId
- the id of the described component, or null
if
there is no valuepublic Optional<String> getFor()
setFor(String)
Copyright © 2019. All rights reserved.