Package org.patternfly.component
Interface HasItems<E extends Element,B extends TypedBuilder<E,B>,S>
- Type Parameters:
E- the element type of the main componentB- the builder type of the main componentS- the type of the subcomponent (representing an item)record User(String id, String name, boolean valid) {} // construction time List<User> users = emptyList(); DataList dl = dataList() .addItems(users, user -> dataListItem(user.id()) .store("user", user) .addCell(dataListCell().icon(user())) .addCell(dataListCell() .add(span() .id(user.id()) .text(user.name())))); // later, responding to an event or something similar for (DataListItem item : dl) { User user = item.get("user"); item.toggle("invalid-user", !user.valid()); }
- All Superinterfaces:
IsElement<E>,Iterable<S>,TypedBuilder<E,B>
- All Known Implementing Classes:
Accordion,ActionList,ActionListGroup,AlertGroup,Breadcrumb,DataList,DescriptionList,ExpandableNavigationGroup,Form,JumpLinks,JumpLinksList,LabelGroup,List,MenuList,Navigation,NavigationGroup,ProgressStepper,SimpleList,SimpleListGroup,Tabs,Tbody,ToggleGroup,ToolbarContent,ToolbarFilterContent,ToolbarGroup,ToolbarToggleGroup,Tr,TreeView,TreeViewItem
public interface HasItems<E extends Element,B extends TypedBuilder<E,B>,S>
extends Iterable<S>, TypedBuilder<E,B>, IsElement<E>
The HasItems interface represents a component that can contain a collection of items. It provides methods for adding,
removing, and manipulating items within the component.
Often the child components implement ComponentContext and HasIdentifier.
-
Method Summary
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface org.jboss.elemento.TypedBuilder
that
-
Method Details
-
addItems
-
addItem
-
add
-
items
-
size
int size() -
isEmpty
boolean isEmpty() -
contains
-
item
-
clear
void clear()
-