Class TableRow
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.HtmlComponent
org.vaadin.firitin.fields.internalhtmltable.TableRow
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier
,com.vaadin.flow.component.DetachNotifier
,com.vaadin.flow.component.HasElement
,com.vaadin.flow.component.HasSize
,com.vaadin.flow.component.HasStyle
,Serializable
@Tag("tr")
public class TableRow
extends com.vaadin.flow.component.HtmlComponent
Represents the table row element (
<trow>
). Can contain a list of table cells.- Author:
- Stefan Uebe
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCells
(com.vaadin.flow.component.Component... components) Wrapps given components into table cells and adds them to this instance.void
Adds data cells with given string contentvoid
Adds the given cells to this instance.Adds a data cell instance to this row.addDataCells
(int cells) Adds multiple data cells to this instance based on the given integer (must be greater than 0).Adds a header cell instance to this row.addHeaderCells
(int cells) Adds multiple header cells to this instance based on the given integer (must be greater than 0).void
addHeaderCells
(com.vaadin.flow.component.Component... components) Wrapps given components into header cells and adds them to this instance.void
addHeaderCells
(String... contents) Adds header cells with given string contentgetCell
(int index) Returns the cell with the given index or an empty optional, if the index is out of bounds.getCells()
Returns all cells of this row as a list.getDataCell
(int dataCellIndex) Returns the data cell with the given index or an empty optional, if the index is out of bounds or if no data cell has been found for that index.Returns all data cells of this row as a list.getHeaderCell
(int headerCellIndex) Returns the header cell with the given index or an empty optional, if the index is out of bounds or if no header cell has been found for that index.Returns all header cells of this row as a list.void
Removes all cells from this instance.void
Removes all data cells from this instance.void
Removes all header cells from this instance.void
removeCell
(int index) Removes the cell with the given index.void
removeCells
(TableCell... cells) Removes the given cells from this instance.void
removeDataCell
(int dataCellIndex) Removes the data cell with the given index.void
removeHeaderCell
(int headerCellIndex) Removes the header cell with the given index.Returns all cells of this row as a stream.Returns all data cells of this row as a stream.Returns all header cells of this row as a stream.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.DetachNotifier
addDetachListener
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
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
-
Constructor Details
-
TableRow
public TableRow() -
TableRow
public TableRow(com.vaadin.flow.component.Component... cells) Creates new Table row with given components wrapped as cells.- Parameters:
cells
- the components to be placed in cells of the row
-
-
Method Details
-
addDataCell
Adds a data cell instance to this row. The created cell is returned for further configuration.- Returns:
- the created cell
-
addHeaderCell
Adds a header cell instance to this row. The created cell is returned for further configuration.- Returns:
- the created cell
-
addHeaderCells
public void addHeaderCells(com.vaadin.flow.component.Component... components) Wrapps given components into header cells and adds them to this instance.- Parameters:
components
- cells to add
-
addHeaderCells
Adds header cells with given string content- Parameters:
contents
- strings to add to row
-
addDataCells
Adds multiple data cells to this instance based on the given integer (must be greater than 0). The created cells are returned as an array, that can be used for further configuration.- Parameters:
cells
- amount of cells to add- Returns:
- created cell objects
-
addHeaderCells
Adds multiple header cells to this instance based on the given integer (must be greater than 0). The created cells are returned as an array, that can be used for further configuration.- Parameters:
cells
- amount of cells to add- Returns:
- created cell objects
-
addCells
Adds the given cells to this instance.- Parameters:
cells
- cells to add
-
addCells
public void addCells(com.vaadin.flow.component.Component... components) Wrapps given components into table cells and adds them to this instance.- Parameters:
components
- cells to add
-
addCells
Adds data cells with given string content- Parameters:
contents
- strings to add to row
-
removeCells
Removes the given cells from this instance. Cells, that are not child of this instance, will lead to an exception.- Parameters:
cells
- cells to remove
-
removeCell
public void removeCell(int index) Removes the cell with the given index. Noop, if no cell has been found for that index.- Parameters:
index
- index to remove
-
removeAllCells
public void removeAllCells()Removes all cells from this instance. -
removeDataCell
public void removeDataCell(int dataCellIndex) Removes the data cell with the given index. Noop, if no data cell has been found for that index.
The index is expected to relate on data cells only, which means, that any header cells are ignores / not counted. For instance in a row with the two cells (header, data), this method expects a 0 to map the data cell instance (whereasgetCell(int)
would map it with 1).- Parameters:
dataCellIndex
- index to remove
-
removeAllDataCells
public void removeAllDataCells()Removes all data cells from this instance. Header cells are kept. Noop if the row is empty or contains only header cells. -
removeHeaderCell
public void removeHeaderCell(int headerCellIndex) Removes the header cell with the given index. Noop, if no header cell has been found for that index.
The index is expected to relate on header cells only, which means, that any header cells are ignores / not counted. For instance in a row with the two cells (data, header), this method expects a 0 to map the header cell instance (whereasgetCell(int)
would map it with 1).- Parameters:
headerCellIndex
- index to remove
-
removeAllHeaderCells
public void removeAllHeaderCells()Removes all header cells from this instance. Data cells are kept. Noop if the row is empty or contains only data cells. -
getCells
-
getDataCells
Returns all data cells of this row as a list. Returns an empty list, if this row is empty or only contains header cells.- Returns:
- data cells
-
getHeaderCells
Returns all header cells of this row as a list. Returns an empty list, if this row is empty or only contains data cells.- Returns:
- header cells
-
getCell
-
getHeaderCell
Returns the header cell with the given index or an empty optional, if the index is out of bounds or if no header cell has been found for that index.
The index is expected to relate on header cells only, which means, that any header cells are ignores / not counted. For instance in a row with the two cells (data, header), this method expects a 0 to map the header cell instance (whereasgetCell(int)
would map it with 1).- Parameters:
headerCellIndex
- index- Returns:
- cell or empty
-
getDataCell
Returns the data cell with the given index or an empty optional, if the index is out of bounds or if no data cell has been found for that index.
The index is expected to relate on data cells only, which means, that any data cells are ignores / not counted. For instance in a row with the two cells (header, data), this method expects a 0 to map the data cell instance (whereasgetCell(int)
would map it with 1).- Parameters:
dataCellIndex
- index- Returns:
- cell or empty
-
streamCells
-
streamDataCells
Returns all data cells of this row as a stream. Returns an empty stream, if this row is empty or only contains header cells.- Returns:
- data cells
-
streamHeaderCells
Returns all header cells of this row as a stream. Returns an empty stream, if this row is empty or only contains data cells.- Returns:
- header cells
-