V
- Value typepublic interface Input<V> extends ValueHolder<V>, ValueComponent<V>, ValueHolder.MaySupportValueChangeMode
Extends ValueHolder
since handles a value, supporting ValueChangeListener
s registration.
The actual UI Component
which represents the input component can be obtained through HasComponent.getComponent()
.
Extends ValueHolder.MaySupportValueChangeMode
to allow value change mode and timeout configuration for input components
which support it.
Modifier and Type | Interface and Description |
---|---|
static interface |
Input.InputFieldPropertyRenderer<T,F extends com.vaadin.data.HasValue<T> & com.vaadin.ui.Component>
|
static interface |
Input.InputPropertyRenderer<T>
|
ValueHolder.MaySupportValueChangeMode, ValueHolder.ValueChangeEvent<V>, ValueHolder.ValueChangeListener<V>
Modifier and Type | Method and Description |
---|---|
void |
focus()
Sets the focus for this input component, if supported by concrete component implementation.
|
static <F extends com.vaadin.data.HasValue<T> & com.vaadin.ui.Component,T> |
from(F field)
Create a
Input component type from given HasValue component. |
static <F extends com.vaadin.data.HasValue<V> & com.vaadin.ui.Component,T,V> |
from(F field,
com.vaadin.data.Converter<V,T> converter)
Create a new
Input from given HasValue component with a different value type, using given
Converter to perform value conversions. |
static <F extends com.vaadin.data.HasValue<V> & com.vaadin.ui.Component,T,V> |
from(F field,
com.holonplatform.core.property.Property<T> property,
com.holonplatform.core.property.PropertyValueConverter<T,V> converter)
|
static <T,V> Input<T> |
from(Input<V> input,
com.vaadin.data.Converter<V,T> converter)
|
static <T,V> Input<T> |
from(Input<V> input,
com.holonplatform.core.property.Property<T> property,
com.holonplatform.core.property.PropertyValueConverter<T,V> converter)
|
default com.vaadin.shared.ui.ValueChangeMode |
getValueChangeMode()
Get the mode how value change events are triggered.
|
default int |
getValueChangeTimeout()
Returns the currently set timeout, in milliseconds, for how often
ValueHolder.ValueChangeEvent s are triggered if
the current ValueChangeMode is set to either ValueChangeMode.LAZY or
ValueChangeMode.TIMEOUT . |
boolean |
isReadOnly()
Returns whether this input component is in read-only mode or not.
|
boolean |
isRequired()
Gets whether the field is required, i.e. a required indicator symbol is visible.
|
default boolean |
isValueChangeModeSupported()
Gets whether the
ValueChangeMode is supported for this component. |
void |
setReadOnly(boolean readOnly)
Sets the read-only mode of this input component.
|
void |
setRequired(boolean required)
Sets whether the required indicator symbol is visible.
|
default void |
setValueChangeMode(com.vaadin.shared.ui.ValueChangeMode valueChangeMode)
Sets the mode how value change events are triggered.
|
default void |
setValueChangeTimeout(int valueChangeTimeout)
Sets how often value change events are triggered when the
ValueChangeMode is set to either
ValueChangeMode.LAZY or ValueChangeMode.TIMEOUT . |
addValueChangeListener, clear, getEmptyValue, getOptionalValue, getValue, getValueIfPresent, isEmpty, setValue
getValue
getComponent
void setReadOnly(boolean readOnly)
readOnly
- the read-only mode of this input componentboolean isReadOnly()
false
if the user can modify the value, true
if notboolean isRequired()
true
if the field as required, false
otherwisevoid setRequired(boolean required)
required
- true
to set the field as required, false
otherwisevoid focus()
default boolean isValueChangeModeSupported()
ValueHolder.MaySupportValueChangeMode
ValueChangeMode
is supported for this component.isValueChangeModeSupported
in interface ValueHolder.MaySupportValueChangeMode
true
if the ValueChangeMode
is supported, false
otherwisedefault void setValueChangeMode(com.vaadin.shared.ui.ValueChangeMode valueChangeMode)
ValueHolder.MaySupportValueChangeMode
If ValueChangeMode
is not supported, this method has no effect.
setValueChangeMode
in interface ValueHolder.MaySupportValueChangeMode
valueChangeMode
- the value change mode to set (not null)ValueHolder.MaySupportValueChangeMode.isValueChangeModeSupported()
default com.vaadin.shared.ui.ValueChangeMode getValueChangeMode()
ValueHolder.MaySupportValueChangeMode
If ValueChangeMode
is not supported, ValueChangeMode.BLUR
is returned.
getValueChangeMode
in interface ValueHolder.MaySupportValueChangeMode
ValueHolder.MaySupportValueChangeMode.isValueChangeModeSupported()
default void setValueChangeTimeout(int valueChangeTimeout)
ValueHolder.MaySupportValueChangeMode
ValueChangeMode
is set to either
ValueChangeMode.LAZY
or ValueChangeMode.TIMEOUT
.
If ValueChangeMode
is not supported, this method has no effect.
setValueChangeTimeout
in interface ValueHolder.MaySupportValueChangeMode
valueChangeTimeout
- the timeout in milliseconds, (greater or equal to 0)ValueHolder.MaySupportValueChangeMode.isValueChangeModeSupported()
default int getValueChangeTimeout()
ValueHolder.MaySupportValueChangeMode
ValueHolder.ValueChangeEvent
s are triggered if
the current ValueChangeMode
is set to either ValueChangeMode.LAZY
or
ValueChangeMode.TIMEOUT
.
If ValueChangeMode
is not supported, this method always returns -1
.
getValueChangeTimeout
in interface ValueHolder.MaySupportValueChangeMode
ValueHolder.MaySupportValueChangeMode.isValueChangeModeSupported()
static <F extends com.vaadin.data.HasValue<T> & com.vaadin.ui.Component,T> Input<T> from(F field)
Input
component type from given HasValue
component.T
- Value typeF
- HasValue
component typefield
- The field instance (not null)Input
component which wraps the given field
static <T,V> Input<T> from(Input<V> input, com.vaadin.data.Converter<V,T> converter)
Input
from another Input
with a different value type, using given Converter
to perform value conversions.T
- New value typeV
- Original value typeinput
- Actual input (not null)converter
- Value converter (not null)Input
of the converted value typestatic <F extends com.vaadin.data.HasValue<V> & com.vaadin.ui.Component,T,V> Input<T> from(F field, com.vaadin.data.Converter<V,T> converter)
Input
from given HasValue
component with a different value type, using given
Converter
to perform value conversions.F
- HasValue
component typeT
- New value typeV
- Original value typefield
- The field (not null)converter
- Value converter (not null)Input
of the converted value typestatic <T,V> Input<T> from(Input<V> input, com.holonplatform.core.property.Property<T> property, com.holonplatform.core.property.PropertyValueConverter<T,V> converter)
Input
from another Input
with a different value type, using given
PropertyValueConverter
to perform value conversions.T
- New value typeV
- Original value typeinput
- Actual input (not null)property
- Property to provide to the converterconverter
- Value converter (not null)Input
of the converted value typestatic <F extends com.vaadin.data.HasValue<V> & com.vaadin.ui.Component,T,V> Input<T> from(F field, com.holonplatform.core.property.Property<T> property, com.holonplatform.core.property.PropertyValueConverter<T,V> converter)
Input
from another Input
with a different value type, using given
PropertyValueConverter
to perform value conversions.F
- HasValue
component typeT
- New value typeV
- Original value typefield
- The field (not null)property
- Property to provide to the converterconverter
- Value converter (not null)Input
of the converted value typeCopyright © 2019 The Holon Platform. All rights reserved.