@Tag(value="input") public class Input extends AbstractSinglePropertyField<Input,String> implements Focusable<Input>, HasSize, HasStyle, HasValueChangeMode, HasAriaLabel
<input>
element.AbstractField.ComponentValueChangeEvent<C extends Component,V>
BlurNotifier.BlurEvent<C extends Component>
FocusNotifier.FocusEvent<C extends Component>
HasValue.ValueChangeEvent<V>, HasValue.ValueChangeListener<E extends HasValue.ValueChangeEvent<?>>
DEFAULT_CHANGE_TIMEOUT
Constructor and Description |
---|
Input()
Creates a new input without any specific type, with
ON_CHANGE value change mode. |
Input(ValueChangeMode valueChangeMode)
Creates a new input without any specific type.
|
Modifier and Type | Method and Description |
---|---|
Optional<String> |
getPlaceholder()
Gets the placeholder text.
|
String |
getType()
Gets the type of this input.
|
ValueChangeMode |
getValueChangeMode()
Gets current value change mode of the component.
|
int |
getValueChangeTimeout()
Returns the currently set timeout, for how often
HasValue.ValueChangeEvent s are triggered when the ValueChangeMode is set
to ValueChangeMode.LAZY , or ValueChangeMode.TIMEOUT . |
void |
setPlaceholder(String placeholder)
Sets the placeholder text that is shown if the input is empty.
|
void |
setType(String type)
Sets the type of this input.
|
void |
setValueChangeMode(ValueChangeMode valueChangeMode)
Sets new value change mode for the component.
|
void |
setValueChangeTimeout(int valueChangeTimeout)
Sets how often
HasValue.ValueChangeEvent s are triggered when the
ValueChangeMode is set to ValueChangeMode.LAZY , or
ValueChangeMode.TIMEOUT . |
getSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEvent
addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEquals
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addFocusShortcut, blur, focus, getTabIndex, setTabIndex
addBlurListener
addFocusListener
isEnabled, setEnabled
getElement
getCssSize, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
getAriaLabel, setAriaLabel
isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisible
clear, getOptionalValue
addAttachListener
addDetachListener
public Input()
ON_CHANGE
value change mode.public Input(ValueChangeMode valueChangeMode)
valueChangeMode
- initial value change mode, or null
to disable the
value synchronizationpublic void setPlaceholder(String placeholder)
placeholder
- the placeholder text to set, or null
to remove
the placeholderpublic Optional<String> getPlaceholder()
setPlaceholder(String)
public void setType(String type)
type
- the type, not null
public String getType()
public ValueChangeMode getValueChangeMode()
HasValueChangeMode
getValueChangeMode
in interface HasValueChangeMode
null
if
the value is not synchronizedpublic void setValueChangeMode(ValueChangeMode valueChangeMode)
HasValueChangeMode
setValueChangeMode
in interface HasValueChangeMode
valueChangeMode
- new value change mode, or null
to disable the value
synchronizationpublic void setValueChangeTimeout(int valueChangeTimeout)
HasValueChangeMode
HasValue.ValueChangeEvent
s are triggered when the
ValueChangeMode is set to ValueChangeMode.LAZY
, or
ValueChangeMode.TIMEOUT
.
Implementations should use
ValueChangeMode.applyChangeTimeout(ValueChangeMode, int, DomListenerRegistration)
.
setValueChangeTimeout
in interface HasValueChangeMode
valueChangeTimeout
- the timeout in milliseconds of how often
HasValue.ValueChangeEvent
s are triggered.public int getValueChangeTimeout()
HasValue.ValueChangeEvent
s are triggered when the ValueChangeMode is set
to ValueChangeMode.LAZY
, or ValueChangeMode.TIMEOUT
.
The default value is HasValueChangeMode.DEFAULT_CHANGE_TIMEOUT
.
getValueChangeTimeout
in interface HasValueChangeMode
HasValue.ValueChangeEvent
s are triggered.Copyright © 2022. All rights reserved.