com.vaadin.flow.data.binder.
Interface HasItemsAndComponents<T>
-
Type Parameters:
T
- the type of the displayed itemsAll Superinterfaces:
HasComponents, HasElement, HasEnabled, HasItems<T>, Serializable
All Known Implementing Classes:
public interface HasItemsAndComponents<T> extends HasComponents, HasItems<T>
Mixin interface for components that display a collection of items and can have additional components between the items.
The items should be represented by components that implement
HasItemsAndComponents.ItemComponent
. Additionally any type of components can be added at any position withaddComponents(Object, Component...)
orprependComponents(Object, Component...)
.Since:
1.0.
Author:
Vaadin Ltd
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface and Description static interface
HasItemsAndComponents.ItemComponent<T>
Interface for components that are used inside an
HasItemsAndComponents
for representing a single item.
-
Method Summary
All Methods Modifier and Type Method and Description default void
addComponents(T afterItem, Component... components)
Adds the components after the given item.
default int
getItemPosition(T item)
Gets the index of the child element that represents the given item.
default void
prependComponents(T beforeItem, Component... components)
Adds the components before the given item.
-
Methods inherited from interface com.vaadin.flow.component.HasComponents
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
-
-
-
-
Method Detail
-
addComponents
default void addComponents(T afterItem, Component... components)
Adds the components after the given item.
Parameters:
afterItem
- item to add components aftercomponents
- components to add after itemThrows:
IllegalArgumentException
- if this component doesn't contain the item
-
prependComponents
default void prependComponents(T beforeItem, Component... components)
Adds the components before the given item.
Parameters:
beforeItem
- item to add components in front ofcomponents
- components to add before itemThrows:
IllegalArgumentException
- if this component doesn't contain the item
-
getItemPosition
default int getItemPosition(T item)
Gets the index of the child element that represents the given item.
Parameters:
item
- the item to look forReturns:
the index of the child element that represents the item, or -1 if the item is not found
-
-