@Tag(value="component-multi-select") @JsModule(value="./component-multi-select.js") public class ComponentMultiSelect<C extends com.vaadin.flow.component.Component & com.vaadin.flow.component.ClickNotifier<C>,T> extends AbstractComponentSelect<C,Set<T>,T,ComponentMultiSelect<C,T>> implements WithMaximumSelectionSizeMixin<ComponentMultiSelect<C,T>>
ClickNotifiers and then selects/deselects it on click.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<?>>NO_SELECTIONUNLIMITEDLABEL_POSITION_ATTRIBUTE, LABEL_POSITION_DETAILS_ATTRIBUTEHELPER_ABOVE_THEME_VARIANT| Constructor and Description |
|---|
ComponentMultiSelect(Supplier<L> layoutSupplier,
com.vaadin.flow.function.SerializableBiFunction<Integer,T,C> componentFactory,
com.vaadin.flow.function.SerializableBiConsumer<Integer,C> selectionModifier,
com.vaadin.flow.function.SerializableBiConsumer<Integer,C> deselectionModifier,
T... options)
Creates the select with given options.
|
ComponentMultiSelect(Supplier<L> layoutSupplier,
com.vaadin.flow.function.SerializableBiFunction<Integer,T,C> componentFactory,
T... options)
Creates the select with given options.
|
| Modifier and Type | Method and Description |
|---|---|
protected Set<T> |
generateModelValue() |
int |
getMaximumSelectionSize()
Returns the current maximum selection size.
|
protected boolean |
isSelected(int index)
Checks if the item at the given index is currently selected.
|
protected boolean |
itemClicked(int index)
Clicks an item at the given index.
|
void |
setMaximumSelectionSize(int maximumSelectionSize)
Defines the new maximum selection size.
|
protected void |
setPresentationValue(Set<T> newPresentationValue) |
deselect, ensureValidIndex, focus, getComponentDeselectedAction, getComponentFactory, getComponentIndex, getComponentSelectedAction, getOptions, noOp, rebuildComponents, select, setComponentDeselectedAction, setComponentFactory, setComponentSelectedAction, setItems, withComponentDeselectedAction, withComponentFactory, withComponentSelectedActionadd, 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, waitwithMaximumSelectionSizeaddClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNamewithItems, withItems, withItemswithIdwithLabelwithLabelPositiongetLabelPosition, setLabelPositionwithHelperComponent, withHelperTextgetHelperComponent, getHelperText, setHelperComponent, setHelperTextwithHelperAbove, withHelperAbove, withHelperBelowisHelperAbove, setHelperAbove, setHelperAbove, setHelperBelowwithValueaddValueChangeListener, clear, getEmptyValue, getOptionalValue, getValue, isEmpty, isReadOnly, isRequiredIndicatorVisible, setReadOnly, 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, setTabIndex@SafeVarargs public ComponentMultiSelect(Supplier<L> layoutSupplier, com.vaadin.flow.function.SerializableBiFunction<Integer,T,C> componentFactory, T... options)
layoutSupplier - Provides layout for the component.componentFactory - A function that creates components for the options.options - Items to select from.@SafeVarargs public ComponentMultiSelect(Supplier<L> layoutSupplier, com.vaadin.flow.function.SerializableBiFunction<Integer,T,C> componentFactory, com.vaadin.flow.function.SerializableBiConsumer<Integer,C> selectionModifier, com.vaadin.flow.function.SerializableBiConsumer<Integer,C> deselectionModifier, T... options)
layoutSupplier - Provides layout for the component.componentFactory - A function that creates components for the options.selectionModifier - Action to perform on a component when it is selected.deselectionModifier - Action to perform on a component when it is deselected.options - Items to select from.protected boolean isSelected(int index)
AbstractComponentSelectisSelected in class AbstractComponentSelect<C extends com.vaadin.flow.component.Component & com.vaadin.flow.component.ClickNotifier<C>,Set<T>,T,ComponentMultiSelect<C extends com.vaadin.flow.component.Component & com.vaadin.flow.component.ClickNotifier<C>,T>>index - Index of an item.true when the item is selected, false otherwise.protected boolean itemClicked(int index)
AbstractComponentSelectitemClicked in class AbstractComponentSelect<C extends com.vaadin.flow.component.Component & com.vaadin.flow.component.ClickNotifier<C>,Set<T>,T,ComponentMultiSelect<C extends com.vaadin.flow.component.Component & com.vaadin.flow.component.ClickNotifier<C>,T>>index - Index of an item to be clicked.public void setMaximumSelectionSize(int maximumSelectionSize)
HasMaximumSelectionSizesetMaximumSelectionSize in interface HasMaximumSelectionSizemaximumSelectionSize - Maximum selection size.public int getMaximumSelectionSize()
HasMaximumSelectionSizegetMaximumSelectionSize in interface HasMaximumSelectionSizeHasMaximumSelectionSize.UNLIMITED by default.Copyright © 2024 Miki. All rights reserved.