Package com.vaadin.flow.component.grid
Class HeaderRow
java.lang.Object
com.vaadin.flow.component.grid.HeaderRow
- All Implemented Interfaces:
Serializable
One row of
HeaderRow.HeaderCell
s in a Grid.- Author:
- Vaadin Ltd.
- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected List<HeaderRow.HeaderCell>
protected com.vaadin.flow.component.grid.ColumnLayer
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addCell
(int index, com.vaadin.flow.component.grid.AbstractColumn<?> column) getCell
(Grid.Column<?> column) Gets the cell on this row that is on the given column.getCells()
Gets the cells that belong to this row as an unmodifiable list.protected boolean
Gets whether this is the top-most HeaderRow or the bottom-most FooterRow.join
(HeaderRow.HeaderCell... cells) Replaces the given cells with a new cell that takes the full space of the joined cells.join
(Grid.Column<?>... columnsToMerge) Joins the cells corresponding the given columns in the row.join
(Collection<HeaderRow.HeaderCell> cells) Replaces the given cells with a new cell that takes the full space of the joined cells.protected void
removeCell
(com.vaadin.flow.component.grid.AbstractColumn<?> columnComponent) protected void
setColumns
(List<com.vaadin.flow.component.grid.AbstractColumn<?>> columns) Change the cells to wrap the given columnsprotected void
setLayer
(com.vaadin.flow.component.grid.ColumnLayer layer) Change this row to wrap the given layer
-
Field Details
-
layer
protected com.vaadin.flow.component.grid.ColumnLayer layer -
cells
-
-
Method Details
-
join
Joins the cells corresponding the given columns in the row.- Parameters:
columnsToMerge
- the columns of the cells that should be merged- Returns:
- the merged cell
- See Also:
-
join
Replaces the given cells with a new cell that takes the full space of the joined cells.The cells to join must be adjacent cells in this row, and this row must be the out-most row.
- Parameters:
cells
- the cells to join- Returns:
- the merged cell
-
isOutmostRow
protected boolean isOutmostRow()Gets whether this is the top-most HeaderRow or the bottom-most FooterRow.- Returns:
- whether this is the outmost row
-
setLayer
protected void setLayer(com.vaadin.flow.component.grid.ColumnLayer layer) Change this row to wrap the given layer- Parameters:
layer
- the layer to wrap
-
setColumns
Change the cells to wrap the given columns- Parameters:
columns
- new column components for the cells
-
addCell
protected void addCell(int index, com.vaadin.flow.component.grid.AbstractColumn<?> column) -
removeCell
protected void removeCell(com.vaadin.flow.component.grid.AbstractColumn<?> columnComponent) -
getCells
Gets the cells that belong to this row as an unmodifiable list.- Returns:
- the cells on this row
-
getCell
Gets the cell on this row that is on the given column.- Parameters:
column
- the column to find cell for- Returns:
- the corresponding cell
- Throws:
IllegalArgumentException
- if the column does not belong to the same grid as this row
-
join
Replaces the given cells with a new cell that takes the full space of the joined cells.The cells to join must be adjacent cells in this row, and this row must be the out-most row.
The way that the client-side web component works also causes some limitations to which cells can be joined. For example, if you join the first and second cell in the header, you cannot join the second and third cell in the footer. This is because the headers and footers use the same elements in the client-side and it's not possible to create a hierarchical DOM structure to support this case. You can, however, join all three cells in the footer, because then it's again possible to organize the client-side elements in a hierarchical structure.
- Parameters:
cells
- the cells to join- Returns:
- the merged cell
- Throws:
IllegalArgumentException
- if it's not possible to join the given cells
-