public class HeaderRow extends Object
HeaderRow.HeaderCell
s in a Grid.Modifier and Type | Class and Description |
---|---|
static class |
AbstractRow.AbstractCell
Base class for header and footer cells.
|
static class |
HeaderRow.HeaderCell
A header cell in a Grid.
|
Modifier and Type | Field and Description |
---|---|
protected List<CELL> |
cells |
protected com.vaadin.flow.component.grid.ColumnLayer |
layer |
Modifier and Type | Method and Description |
---|---|
protected void |
addCell(int index,
com.vaadin.flow.component.grid.AbstractColumn<?> column) |
CELL |
getCell(Grid.Column<?> column)
Gets the cell on this row that is on the given column.
|
List<CELL> |
getCells()
Gets the cells that belong to this row as an unmodifiable list.
|
protected boolean |
isOutmostRow()
Gets whether this is the top-most HeaderRow or the bottom-most FooterRow.
|
CELL |
join(CELL... cells)
Replaces the given cells with a new cell that takes the full space of the
joined cells.
|
HeaderRow.HeaderCell |
join(Collection<HeaderRow.HeaderCell> cells)
Replaces the given cells with a new cell that takes the full space of the
joined cells.
|
HeaderRow.HeaderCell |
join(Grid.Column<?>... columnsToMerge)
Joins the cells corresponding the given columns in the row.
|
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 columns
|
protected void |
setLayer(com.vaadin.flow.component.grid.ColumnLayer layer)
Change this row to wrap the given layer
|
protected com.vaadin.flow.component.grid.ColumnLayer layer
protected List<CELL extends AbstractRow.AbstractCell> cells
public HeaderRow.HeaderCell join(Grid.Column<?>... columnsToMerge)
columnsToMerge
- the columns of the cells that should be mergedjoin(Collection)
public HeaderRow.HeaderCell join(Collection<HeaderRow.HeaderCell> cells)
The cells to join must be adjacent cells in this row, and this row must be the out-most row.
cells
- the cells to joinprotected boolean isOutmostRow()
protected void setLayer(com.vaadin.flow.component.grid.ColumnLayer layer)
layer
- the layer to wrapprotected void setColumns(List<com.vaadin.flow.component.grid.AbstractColumn<?>> columns)
columns
- new column components for the cellsprotected void addCell(int index, com.vaadin.flow.component.grid.AbstractColumn<?> column)
protected void removeCell(com.vaadin.flow.component.grid.AbstractColumn<?> columnComponent)
public List<CELL> getCells()
public CELL getCell(Grid.Column<?> column)
column
- the column to find cell forIllegalArgumentException
- if the column does not belong to the same grid as this rowpublic CELL join(CELL... 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.
cells
- the cells to joinIllegalArgumentException
- if it's not possible to join the given cellsCopyright © 2020. All rights reserved.