ROWTYPE
- the type of the rows in the sectionpublic abstract static class Grid.StaticSection<ROWTYPE extends Grid.StaticSection.StaticRow<?>> extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
Grid.StaticSection.StaticRow<CELLTYPE extends com.vaadin.ui.Grid.StaticSection.StaticCell>
Abstract base class for Grid header and footer rows.
|
Modifier and Type | Field and Description |
---|---|
protected Grid |
grid |
protected List<ROWTYPE> |
rows |
Constructor and Description |
---|
StaticSection() |
Modifier and Type | Method and Description |
---|---|
protected void |
addColumn(Object propertyId)
Adds a column for given property id to the section.
|
ROWTYPE |
addRowAt(int index)
Inserts a new row at the given position.
|
ROWTYPE |
appendRow()
Adds a new row at the bottom of this section.
|
protected abstract ROWTYPE |
createRow() |
ROWTYPE |
getRow(int rowIndex)
Gets row at given index.
|
int |
getRowCount()
Gets the amount of rows in this section.
|
protected abstract GridStaticSectionState |
getSectionState() |
boolean |
isVisible()
Returns the visibility of this section.
|
protected void |
markAsDirty()
Informs the grid that state has changed and it should be redrawn.
|
ROWTYPE |
prependRow()
Adds a new row at the top of this section.
|
protected void |
readDesign(org.jsoup.nodes.Element tableSectionElement,
DesignContext designContext)
Writes the declarative design from the given table section element.
|
protected void |
removeColumn(Object propertyId)
Removes a column for given property id from the section.
|
ROWTYPE |
removeRow(int rowIndex)
Removes the row at the given position.
|
void |
removeRow(ROWTYPE row)
Removes the given row from the section.
|
protected void |
sanityCheck()
Performs a sanity check that section is in correct state.
|
void |
setVisible(boolean visible)
Sets the visibility of the whole section.
|
protected void |
writeDesign(org.jsoup.nodes.Element tableSectionElement,
DesignContext designContext)
Writes the declarative design to the given table section element.
|
protected Grid grid
protected List<ROWTYPE extends Grid.StaticSection.StaticRow<?>> rows
public void setVisible(boolean visible)
visible
- true to show this section, false to hidepublic boolean isVisible()
public ROWTYPE removeRow(int rowIndex)
rowIndex
- the position of the rowIllegalArgumentException
- if no row exists at given indexremoveRow(StaticRow)
,
addRowAt(int)
,
appendRow()
,
prependRow()
public void removeRow(ROWTYPE row)
row
- the row to be removedIllegalArgumentException
- if the row does not exist in this sectionremoveRow(int)
,
addRowAt(int)
,
appendRow()
,
prependRow()
public ROWTYPE getRow(int rowIndex)
rowIndex
- 0 based index for row. Counted from top to bottompublic ROWTYPE prependRow()
appendRow()
,
addRowAt(int)
,
removeRow(StaticRow)
,
removeRow(int)
public ROWTYPE appendRow()
prependRow()
,
addRowAt(int)
,
removeRow(StaticRow)
,
removeRow(int)
public ROWTYPE addRowAt(int index)
index
- the position at which to insert the rowIndexOutOfBoundsException
- if the index is out of boundsappendRow()
,
prependRow()
,
removeRow(StaticRow)
,
removeRow(int)
public int getRowCount()
protected abstract GridStaticSectionState getSectionState()
protected abstract ROWTYPE createRow()
protected void markAsDirty()
protected void removeColumn(Object propertyId)
propertyId
- property to be removedprotected void addColumn(Object propertyId)
propertyId
- property to be addedprotected void sanityCheck() throws IllegalStateException
IllegalStateException
- if merged cells are not i n continuous rangeprotected void writeDesign(org.jsoup.nodes.Element tableSectionElement, DesignContext designContext)
tableSectionElement
- Element to write design todesignContext
- the design contextprotected 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 © 2019 Vaadin Ltd. All rights reserved.