@CssImport(value="./styles/label-positions-custom-field.css",
themeFor="vaadin-custom-field")
public class ObjectField<T>
extends com.vaadin.flow.component.customfield.CustomField<T>
implements com.vaadin.flow.component.HasStyle, WithHelperMixin<ObjectField<T>>, WithHelperPositionableMixin<ObjectField<T>>, WithIdMixin<ObjectField<T>>, WithLabelMixin<ObjectField<T>>, WithLabelPositionableMixin<ObjectField<T>>, WithValueMixin<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<T>,T>,T,ObjectField<T>>
com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V>com.vaadin.flow.component.HasValue.ValueChangeEvent<V>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>>| Modifier and Type | Field and Description |
|---|---|
static com.vaadin.flow.function.SerializableSupplier<PropertyComponentBuilder> |
DEFAULT_COMPONENT_BUILDER |
static com.vaadin.flow.function.SerializableSupplier<PropertyGroupLayoutProvider> |
DEFAULT_GROUP_LAYOUT_PROVIDER |
static com.vaadin.flow.function.SerializableSupplier<PropertyGroupingProvider> |
DEFAULT_GROUPING_PROVIDER |
static com.vaadin.flow.function.SerializableSupplier<com.vaadin.flow.component.orderedlayout.FlexLayout> |
DEFAULT_LAYOUT_PROVIDER |
static com.vaadin.flow.function.SerializableSupplier<PropertyProvider> |
DEFAULT_PROPERTY_PROVIDER |
HELPER_ABOVE_THEME_VARIANTLABEL_POSITION_ATTRIBUTE, LABEL_POSITION_DETAILS_ATTRIBUTE| Constructor and Description |
|---|
ObjectField(Class<T> dataType,
com.vaadin.flow.function.SerializableSupplier<T> emptyObjectSupplier)
Builds an
ObjectField using DEFAULT_LAYOUT_PROVIDER for the main layout. |
ObjectField(Class<T> dataType,
com.vaadin.flow.function.SerializableSupplier<T> emptyObjectSupplier,
com.vaadin.flow.function.SerializableSupplier<L> layoutSupplier)
Builds an
ObjectField using a given supplier for the main layout. |
add, getErrorMessage, getLabel, isInvalid, remove, setErrorMessage, setInvalid, setLabel, updateValueaddValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEqualsaddListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisibleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNamewithHelperComponent, withHelperTextgetHelperComponent, getHelperText, setHelperComponent, setHelperTextwithHelperAbove, withHelperAbove, withHelperBelowisHelperAbove, setHelperAbove, setHelperAbove, setHelperBelowwithIdwithLabelwithLabelPositiongetLabelPosition, setLabelPositionwithValueaddValueChangeListener, clear, getEmptyValue, getOptionalValue, getValue, isEmpty, isReadOnly, isRequiredIndicatorVisible, setRequiredIndicatorVisible, setValuegetCssSize, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFulladdFocusShortcut, blur, getTabIndex, setTabIndexpublic static final com.vaadin.flow.function.SerializableSupplier<com.vaadin.flow.component.orderedlayout.FlexLayout> DEFAULT_LAYOUT_PROVIDER
public static final com.vaadin.flow.function.SerializableSupplier<PropertyProvider> DEFAULT_PROPERTY_PROVIDER
public static final com.vaadin.flow.function.SerializableSupplier<PropertyComponentBuilder> DEFAULT_COMPONENT_BUILDER
public static final com.vaadin.flow.function.SerializableSupplier<PropertyGroupingProvider> DEFAULT_GROUPING_PROVIDER
public static final com.vaadin.flow.function.SerializableSupplier<PropertyGroupLayoutProvider> DEFAULT_GROUP_LAYOUT_PROVIDER
public ObjectField(Class<T> dataType, com.vaadin.flow.function.SerializableSupplier<T> emptyObjectSupplier)
ObjectField using DEFAULT_LAYOUT_PROVIDER for the main layout.dataType - Type of objects to display.emptyObjectSupplier - A method to provide new, empty objects of the given type.public ObjectField(Class<T> dataType, com.vaadin.flow.function.SerializableSupplier<T> emptyObjectSupplier, com.vaadin.flow.function.SerializableSupplier<L> layoutSupplier)
ObjectField using a given supplier for the main layout.L - Layout type.dataType - Type of objects to display.emptyObjectSupplier - A method to provide new, empty objects of the given type.layoutSupplier - A method to provide the main layout of this component.protected T generateModelValue()
generateModelValue in class com.vaadin.flow.component.customfield.CustomField<T>public void repaint()
protected void setPresentationValue(T t)
setPresentationValue in class com.vaadin.flow.component.customfield.CustomField<T>public Class<T> getDataType()
protected void markReloadNeeded()
protected boolean isReloadNeeded()
true, the inner state of the component will be reloaded the next time a value is displayed.public PropertyProvider getPropertyProvider()
PropertyProvider.PropertyProvider.public void setPropertyProvider(PropertyProvider propertyProvider)
PropertyProvider.
Note that changes will not be reflected until the component is repaint()ed or a new value is set.propertyProvider - A PropertyProvider to use. If null is passed, one provided by DEFAULT_PROPERTY_PROVIDER will be used.public final ObjectField<T> withPropertyProvider(PropertyProvider provider)
setPropertyProvider(PropertyProvider) and returns itself.provider - A PropertyProvider to use.setPropertyProvider(PropertyProvider)public void setPropertyComponentBuilder(PropertyComponentBuilder builder)
PropertyComponentBuilder.
Note that changes will not be reflected until the component is repaint()ed or a new value is set.builder - A PropertyComponentBuilder to use. If null is passed, one provided by DEFAULT_COMPONENT_BUILDER will be used.public PropertyComponentBuilder getPropertyComponentBuilder()
PropertyComponentBuilder.PropertyComponentBuilder.public final ObjectField<T> withPropertyComponentBuilder(PropertyComponentBuilder builder)
setPropertyComponentBuilder(PropertyComponentBuilder) and returns itself.builder - Builder.setPropertyComponentBuilder(PropertyComponentBuilder)public void setPropertyGroupingProvider(PropertyGroupingProvider propertyGroupingProvider)
PropertyGroupingProvider.
Note that changes will not be reflected until the component is repaint()ed or a new value is set.propertyGroupingProvider - A PropertyGroupingProvider to use. If null is passed, one provided by DEFAULT_GROUPING_PROVIDER will be used.public PropertyGroupingProvider getPropertyGroupingProvider()
PropertyGroupingProvider.PropertyGroupingProvider.public final ObjectField<T> withPropertyGroupingProvider(PropertyGroupingProvider provider)
setPropertyGroupingProvider(PropertyGroupingProvider) and returns itself.provider - Provider.setPropertyGroupingProvider(PropertyGroupingProvider)public PropertyGroupLayoutProvider getGroupLayoutProvider()
PropertyGroupLayoutProvider.PropertyGroupLayoutProvider.public void setGroupLayoutProvider(PropertyGroupLayoutProvider groupLayoutProvider)
PropertyGroupLayoutProvider.
Note that changes will not be reflected until the component is repaint()ed or a new value is set.groupLayoutProvider - A PropertyGroupLayoutProvider to use. If null is passed, one provided by DEFAULT_GROUP_LAYOUT_PROVIDER will be used.public final ObjectField<T> withGroupLayoutProvider(PropertyGroupLayoutProvider provider)
setGroupLayoutProvider(PropertyGroupLayoutProvider) and returns itself.provider - Provider.setGroupLayoutProvider(PropertyGroupLayoutProvider)@SafeVarargs public final void addComponentConfigurators(ComponentConfigurator<T>... configurators)
ComponentConfigurators. Each configurator receives every component for each property. Configurators are run in the order of adding.
Note that changes will not be reflected until the component is repaint()ed or a new value is set.configurators - Configurators to add.public void addComponentConfigurators(Collection<ComponentConfigurator<T>> configurators)
ComponentConfigurators. Each configurator receives every component for each property. Configurators are run in the order of adding.
Note that changes will not be reflected until the component is repaint()ed or a new value is set.configurators - Configurators to add.public void removeComponentConfigurator(ComponentConfigurator<T> configurator)
configurator - Configurator to remove.@SafeVarargs public final ObjectField<T> withComponentConfigurators(ComponentConfigurator<T>... configurators)
addComponentConfigurators(ComponentConfigurator[]) and returns itself.configurators - Configurators to add.addComponentConfigurators(ComponentConfigurator[])public final ObjectField<T> withComponentConfigurators(Collection<ComponentConfigurator<T>> configurators)
addComponentConfigurators(Collection) and returns itself.configurators - Configurators to add.addComponentConfigurators(Collection)public void clearComponentConfigurators()
ComponentConfigurator.
Note that changes will not be reflected until the component is repaint()ed or a new value is set.public void addComponentGroupConfigurators(ComponentGroupConfigurator... configurators)
ComponentGroupConfigurators. Each configurator receives every group of components after basic ComponentConfigurators are executed. Configurators are run in the order of adding.
Note that changes will not be reflected until the component is repaint()ed or a new value is set.configurators - Configurators to add.public void addComponentGroupConfigurators(Collection<ComponentGroupConfigurator> configurators)
ComponentGroupConfigurators. Each configurator receives every group of components after basic ComponentConfigurators are executed. Configurators are run in the order of adding.
Note that changes will not be reflected until the component is repaint()ed or a new value is set.configurators - Configurators to add.public void removeComponentGroupConfigurator(ComponentGroupConfigurator configurator)
ComponentGroupConfigurator.
Note that changes will not be reflected until the component is repaint()ed or a new value is set.configurator - Configurator to remove.public final ObjectField<T> withComponentGroupConfigurators(ComponentGroupConfigurator... configurators)
addComponentGroupConfigurators(ComponentGroupConfigurator...) and returns itself.configurators - Configurators to add.addComponentGroupConfigurators(ComponentGroupConfigurator...)public final ObjectField<T> withComponentGroupConfigurators(Collection<ComponentGroupConfigurator> configurators)
addComponentGroupConfigurators(Collection) and returns itself.configurators - Configurators to add.addComponentGroupConfigurators(Collection)public void clearComponentGroupConfigurators()
ComponentGroupConfigurators.
Note that changes will not be reflected until the component is repaint()ed or a new value is set.public void setReadOnly(boolean readOnly)
setReadOnly in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<T>,T>,T>setReadOnly in interface com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<T>,T>,T>public void focus()
focus in interface com.vaadin.flow.component.Focusable<com.vaadin.flow.component.customfield.CustomField>Copyright © 2023 Miki. All rights reserved.