Interface TableRowContainer
- All Superinterfaces:
com.vaadin.flow.component.HasElement
,Serializable
public interface TableRowContainer
extends com.vaadin.flow.component.HasElement
A base interface for components, that contain table rows.
- Author:
- Stefan Uebe
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault TableRow
addRow()
Adds a single row instance to this container.default TableRow[]
addRows
(int rows) Adds multiple rows to this instance based on the given integer (must be greater than 0).default void
Adds the given rows to this instance.Stream<com.vaadin.flow.component.Component>
Returns the children of this instance as a stream of components.getRow
(int index) Returns the row with the given index or an empty optional, if the index is out of bounds.getRows()
Returns the rows of this instance as a list.default TableRow
insertRow
(int index) Inserts a single row instance at the given index to this container.default void
insertRows
(int index, TableRow... rows) Inserts the given rows at the given index to this instance.default void
Removes all rows.default void
removeRow
(int index) Removes the row with the given index.default void
removeRows
(TableRow... rows) Removes the given rows from this instance.default void
replaceRow
(int index, TableRow row) Replaces a single row instance to the given index in this container and replaces the existing row.default void
Replaces a single row instance to the given index in this container and replaces the existing row.Returns the rows of this instance as a stream.Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
-
Method Details
-
addRow
Adds a single row instance to this container. The created row is returned for further configuration.- Returns:
- the created row
-
addRows
Adds the given rows to this instance.- Parameters:
rows
- rows
-
addRows
Adds multiple rows to this instance based on the given integer (must be greater than 0). The created rows are returned as an array, that can be used for further configuration.- Parameters:
rows
- amount of rows to add- Returns:
- created row objects
-
insertRow
Inserts a single row instance at the given index to this container. Existing items will be placed after the inserted items. The created row is returned for further configuration.- Parameters:
index
- to insert the row at- Returns:
- the created row
-
insertRows
Inserts the given rows at the given index to this instance. Existing items will be placed after the inserted items.- Parameters:
index
- to insert the rows atrows
- rows
-
setRow
Replaces a single row instance to the given index in this container and replaces the existing row.
This method has the same functionality asreplaceRow(int, TableRow)
.- Parameters:
index
- index to set the new item torow
- row- See Also:
-
replaceRow
Replaces a single row instance to the given index in this container and replaces the existing row.- Parameters:
index
- index to set the new item torow
- row
-
removeRow
default void removeRow(int index) Removes the row with the given index. Noop, if no row has been found for that index.- Parameters:
index
- index to remove
-
removeRows
Removes the given rows from this instance. Items, that are not child of this instance, will lead to an exception.- Parameters:
rows
- rows to remove
-
removeAllRows
default void removeAllRows()Removes all rows. -
getRows
Returns the rows of this instance as a list. Changes to this list do not affect this instance. Empty if no rows have been added yet.- Returns:
- rows as list
-
getRow
Returns the row with the given index or an empty optional, if the index is out of bounds.- Parameters:
index
- index- Returns:
- row or empty
-
streamRows
Returns the rows of this instance as a stream. Empty if no rows have been added yet.- Returns:
- rows as stream
-
getChildren
Stream<com.vaadin.flow.component.Component> getChildren()Returns the children of this instance as a stream of components.- Returns:
- children
-