Interface TableRowContainer

All Superinterfaces:
HasComponentsOfType<TableRow>, HasElement, HasEnabled, Serializable
All Known Implementing Classes:
TableBody, TableFoot, TableHead

@NullMarked public interface TableRowContainer extends HasComponentsOfType<TableRow>
A container of <tr> elements, implemented by TableHead, TableBody and TableFoot.

The WHATWG HTML specification allows nothing but rows inside those three elements, which is what HasComponentsOfType expresses: the standard add, remove, replace and bindChildren operations are all available, but only for TableRow, so an unrelated component is rejected at compile time rather than producing invalid markup. What this interface adds on top are the row factories, which create a row and attach it in one call.

Implementers must be Component instances.

Since:
25.3
  • Method Details

    • getRows

      default List<TableRow> getRows()
      Returns the rows in this container, in document order. This is the typed counterpart of HasComponentsOfType.getChildren().
      Returns:
      the rows in this container.
    • addRow

      default TableRow addRow()
      Creates a new empty row and appends it to this container.
      Returns:
      the new row.
    • insertRow

      default TableRow insertRow(int position)
      Creates a new empty row and inserts it at the given position.
      Parameters:
      position - the position to insert the row at, between 0 and the number of children in this container.
      Returns:
      the new row.