Class NativeTableRow

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.HtmlComponent
com.vaadin.flow.component.HtmlContainer
com.vaadin.flow.component.html.NativeTableRow
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.ClickNotifier<NativeTableRow>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasComponents, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasOrderedComponents, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasText, Serializable

@Tag("tr") public class NativeTableRow extends com.vaadin.flow.component.HtmlContainer implements com.vaadin.flow.component.HasOrderedComponents, com.vaadin.flow.component.ClickNotifier<NativeTableRow>
Component representing a <tr> element.
Since:
24.4
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasText

    com.vaadin.flow.component.HasText.WhiteSpace
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new empty table row component.
    NativeTableRow(com.vaadin.flow.component.Component... components)
    Creates a new table row with the given children components.
  • Method Summary

    Modifier and Type
    Method
    Description
    Add a data cell to this row.
    Add a header cell to this row.
    List<com.vaadin.flow.component.Component>
    Returns a list of all cells in this row.
    Optional<com.vaadin.flow.component.Component>
    getCell(int index)
    Returns the cell at a given position.
    getDataCell(int index)
    Returns the data cell at a given position relative to other data cells.
    Returns a list of all data cells in this row.
    getHeaderCell(int index)
    Returns the header cell at a given position relative to other header cells.
    Returns a list of all header cells in this row.
    insertDataCell(int position)
    Insert a new data cell into a given position.
    insertHeaderCell(int position)
    Insert a new header cell into a given position.
    void
    removeCell(int index)
    Removes the cell at a given position.
    void
    removeDataCell(int index)
    Removes the data cell at a given position relative to other data cells.
    void
    Removes a data cell.
    void
    removeHeaderCell(int index)
    Removes the header cell at a position relative to other header cells.
    void
    Removes a header cell.

    Methods inherited from class com.vaadin.flow.component.HtmlComponent

    getTitle, setTitle

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

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

    addAttachListener

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

    addClickListener, addClickShortcut, addDoubleClickListener, addSingleClickListener

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

    addDetachListener

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

    add, add, add, addComponentAsFirst, addComponentAtIndex, remove, remove, removeAll

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

    getElement

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

    isEnabled, setEnabled

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

    getChildren, getComponentAt, getComponentCount, indexOf, replace

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

    getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull

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

    addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName

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

    getText, getWhiteSpace, setText, setWhiteSpace
  • Constructor Details

    • NativeTableRow

      public NativeTableRow()
      Creates a new empty table row component.
    • NativeTableRow

      public NativeTableRow(com.vaadin.flow.component.Component... components)
      Creates a new table row with the given children components.
      Parameters:
      components - the children components.
  • Method Details

    • addHeaderCell

      public NativeTableHeaderCell addHeaderCell()
      Add a header cell to this row.
      Returns:
      the new <th> element.
    • insertHeaderCell

      public NativeTableHeaderCell insertHeaderCell(int position)
      Insert a new header cell into a given position.
      Parameters:
      position - the position into which the header cell must be added.
      Returns:
      the new header cell.
    • addDataCell

      public NativeTableCell addDataCell()
      Add a data cell to this row.
      Returns:
      the new <td> element.
    • insertDataCell

      public NativeTableCell insertDataCell(int position)
      Insert a new data cell into a given position.
      Parameters:
      position - the position into which the data cell must be added.
      Returns:
      the new data cell.
    • getHeaderCells

      public List<NativeTableHeaderCell> getHeaderCells()
      Returns a list of all header cells in this row.
      Returns:
      A list of all header cells in this row.
    • getDataCells

      public List<NativeTableCell> getDataCells()
      Returns a list of all data cells in this row.
      Returns:
      A list of all data cells in this row.
    • getAllCells

      public List<com.vaadin.flow.component.Component> getAllCells()
      Returns a list of all cells in this row.
      Returns:
      a list of all cells in this row.
    • getHeaderCell

      public Optional<NativeTableHeaderCell> getHeaderCell(int index)
      Returns the header cell at a given position relative to other header cells.
      Parameters:
      index - the position of the header cell relative to other header cells.
      Returns:
      the header cell at the given position (relative to other header cells).
    • getDataCell

      public Optional<NativeTableCell> getDataCell(int index)
      Returns the data cell at a given position relative to other data cells.
      Parameters:
      index - the position of the data cell relative to other data cells.
      Returns:
      the data cell at the given position (relative to other data cells).
    • getCell

      public Optional<com.vaadin.flow.component.Component> getCell(int index)
      Returns the cell at a given position.
      Parameters:
      index - the position of the cell.
      Returns:
      the cell at the given position
      Throws:
      IndexOutOfBoundsException - if index is negative or greater than (or equal to) the number of cells in the row
    • removeCell

      public void removeCell(int index)
      Removes the cell at a given position.
      Parameters:
      index - the position of the cell to remove
    • removeHeaderCell

      public void removeHeaderCell(int index)
      Removes the header cell at a position relative to other header cells.
      Parameters:
      index - the position of the header cell relative to other header cells.
    • removeHeaderCell

      public void removeHeaderCell(NativeTableHeaderCell headerCell)
      Removes a header cell.
      Parameters:
      headerCell - the header cell to remove.
    • removeDataCell

      public void removeDataCell(int index)
      Removes the data cell at a given position relative to other data cells.
      Parameters:
      index - the position of the data cell to remove relative to other data cells.
    • removeDataCell

      public void removeDataCell(NativeTableCell dataCell)
      Removes a data cell.
      Parameters:
      dataCell - the data cell to remove.