Interface TableRowContainer

All Superinterfaces:
com.vaadin.flow.component.HasElement, Serializable
All Known Implementing Classes:
Table, TableBody, TableFoot, TableHead

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 Type
    Method
    Description
    default TableRow
    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
    addRows(TableRow... rows)
    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.
    default List<TableRow>
    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
    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
    setRow(int index, TableRow row)
    Replaces a single row instance to the given index in this container and replaces the existing row.
    default Stream<TableRow>
    Returns the rows of this instance as a stream.

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement
  • Method Details

    • addRow

      default TableRow addRow()
      Adds a single row instance to this container. The created row is returned for further configuration.
      Returns:
      the created row
    • addRows

      default void addRows(TableRow... rows)
      Adds the given rows to this instance.
      Parameters:
      rows - rows
    • addRows

      default TableRow[] addRows(int rows)
      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

      default TableRow insertRow(int index)
      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

      default void insertRows(int index, TableRow... rows)
      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 at
      rows - rows
    • setRow

      default void setRow(int index, TableRow row)
      Replaces a single row instance to the given index in this container and replaces the existing row.

      This method has the same functionality as replaceRow(int, TableRow).
      Parameters:
      index - index to set the new item to
      row - row
      See Also:
    • replaceRow

      default void replaceRow(int index, TableRow row)
      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 to
      row - 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

      default void removeRows(TableRow... rows)
      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

      default List<TableRow> 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

      default Optional<TableRow> getRow(int index)
      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

      default Stream<TableRow> 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