T - Value typepublic interface Input<T> extends ValueHolder<T,ValueHolder.ValueChangeEvent<T>>, ValueComponent<T>
Extends ValueHolder since handles a value, supporting ValueChangeListeners registration.
The actual UI Component which represents the input component can be obtained through HasComponent.getComponent().
| Modifier and Type | Interface and Description |
|---|---|
static interface |
Input.InputPropertyRenderer<T>
|
static class |
Input.InputValueConversionException
Exception used to notify Input values conversion errors.
|
static interface |
Input.PropertyHandler<P,T,V extends com.vaadin.flow.component.HasValue<?,T>,C extends com.vaadin.flow.component.Component>
Input field/component property handler.
|
ValueHolder.ValueChangeEvent<V>, ValueHolder.ValueChangeListener<V,E extends ValueHolder.ValueChangeEvent<V>>| Modifier and Type | Method and Description |
|---|---|
default com.vaadin.flow.component.HasValue<?,T> |
asHasValue()
Get this
Input as an HasValue component. |
static BooleanInputBuilder |
boolean_()
|
static <T,H extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasValue<?,T>> |
builder(H field)
|
static <T,H extends com.vaadin.flow.component.HasValue<?,T>,C extends com.vaadin.flow.component.Component> |
builder(H field,
C component)
|
static <T> Optional<Input<T>> |
create(Class<T> type)
Create an
Input to handle given value type, if available. |
static <T> Input<T> |
create(com.holonplatform.core.property.Property<T> property)
Create an
Input component using given Property to detect the Input value type and the Input
configuration. |
static DateInputBuilder |
date()
|
static DateTimeInputBuilder |
dateTime()
|
static <E extends Enum<E>> |
enumMultiSelect(Class<E> enumType)
|
static <E extends Enum<E>> |
enumOptionSelect(Class<E> enumType)
|
static <E extends Enum<E>> |
enumSelect(Class<E> enumType)
|
void |
focus()
Sets the focus for this input component, if supported by concrete component implementation.
|
static <T,F extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasValue<?,T>> |
from(F field)
Create a
Input component type from given HasValue component. |
static <F extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasValue<?,V>,T,V> |
from(F field,
com.vaadin.flow.data.converter.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.flow.component.Component & com.vaadin.flow.component.HasValue<?,V>,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.flow.data.converter.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 Optional<InvalidChangeEventNotifier> |
hasInvalidChangeEventNotifier()
Checks whether this input supports invalid change events notification, using a
InvalidChangeEventNotifier. |
default Optional<HasPlaceholder> |
hasPlaceholder()
Checks whether this component supports a placeholder, which text can be handled using the
HasPlaceholder
interface. |
default Optional<HasTitle> |
hasTitle()
Checks whether this component supports a title, which text can be handled using the
HasTitle interface. |
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.
|
static LocalDateInputBuilder |
localDate()
|
static LocalDateTimeInputBuilder |
localDateTime()
Gets a builder to create
LocalDateTime type Inputs. |
static LocalTimeInputBuilder |
localTime()
|
static <T> OptionsMultiSelectConfigurator.OptionsMultiSelectInputBuilder<T,T> |
multiOptionSelect(Class<T> type)
Gets a builder to create a options
MultiSelect type Input, which uses a
CheckboxGroup as input component. |
static <T,ITEM> OptionsMultiSelectConfigurator.OptionsMultiSelectInputBuilder<T,ITEM> |
multiOptionSelect(Class<T> type,
Class<ITEM> itemType,
ItemConverter<T,ITEM> itemConverter)
Gets a builder to create a options
MultiSelect type Input, which uses a
CheckboxGroup as input component. |
static <T> OptionsMultiSelectConfigurator.PropertyOptionsMultiSelectInputBuilder<T> |
multiOptionSelect(com.holonplatform.core.property.Property<T> selectionProperty)
Gets a builder to create a
Property model based options MultiSelect type Input,
which uses a CheckboxGroup as input component. |
static <T> OptionsMultiSelectConfigurator.PropertyOptionsMultiSelectInputBuilder<T> |
multiOptionSelect(com.holonplatform.core.property.Property<T> selectionProperty,
Function<T,Optional<com.holonplatform.core.property.PropertyBox>> itemConverter)
Gets a builder to create a
Property model based options MultiSelect type Input,
which uses a CheckboxGroup as input component. |
static <T extends Number> |
number(Class<T> numberClass)
Gets a builder to create a numeric type
Input. |
static PasswordInputBuilder |
password()
|
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.
|
static <T> OptionsSingleSelectConfigurator.OptionsSingleSelectInputBuilder<T,T> |
singleOptionSelect(Class<T> type)
Gets a builder to create a options
SingleSelect type Input, which uses a
RadioButtonGroup as input component. |
static <T,ITEM> OptionsSingleSelectConfigurator.OptionsSingleSelectInputBuilder<T,ITEM> |
singleOptionSelect(Class<T> type,
Class<ITEM> itemType,
ItemConverter<T,ITEM> itemConverter)
Gets a builder to create a options
SingleSelect type Input, which uses a
RadioButtonGroup as input component. |
static <T> OptionsSingleSelectConfigurator.PropertyOptionsSingleSelectInputBuilder<T> |
singleOptionSelect(com.holonplatform.core.property.Property<T> selectionProperty)
Gets a builder to create a
Property model based options SingleSelect type Input,
which uses a RadioButtonGroup as input component. |
static <T> OptionsSingleSelectConfigurator.PropertyOptionsSingleSelectInputBuilder<T> |
singleOptionSelect(com.holonplatform.core.property.Property<T> selectionProperty,
Function<T,Optional<com.holonplatform.core.property.PropertyBox>> itemConverter)
Gets a builder to create a
Property model based options SingleSelect type Input,
which uses a RadioButtonGroup as input component. |
static <T> FilterableSingleSelectConfigurator.FilterableSingleSelectInputBuilder<T,T> |
singleSelect(Class<T> type)
Gets a builder to create a filterable
SingleSelect type Input, which uses a
ComboBox as input component. |
static <T,ITEM> FilterableSingleSelectConfigurator.FilterableSingleSelectInputBuilder<T,ITEM> |
singleSelect(Class<T> type,
Class<ITEM> itemType,
ItemConverter<T,ITEM> itemConverter)
Gets a builder to create a filterable
SingleSelect type Input, which uses a
ComboBox as input component. |
static <T> FilterableSingleSelectConfigurator.PropertyFilterableSingleSelectInputBuilder<T> |
singleSelect(com.holonplatform.core.property.Property<T> selectionProperty)
Gets a builder to create a
Property model based filterable SingleSelect type
Input, which uses a ComboBox as input component. |
static <T> FilterableSingleSelectConfigurator.PropertyFilterableSingleSelectInputBuilder<T> |
singleSelect(com.holonplatform.core.property.Property<T> selectionProperty,
Function<T,Optional<com.holonplatform.core.property.PropertyBox>> itemConverter)
Gets a builder to create a
Property model based filterable SingleSelect type
Input, which uses a ComboBox as input component. |
static <T> SingleSelectConfigurator.SingleSelectInputBuilder<T,T> |
singleSimpleSelect(Class<T> type)
|
static <T,ITEM> SingleSelectConfigurator.SingleSelectInputBuilder<T,ITEM> |
singleSimpleSelect(Class<T> type,
Class<ITEM> itemType,
ItemConverter<T,ITEM> itemConverter)
|
static <T> SingleSelectConfigurator.PropertySingleSelectInputBuilder<T> |
singleSimpleSelect(com.holonplatform.core.property.Property<T> selectionProperty)
Gets a builder to create a
Property model based simple SingleSelect type Input,
which uses a Select as input component. |
static <T> SingleSelectConfigurator.PropertySingleSelectInputBuilder<T> |
singleSimpleSelect(com.holonplatform.core.property.Property<T> selectionProperty,
Function<T,Optional<com.holonplatform.core.property.PropertyBox>> itemConverter)
Gets a builder to create a
Property model based simple SingleSelect type Input,
which uses a Select as input component. |
static StringInputBuilder |
string()
|
static StringAreaInputBuilder |
stringArea()
|
addValueChangeListener, clear, getEmptyValue, getValue, getValueIfPresent, isEmpty, setValuegetValue, hasValueChangeModecreate, getComponent, getElement, hasEnabled, hasLabel, hasSize, hasStyle, hasValidation, isVisible, setVisiblevoid 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 Optional<HasTitle> hasTitle()
HasTitle interface.HasTitle reference. An empty Optional is returned
otherwise.default Optional<HasPlaceholder> hasPlaceholder()
HasPlaceholder
interface.HasPlaceholder reference. An empty Optional
is returned otherwise.default Optional<InvalidChangeEventNotifier> hasInvalidChangeEventNotifier()
InvalidChangeEventNotifier.InvalidChangeEventNotifier
reference. An empty Optional is returned otherwise.default com.vaadin.flow.component.HasValue<?,T> asHasValue()
Input as an HasValue component.HasValue componentstatic <T,F extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasValue<?,T>> Input<T> from(F field)
Input component type from given HasValue component.F - HasValue component typeT - Value typefield - The field instance (not null)Input component which wraps the given fieldstatic <T,V> Input<T> from(Input<V> input, com.vaadin.flow.data.converter.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.flow.component.Component & com.vaadin.flow.component.HasValue<?,V>,T,V> Input<T> from(F field, com.vaadin.flow.data.converter.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.flow.component.Component & com.vaadin.flow.component.HasValue<?,V>,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 typestatic <T,H extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasValue<?,T>> HasValueInputBuilder<T,H,H> builder(H field)
T - Value typeH - Field typefield - HasValue Component field (not null)HasValueInputBuilderstatic <T,H extends com.vaadin.flow.component.HasValue<?,T>,C extends com.vaadin.flow.component.Component> HasValueInputBuilder<T,H,C> builder(H field, C component)
T - Value typeH - HasValue typeC - Component typefield - HasValue field (not null)component - Field Component (not null)HasValueInputBuilderstatic <T> Input<T> create(com.holonplatform.core.property.Property<T> property)
Input component using given Property to detect the Input value type and the Input
configuration.
Any available Input type PropertyRenderer from the current PropertyRendererRegistry will
be used to provide the Input instance.
T - Property and Input typeproperty - The property to use (not null)Input component with the same type of given Propertycom.holonplatform.core.property.PropertyRendererRegistry.NoSuitableRendererAvailableException - if a suitable Input type PropertyRenderer is not
availablePropertyRendererRegistrystatic StringInputBuilder string()
StringInputBuilderstatic StringAreaInputBuilder stringArea()
StringAreaInputBuilderstatic PasswordInputBuilder password()
String type Inputs which do not display user input on screen, used to
enter secret text information, such as user passwords.PasswordInputBuilderstatic LocalDateInputBuilder localDate()
LocalDateInputBuilderstatic LocalDateTimeInputBuilder localDateTime()
LocalDateTime type Inputs.LocalDateTimeInputBuilderstatic LocalTimeInputBuilder localTime()
LocalTimeInputBuilderstatic DateInputBuilder date()
Date type Inputs.
This Input use the Date type only for simple date representations (day, month, year), i.e. without the
time part.
DateInputBuilderstatic DateTimeInputBuilder dateTime()
Date type Inputs with time (hours and minutes) support.
Only the hours and minutes time parts are supported.
DateTimeInputBuilderstatic BooleanInputBuilder boolean_()
BooleanInputBuilderstatic <T extends Number> NumberInputBuilder<T> number(Class<T> numberClass)
Input.T - Number typenumberClass - Number class (not null)NumberInputBuilderstatic <T> FilterableSingleSelectConfigurator.FilterableSingleSelectInputBuilder<T,T> singleSelect(Class<T> type)
SingleSelect type Input, which uses a
ComboBox as input component.
This builder can be used when the selection items type and the selection value type are consistent. Use
singleSelect(Class, Class, ItemConverter) if not.
T - Value typetype - Selection value type (not null)FilterableSingleSelectConfigurator.FilterableSingleSelectInputBuilderstatic <T,ITEM> FilterableSingleSelectConfigurator.FilterableSingleSelectInputBuilder<T,ITEM> singleSelect(Class<T> type, Class<ITEM> itemType, ItemConverter<T,ITEM> itemConverter)
SingleSelect type Input, which uses a
ComboBox as input component.
This builder can be used when the selection items type and the selection value type are not consistent (i.e. of
different type). When the the selection item and the selection value types are consistent, the
singleSelect(Class) method can be used.
T - Value typeITEM - Item typetype - Selection value type (not null)itemType - Selection items type (not null)itemConverter - The item converter to use to convert a selection item into a selection (Input) value and
back (not null)FilterableSingleSelectConfigurator.FilterableSingleSelectInputBuilderstatic <T> FilterableSingleSelectConfigurator.PropertyFilterableSingleSelectInputBuilder<T> singleSelect(com.holonplatform.core.property.Property<T> selectionProperty)
Property model based filterable SingleSelect type
Input, which uses a ComboBox as input component.T - Value typeselectionProperty - The property to use to represent the selection value (not null)FilterableSingleSelectConfigurator.PropertyFilterableSingleSelectInputBuilderstatic <T> FilterableSingleSelectConfigurator.PropertyFilterableSingleSelectInputBuilder<T> singleSelect(com.holonplatform.core.property.Property<T> selectionProperty, Function<T,Optional<com.holonplatform.core.property.PropertyBox>> itemConverter)
Property model based filterable SingleSelect type
Input, which uses a ComboBox as input component.T - Value typeselectionProperty - The property to use to represent the selection value (not null)itemConverter - The function to use to convert a selection value into the corresponding PropertyBox
itemFilterableSingleSelectConfigurator.PropertyFilterableSingleSelectInputBuilderstatic <T> SingleSelectConfigurator.SingleSelectInputBuilder<T,T> singleSimpleSelect(Class<T> type)
SingleSelect type Input, which uses a Select
as input component.
This builder can be used when the selection items type and the selection value type are consistent. Use
singleSelect(Class, Class, ItemConverter) if not.
T - Value typetype - Selection value type (not null)SingleSelectConfigurator.SingleSelectInputBuilderstatic <T,ITEM> SingleSelectConfigurator.SingleSelectInputBuilder<T,ITEM> singleSimpleSelect(Class<T> type, Class<ITEM> itemType, ItemConverter<T,ITEM> itemConverter)
SingleSelect type Input, which uses a Select
as input component.
This builder can be used when the selection items type and the selection value type are not consistent (i.e. of
different type). When the the selection item and the selection value types are consistent, the
singleSelect(Class) method can be used.
T - Value typeITEM - Item typetype - Selection value type (not null)itemType - Selection items type (not null)itemConverter - The item converter to use to convert a selection item into a selection (Input) value and
back (not null)SingleSelectConfigurator.SingleSelectInputBuilderstatic <T> SingleSelectConfigurator.PropertySingleSelectInputBuilder<T> singleSimpleSelect(com.holonplatform.core.property.Property<T> selectionProperty)
Property model based simple SingleSelect type Input,
which uses a Select as input component.T - Value typeselectionProperty - The property to use to represent the selection value (not null)SingleSelectConfigurator.PropertySingleSelectInputBuilderstatic <T> SingleSelectConfigurator.PropertySingleSelectInputBuilder<T> singleSimpleSelect(com.holonplatform.core.property.Property<T> selectionProperty, Function<T,Optional<com.holonplatform.core.property.PropertyBox>> itemConverter)
Property model based simple SingleSelect type Input,
which uses a Select as input component.T - Value typeselectionProperty - The property to use to represent the selection value (not null)itemConverter - The function to use to convert a selection value into the corresponding PropertyBox
itemSingleSelectConfigurator.PropertySingleSelectInputBuilderstatic <T> OptionsSingleSelectConfigurator.OptionsSingleSelectInputBuilder<T,T> singleOptionSelect(Class<T> type)
SingleSelect type Input, which uses a
RadioButtonGroup as input component.
This builder can be used when the selection items type and the selection value type are consistent. Use
singleOptionSelect(Class, Class, ItemConverter) if not.
T - Value typetype - Selection value type (not null)OptionsSingleSelectConfigurator.OptionsSingleSelectInputBuilderstatic <T,ITEM> OptionsSingleSelectConfigurator.OptionsSingleSelectInputBuilder<T,ITEM> singleOptionSelect(Class<T> type, Class<ITEM> itemType, ItemConverter<T,ITEM> itemConverter)
SingleSelect type Input, which uses a
RadioButtonGroup as input component.
This builder can be used when the selection items type and the selection value type are not consistent (i.e. of
different type). When the the selection item and the selection value types are consistent, the
singleOptionSelect(Class) method can be used.
T - Value typeITEM - Item typetype - Selection value type (not null)itemType - Selection items type (not null)itemConverter - The item converter to use to convert a selection item into a selection (Input) value and
back (not null)OptionsSingleSelectConfigurator.OptionsSingleSelectInputBuilderstatic <T> OptionsSingleSelectConfigurator.PropertyOptionsSingleSelectInputBuilder<T> singleOptionSelect(com.holonplatform.core.property.Property<T> selectionProperty)
Property model based options SingleSelect type Input,
which uses a RadioButtonGroup as input component.T - Value typeselectionProperty - The property to use to represent the selection value (not null)OptionsSingleSelectConfigurator.PropertyOptionsSingleSelectInputBuilderstatic <T> OptionsSingleSelectConfigurator.PropertyOptionsSingleSelectInputBuilder<T> singleOptionSelect(com.holonplatform.core.property.Property<T> selectionProperty, Function<T,Optional<com.holonplatform.core.property.PropertyBox>> itemConverter)
Property model based options SingleSelect type Input,
which uses a RadioButtonGroup as input component.T - Value typeselectionProperty - The property to use to represent the selection value (not null)itemConverter - The function to use to convert a selection value into the corresponding PropertyBox
itemOptionsSingleSelectConfigurator.PropertyOptionsSingleSelectInputBuilderstatic <T> OptionsMultiSelectConfigurator.OptionsMultiSelectInputBuilder<T,T> multiOptionSelect(Class<T> type)
MultiSelect type Input, which uses a
CheckboxGroup as input component.
This builder can be used when the selection items type and the selection value type are consistent. Use
multiOptionSelect(Class, Class, ItemConverter) if not.
T - Value typetype - Selection value type (not null)OptionsMultiSelectConfigurator.OptionsMultiSelectInputBuilderstatic <T,ITEM> OptionsMultiSelectConfigurator.OptionsMultiSelectInputBuilder<T,ITEM> multiOptionSelect(Class<T> type, Class<ITEM> itemType, ItemConverter<T,ITEM> itemConverter)
MultiSelect type Input, which uses a
CheckboxGroup as input component.
This builder can be used when the selection items type and the selection value type are not consistent (i.e. of
different type). When the the selection item and the selection value types are consistent, the
multiOptionSelect(Class) method can be used.
T - Value typeITEM - Item typetype - Selection value type (not null)itemType - Selection items type (not null)itemConverter - The item converter to use to convert a selection item into a selection (Input) value and
back (not null)OptionsMultiSelectConfigurator.OptionsMultiSelectInputBuilderstatic <T> OptionsMultiSelectConfigurator.PropertyOptionsMultiSelectInputBuilder<T> multiOptionSelect(com.holonplatform.core.property.Property<T> selectionProperty)
Property model based options MultiSelect type Input,
which uses a CheckboxGroup as input component.T - Value typeselectionProperty - The property to use to represent the selection value (not null)OptionsMultiSelectConfigurator.PropertyOptionsMultiSelectInputBuilderstatic <T> OptionsMultiSelectConfigurator.PropertyOptionsMultiSelectInputBuilder<T> multiOptionSelect(com.holonplatform.core.property.Property<T> selectionProperty, Function<T,Optional<com.holonplatform.core.property.PropertyBox>> itemConverter)
Property model based options MultiSelect type Input,
which uses a CheckboxGroup as input component.T - Value typeselectionProperty - The property to use to represent the selection value (not null)itemConverter - The function to use to convert a selection value into the corresponding PropertyBox
itemOptionsMultiSelectConfigurator.PropertyOptionsMultiSelectInputBuilderstatic <E extends Enum<E>> FilterableSingleSelectConfigurator.FilterableSingleSelectInputBuilder<E,E> enumSelect(Class<E> enumType)
SingleSelect type Input for given enum type.
All the enum constants declared for the given enum type will be available as selection items.
E - Enum typeenumType - Enum type (not null)FilterableSingleSelectConfigurator.FilterableSingleSelectInputBuilderstatic <E extends Enum<E>> OptionsSingleSelectConfigurator.OptionsSingleSelectInputBuilder<E,E> enumOptionSelect(Class<E> enumType)
SingleSelect type Input for given
enum type.
All the enum constants declared for the given enum type will be available as selection items.
E - Enum typeenumType - Enum type (not null)OptionsSingleSelectConfigurator.OptionsSingleSelectInputBuilderstatic <E extends Enum<E>> OptionsMultiSelectConfigurator.OptionsMultiSelectInputBuilder<E,E> enumMultiSelect(Class<E> enumType)
MultiSelect type Input for given enum type.
All the enum constants declared for the given enum type will be available as selection items.
E - Enum typeenumType - Enum type (not null)OptionsMultiSelectConfigurator.OptionsMultiSelectInputBuilderCopyright © 2019 The Holon Platform. All rights reserved.