com.vaadin.ui.components.grid.
Class StaticSection.StaticRow<CELL extends com.vaadin.ui.components.grid.StaticSection.StaticCell>
- java.lang.Object
-
- com.vaadin.ui.components.grid.StaticSection.StaticRow<CELL>
-
Type Parameters:
CELL
- the type of the cells in the rowAll Implemented Interfaces:
Direct Known Subclasses:
Enclosing class:
StaticSection<ROW extends StaticSection.StaticRow<?>>
public abstract static class StaticSection.StaticRow<CELL extends com.vaadin.ui.components.grid.StaticSection.StaticCell> extends Object implements Serializable
Abstract base class for Grid header and footer rows.
See Also:
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
StaticRow(StaticSection<?> section)
Creates a new row belonging to the given section.
-
Method Summary
All Methods Modifier and Type Method Description protected void
addCell(Grid.Column<?,?> column)
Adds a cell to this section for given column.
protected void
addCell(String columnId)
Adds a cell to this section, corresponding to the given user-defined column id.
protected abstract CELL
createCell()
Creates and returns a new instance of the cell type.
CELL
getCell(Grid.Column<?,?> column)
Returns the cell in this section that corresponds to the given column.
CELL
getCell(String columnId)
Returns the cell in this section that corresponds to the given column id.
protected abstract String
getCellTagName()
Returns the declarative tag name used for the cells in this row.
Collection<? extends Component>
getComponents()
protected SectionState.RowState
getRowState()
Returns the shared state of this row.
String
getStyleName()
Returns the custom style name for this row.
protected void
internalAddCell(String internalId)
Adds a cell to this section, corresponding to the given internal column id.
protected CELL
internalGetCell(String internalId)
Returns the cell in this section that corresponds to the given internal column id.
protected void
readDesign(org.jsoup.nodes.Element trElement, DesignContext designContext)
Reads the declarative design from the given table row element.
protected void
removeCell(String columnId)
Removes the cell from this section that corresponds to the given column id.
void
setStyleName(String styleName)
Sets a custom style name for this row.
protected void
writeCellState(org.jsoup.nodes.Element cellElement, DesignContext context, SectionState.CellState state)
Writes declarative design for the cell using its
state
to the given table cell element.protected void
writeDesign(org.jsoup.nodes.Element trElement, DesignContext designContext)
Writes the declarative design to the given table row element.
-
-
-
Constructor Detail
-
StaticRow
protected StaticRow(StaticSection<?> section)
Creates a new row belonging to the given section.
Parameters:
section
- the section of the row
-
-
Method Detail
-
createCell
protected abstract CELL createCell()
Creates and returns a new instance of the cell type.
Returns:
the created cell
-
getCellTagName
protected abstract String getCellTagName()
Returns the declarative tag name used for the cells in this row.
Returns:
the cell tag name
-
addCell
protected void addCell(String columnId)
Adds a cell to this section, corresponding to the given user-defined column id.
Parameters:
columnId
- the id of the column for which to add a cell
-
addCell
protected void addCell(Grid.Column<?,?> column)
Adds a cell to this section for given column.
Parameters:
column
- the column for which to add a cell
-
internalAddCell
protected void internalAddCell(String internalId)
Adds a cell to this section, corresponding to the given internal column id.
Parameters:
internalId
- the internal id of the column for which to add a cell
-
removeCell
protected void removeCell(String columnId)
Removes the cell from this section that corresponds to the given column id. If there is no such cell, does nothing.
Parameters:
columnId
- the id of the column from which to remove the cell
-
getRowState
protected SectionState.RowState getRowState()
Returns the shared state of this row.
Returns:
the row state
-
getCell
public CELL getCell(String columnId)
Returns the cell in this section that corresponds to the given column id.
Parameters:
columnId
- the id of the columnReturns:
the cell for the given column
Throws:
IllegalArgumentException
- if no cell was found for the column idSee Also:
-
getCell
public CELL getCell(Grid.Column<?,?> column)
Returns the cell in this section that corresponds to the given column.
Parameters:
column
- the columnReturns:
the cell for the given column
Throws:
IllegalArgumentException
- if no cell was found for the column
-
getStyleName
public String getStyleName()
Returns the custom style name for this row.
Returns:
the style name or null if no style name has been set
-
setStyleName
public void setStyleName(String styleName)
Sets a custom style name for this row.
Parameters:
styleName
- the style name to set or null to not use any style name
-
internalGetCell
protected CELL internalGetCell(String internalId)
Returns the cell in this section that corresponds to the given internal column id.
Parameters:
internalId
- the internal id of the columnReturns:
the cell for the given column
Throws:
IllegalArgumentException
- if no cell was found for the column id
-
readDesign
protected void readDesign(org.jsoup.nodes.Element trElement, DesignContext designContext) throws DesignException
Reads the declarative design from the given table row element.
Parameters:
trElement
- Element to read design fromdesignContext
- the design contextThrows:
DesignException
- if the given table row contains unexpected childrenSince:
7.5.0
-
writeDesign
protected void writeDesign(org.jsoup.nodes.Element trElement, DesignContext designContext)
Writes the declarative design to the given table row element.
Parameters:
trElement
- Element to write design todesignContext
- the design contextSince:
7.5.0
-
writeCellState
protected void writeCellState(org.jsoup.nodes.Element cellElement, DesignContext context, SectionState.CellState state)
Writes declarative design for the cell using its
state
to the given table cell element.The method is used instead of StaticCell::writeDesign because sometimes there is no a reference to the cell which should be written (merged cell) but only its state is available (the cell is virtual and is not stored).
Parameters:
cellElement
- Element to write design tocontext
- the design contextstate
- a cell state
-
getComponents
public Collection<? extends Component> getComponents()
-
-