Package com.storedobject.vaadin
Class ListField<T>
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.select.Select<T>,T>
com.vaadin.flow.component.AbstractSinglePropertyField<com.vaadin.flow.component.select.Select<T>,T>
com.vaadin.flow.component.select.Select<T>
com.storedobject.vaadin.ListField<T>
- Type Parameters:
T- Value type of the field
- All Implemented Interfaces:
SpellCheck,ValueRequired,com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.select.Select<T>>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.Focusable<com.vaadin.flow.component.select.Select<T>>,com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.select.Select<T>>,com.vaadin.flow.component.HasAriaLabel,com.vaadin.flow.component.HasComponents,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasHelper,com.vaadin.flow.component.HasLabel,com.vaadin.flow.component.HasPlaceholder,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasTheme,com.vaadin.flow.component.HasValidation,com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.select.Select<T>,,T>, T> com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.select.Select<T>,,T>, T> com.vaadin.flow.component.shared.HasClientValidation,com.vaadin.flow.component.shared.HasOverlayClassName,com.vaadin.flow.component.shared.HasPrefix,com.vaadin.flow.component.shared.HasThemeVariant<com.vaadin.flow.component.select.SelectVariant>,com.vaadin.flow.component.shared.HasTooltip,com.vaadin.flow.component.shared.HasValidationProperties,com.vaadin.flow.component.shared.InputField<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.select.Select<T>,,T>, T> com.vaadin.flow.data.binder.HasItemComponents<T>,com.vaadin.flow.data.binder.HasValidator<T>,com.vaadin.flow.data.provider.HasDataView<T,,Void, com.vaadin.flow.component.select.data.SelectDataView<T>> com.vaadin.flow.data.provider.HasListDataView<T,,com.vaadin.flow.component.select.data.SelectListDataView<T>> com.vaadin.flow.data.selection.SingleSelect<com.vaadin.flow.component.select.Select<T>,,T> Serializable
- Direct Known Subclasses:
ObjectListField
public class ListField<T>
extends com.vaadin.flow.component.select.Select<T>
implements SpellCheck, ValueRequired
Slightly enhanced version of Vaadin's
Select.- Author:
- Syam
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.select.Select
com.vaadin.flow.component.select.Select.InvalidChangeEvent, com.vaadin.flow.component.select.Select.OpenedChangeEvent, com.vaadin.flow.component.select.Select.SelectI18nNested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V> Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.shared.HasClientValidation
com.vaadin.flow.component.shared.HasClientValidation.ClientValidatedEventNested classes/interfaces inherited from interface com.vaadin.flow.data.binder.HasItemComponents
com.vaadin.flow.data.binder.HasItemComponents.ItemComponent<T>Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
com.vaadin.flow.component.HasValue.ValueChangeEvent<V>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>> -
Field Summary
Fields inherited from class com.vaadin.flow.component.select.Select
LABEL_ATTRIBUTE -
Constructor Summary
ConstructorsConstructorDescriptionListField(String label, Collection<T> items) Constructor.ListField(Collection<T> items) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.component.select.data.SelectListDataView<T> addItems(Collection<T> items) Adds a collection of items to the view.com.vaadin.flow.component.select.data.SelectListDataView<T> Adds a stream of non-null items to the data view.final com.vaadin.flow.component.select.data.SelectListDataView<T> Adds the specified items to the view if they are not null.intGet index of an item.getValue(int index) Get the item for the index passed.booleanGet the value required flag.com.vaadin.flow.component.select.data.SelectListDataView<T> removeItems(Collection<T> items) Removes the specified items from the current view.com.vaadin.flow.component.select.data.SelectListDataView<T> removeItems(Stream<T> items) Removes the specified items from the list and updates the view accordingly.final com.vaadin.flow.component.select.data.SelectListDataView<T> removeItems(T... items) Removes the specified items from the list and updates the data view.voidsetIndex(int index) Set value via index.voidReplace an item at a specified index.com.vaadin.flow.component.select.data.SelectListDataView<T> Set item list.com.vaadin.flow.component.select.data.SelectListDataView<T> setItems(Collection<T> items) Set item list.final com.vaadin.flow.component.select.data.SelectListDataView<T> Set item list.voidsetRequired(boolean required) Set value required flag.Methods inherited from class com.vaadin.flow.component.select.Select
add, addComponentAsFirst, addComponentAtIndex, addComponents, addInvalidChangeListener, addOpenedChangeListener, getAriaLabel, getAriaLabelledBy, getChildren, getDataProvider, getDefaultValidator, getEmptySelectionCaption, getGenericDataView, getI18n, getItemEnabledProvider, getItemLabelGenerator, getItemPosition, getItemRenderer, getLabel, getListDataView, hasValidValue, isAutofocus, isEmptySelectionAllowed, isNoVerticalOverlap, isOpened, isRequiredIndicatorVisible, onAttach, onEnabledStateChanged, prependComponents, remove, removeAll, setAriaLabel, setAriaLabelledBy, setAutofocus, setDataProvider, setEmptySelectionAllowed, setEmptySelectionCaption, setI18n, setItemEnabledProvider, setItemLabelGenerator, setItems, setItems, setItems, setLabel, setManualValidation, setNoVerticalOverlap, setOpened, setOverlayWidth, setOverlayWidth, setPlaceholder, setRenderer, setRequiredIndicatorVisible, setTextRenderer, validate, valueEqualsMethods inherited from class com.vaadin.flow.component.AbstractSinglePropertyField
getSynchronizationRegistration, setPresentationValue, setSynchronizedEventMethods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValueMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, getTabIndex, setTabIndexMethods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListenerMethods inherited from interface com.vaadin.flow.component.shared.HasClientValidation
addClientValidatedEventListenerMethods inherited from interface com.vaadin.flow.component.HasComponents
add, add, removeMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasHelper
getHelperComponent, getHelperText, setHelperComponent, setHelperTextMethods inherited from interface com.vaadin.flow.component.shared.HasOverlayClassName
getOverlayClassName, setOverlayClassNameMethods inherited from interface com.vaadin.flow.component.HasPlaceholder
getPlaceholderMethods inherited from interface com.vaadin.flow.component.shared.HasPrefix
getPrefixComponent, setPrefixComponentMethods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, removeThemeVariantsMethods inherited from interface com.vaadin.flow.component.shared.HasTooltip
getTooltip, setTooltipTextMethods inherited from interface com.vaadin.flow.component.shared.HasValidationProperties
getErrorMessage, isInvalid, setErrorMessage, setInvalidMethods inherited from interface com.vaadin.flow.data.binder.HasValidator
addValidationStatusChangeListenerMethods inherited from interface com.vaadin.flow.component.HasValue
addValueChangeListener, clear, getEmptyValue, getOptionalValue, getValue, isEmpty, setValueMethods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, setReadOnlyMethods inherited from interface com.storedobject.vaadin.SpellCheck
setSpellCheck
-
Constructor Details
-
ListField
-
ListField
Constructor.- Parameters:
label- Labelitems- List items
-
-
Method Details
-
getIndex
Get index of an item.- Parameters:
value- Item for which index needs to determined- Returns:
- Index of the item.
-
setIndex
public void setIndex(int index) Set value via index. If the index is out of range, no value will be set.- Parameters:
index- Index.
-
getValue
Get the item for the index passed.- Parameters:
index- Index- Returns:
- Item at the index.
-
setItems
Set item list. -
setItems
-
setItems
@SafeVarargs public final com.vaadin.flow.component.select.data.SelectListDataView<T> setItems(T... items) Set item list. -
setItem
Replace an item at a specified index. (If the index is outside the range, it will not be replaced).- Parameters:
index- Indexitem- New item
-
removeItems
Removes the specified items from the current view.- Parameters:
items- The collection of items to be removed from the view.- Returns:
- The updated data view after removing the specified items.
-
removeItems
@SafeVarargs public final com.vaadin.flow.component.select.data.SelectListDataView<T> removeItems(T... items) Removes the specified items from the list and updates the data view.- Parameters:
items- Items to be removed.- Returns:
- The updated data view after removing the items.
-
removeItems
-
addItems
Adds a collection of items to the view.- Parameters:
items- The collection of items to be added.- Returns:
- The view representing the updated list of items.
-
addItems
@SafeVarargs public final com.vaadin.flow.component.select.data.SelectListDataView<T> addItems(T... items) Adds the specified items to the view if they are not null.- Parameters:
items- Items to be added to the view. Items that are null will be ignored.- Returns:
- The updated data view after adding the items.
-
addItems
-
setRequired
public void setRequired(boolean required) Description copied from interface:ValueRequiredSet value required flag.- Specified by:
setRequiredin interfaceValueRequired- Parameters:
required- Required or not
-
isRequired
public boolean isRequired()Description copied from interface:ValueRequiredGet the value required flag.- Specified by:
isRequiredin interfaceValueRequired- Returns:
- Whether required or not.
-