com.vaadin.flow.component.listbox.
Class ListBoxBase<C extends ListBoxBase<C,ITEM,VALUE>,ITEM,VALUE>
- java.lang.Object
-
- com.vaadin.flow.component.Component
-
- com.vaadin.flow.component.AbstractField<C,T>
-
- com.vaadin.flow.component.AbstractSinglePropertyField<C,VALUE>
-
- com.vaadin.flow.component.listbox.ListBoxBase<C,ITEM,VALUE>
-
All Implemented Interfaces:
AttachNotifier, DetachNotifier, HasComponents, HasElement, HasEnabled, HasSize, HasValue<AbstractField.ComponentValueChangeEvent<C,VALUE>,VALUE>, HasValueAndElement<AbstractField.ComponentValueChangeEvent<C,VALUE>,VALUE>, HasDataProvider<ITEM>, HasItems<ITEM>, HasItemsAndComponents<ITEM>, Serializable
Direct Known Subclasses:
@Tag(value="vaadin-list-box") @NpmPackage(value="@vaadin/vaadin-list-box", version="1.4.0") @JsModule(value="@vaadin/vaadin-list-box/src/vaadin-list-box.js") public abstract class ListBoxBase<C extends ListBoxBase<C,ITEM,VALUE>,ITEM,VALUE> extends AbstractSinglePropertyField<C,VALUE> implements HasItemsAndComponents<ITEM>, HasDataProvider<ITEM>, HasSize
Base class for the
ListBox
andMultiSelectListBox
.Author:
Vaadin Ltd
See Also:
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
AbstractField.ComponentValueChangeEvent<C extends Component,V>
-
Nested classes/interfaces inherited from interface com.vaadin.flow.data.binder.HasItemsAndComponents
HasItemsAndComponents.ItemComponent<T>
-
Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
HasValue.ValueChangeEvent<V>, HasValue.ValueChangeListener<E extends HasValue.ValueChangeEvent<?>>
-
-
Method Summary
All Methods Modifier and Type Method and Description DataProvider<ITEM,?>
getDataProvider()
Gets the data provider.
SerializablePredicate<ITEM>
getItemEnabledProvider()
Returns the item enabled predicate.
ComponentRenderer<? extends Component,ITEM>
getItemRenderer()
Returns the item component renderer.
protected void
onAttach(AttachEvent attachEvent)
Called when the component is attached to a UI.
protected void
onDetach(DetachEvent detachEvent)
Called when the component is detached from a UI.
void
onEnabledStateChanged(boolean enabled)
Handle component enable state when the enabled state changes.
void
setDataProvider(DataProvider<ITEM,?> dataProvider)
Sets the data provider for this listing.
void
setItemEnabledProvider(SerializablePredicate<ITEM> itemEnabledProvider)
Sets the item enabled predicate for this ListBox.
void
setRenderer(ComponentRenderer<? extends Component,ITEM> itemRenderer)
Sets the item renderer for this ListBox.
void
setRequiredIndicatorVisible(boolean requiredIndicatorVisible)
Not supported!
-
Methods inherited from class com.vaadin.flow.component.AbstractSinglePropertyField
getSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEvent
-
Methods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEquals
-
Methods inherited from class com.vaadin.flow.component.Component
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, set, setElement, setId, setVisible
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.data.binder.HasItemsAndComponents
addComponents, getItemPosition, prependComponents
-
Methods inherited from interface com.vaadin.flow.component.HasComponents
add, add, addComponentAsFirst, addComponentAtIndex, remove, removeAll
-
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabled
-
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
-
Methods inherited from interface com.vaadin.flow.data.binder.HasDataProvider
setItems
-
Methods inherited from interface com.vaadin.flow.component.HasSize
getCssSize, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull
-
Methods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible, setReadOnly
-
Methods inherited from interface com.vaadin.flow.component.HasValue
clear, getOptionalValue
-
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
-
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
-
-
-
-
Method Detail
-
setDataProvider
public void setDataProvider(DataProvider<ITEM,?> dataProvider)
Description copied from interface:
HasDataProvider
Sets the data provider for this listing. The data provider is queried for displayed items as needed.
Specified by:
setDataProvider
in interfaceHasDataProvider<ITEM>
Parameters:
dataProvider
- the data provider, not null
-
onAttach
protected void onAttach(AttachEvent attachEvent)
Description copied from class:
Component
Called when the component is attached to a UI.
The default implementation does nothing.
This method is invoked before the
AttachEvent
is fired for the component.
-
onDetach
protected void onDetach(DetachEvent detachEvent)
Description copied from class:
Component
Called when the component is detached from a UI.
The default implementation does nothing.
This method is invoked before the
DetachEvent
is fired for the component.
-
getDataProvider
public DataProvider<ITEM,?> getDataProvider()
Gets the data provider.
Returns:
the data provider, not
null
-
getItemRenderer
public ComponentRenderer<? extends Component,ITEM> getItemRenderer()
Returns the item component renderer.
Returns:
the item renderer
See Also:
-
setRenderer
public void setRenderer(ComponentRenderer<? extends Component,ITEM> itemRenderer)
Sets the item renderer for this ListBox. The renderer is applied to each item to create a component which represents the item.
Parameters:
itemRenderer
- the item renderer, notnull
-
setItemEnabledProvider
public void setItemEnabledProvider(SerializablePredicate<ITEM> itemEnabledProvider)
Sets the item enabled predicate for this ListBox. The predicate is applied to each item to determine whether the item should be enabled (
true
) or disabled (false
). Disabled items are displayed as grayed out and the user cannot select them. The default predicate always returns true (all the items are enabled).Parameters:
itemEnabledProvider
- the item enable predicate, notnull
-
getItemEnabledProvider
public SerializablePredicate<ITEM> getItemEnabledProvider()
Returns the item enabled predicate.
Returns:
the item enabled predicate
See Also:
setItemEnabledProvider(com.vaadin.flow.function.SerializablePredicate<ITEM>)
-
setRequiredIndicatorVisible
public void setRequiredIndicatorVisible(boolean requiredIndicatorVisible)
Not supported!
Not supported by the client-side web-component, see issue in GitHub.
Specified by:
setRequiredIndicatorVisible
in interfaceHasValue<AbstractField.ComponentValueChangeEvent<C extends ListBoxBase<C,ITEM,VALUE>,VALUE>,VALUE>
Specified by:
setRequiredIndicatorVisible
in interfaceHasValueAndElement<AbstractField.ComponentValueChangeEvent<C extends ListBoxBase<C,ITEM,VALUE>,VALUE>,VALUE>
Parameters:
requiredIndicatorVisible
-true
to make the required indicator visible,false
if notThrows:
-
onEnabledStateChanged
public void onEnabledStateChanged(boolean enabled)
Description copied from class:
Component
Handle component enable state when the enabled state changes.
By default this sets or removes the 'disabled' attribute from the element. This can be overridden to have custom handling.
Overrides:
onEnabledStateChanged
in classComponent
Parameters:
enabled
- the new enabled state of the component
-
-