ROW - the type of the rows in the sectionpublic abstract class StaticSection<ROW extends StaticSection.StaticRow<?>> extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
StaticSection.StaticRow<CELL extends com.vaadin.ui.components.grid.StaticSection.StaticCell>
Abstract base class for Grid header and footer rows.
|
| Constructor and Description |
|---|
StaticSection() |
| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(String columnId)
Adds a cell corresponding to the given column id to this section.
|
ROW |
addRowAt(int index)
Adds a new row at the given index.
|
protected abstract ROW |
createRow()
Creates a new row instance.
|
protected abstract Grid.Column<?,?> |
getColumnByInternalId(String internalId) |
protected abstract Grid<?> |
getGrid() |
protected abstract String |
getInternalIdForColumn(Grid.Column<?,?> column) |
ROW |
getRow(int index)
Returns the row at the given index.
|
int |
getRowCount()
Returns the number of rows in this section.
|
protected List<ROW> |
getRows()
Returns an unmodifiable list of the rows in this section.
|
protected abstract SectionState |
getState(boolean markAsDirty)
Returns the shared state of this section.
|
protected void |
markAsDirty()
Marks the state of this section as modified.
|
void |
readDesign(org.jsoup.nodes.Element tableSectionElement,
DesignContext designContext)
Reads the declarative design from the given table section element.
|
void |
removeColumn(String columnId)
Removes the cell corresponding to the given column id.
|
void |
removeRow(int index)
Removes the row at the given index.
|
void |
removeRow(Object row)
Removes the given row from this section.
|
void |
writeDesign(org.jsoup.nodes.Element tableSectionElement,
DesignContext designContext)
Writes the declarative design to the given table section element.
|
protected abstract ROW createRow()
protected abstract SectionState getState(boolean markAsDirty)
markAsDirty - true to mark the state as modified, false
otherwiseprotected abstract Grid<?> getGrid()
protected abstract Grid.Column<?,?> getColumnByInternalId(String internalId)
protected abstract String getInternalIdForColumn(Grid.Column<?,?> column)
protected void markAsDirty()
public ROW addRowAt(int index)
index - the index of the new rowIndexOutOfBoundsException - if index < 0 || index > getRowCount()public void removeRow(int index)
index - the index of the row to removeIndexOutOfBoundsException - if index < 0 || index >= getRowCount()public void removeRow(Object row)
row - the row to remove, not nullIllegalArgumentException - if this section does not contain the rowpublic ROW getRow(int index)
index - the index of the rowIndexOutOfBoundsException - if index < 0 || index >= getRowCount()public int getRowCount()
public void addColumn(String columnId)
columnId - the id of the column for which to add a cellpublic void removeColumn(String columnId)
columnId - the id of the column whose cell to removepublic void writeDesign(org.jsoup.nodes.Element tableSectionElement,
DesignContext designContext)
tableSectionElement - Element to write design todesignContext - the design contextpublic void readDesign(org.jsoup.nodes.Element tableSectionElement,
DesignContext designContext)
throws DesignException
tableSectionElement - Element to read design fromdesignContext - the design contextDesignException - if the table section contains unexpected childrenCopyright © 2017 Vaadin Ltd. All rights reserved.