com.vaadin.ui.
Class Grid.StaticSection<ROWTYPE extends Grid.StaticSection.StaticRow<?>>
- java.lang.Object
-
- com.vaadin.ui.Grid.StaticSection<ROWTYPE>
-
Type Parameters:
ROWTYPE
- the type of the rows in the sectionAll Implemented Interfaces:
Direct Known Subclasses:
Enclosing class:
public abstract static class Grid.StaticSection<ROWTYPE extends Grid.StaticSection.StaticRow<?>> extends Object implements Serializable
Abstract base class for Grid header and footer sections.
Since:
7.6
See Also:
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Grid.StaticSection.StaticRow<CELLTYPE extends com.vaadin.ui.Grid.StaticSection.StaticCell>
Abstract base class for Grid header and footer rows.
-
Constructor Summary
Constructors Constructor Description StaticSection()
-
Method Summary
All Methods Modifier and Type Method 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.
-
-
-
Field Detail
-
grid
protected Grid grid
-
rows
protected List<ROWTYPE extends Grid.StaticSection.StaticRow<?>> rows
-
-
Method Detail
-
setVisible
public void setVisible(boolean visible)
Sets the visibility of the whole section.
Parameters:
visible
- true to show this section, false to hide
-
isVisible
public boolean isVisible()
Returns the visibility of this section.
Returns:
true if visible, false otherwise.
-
removeRow
public ROWTYPE removeRow(int rowIndex)
Removes the row at the given position.
Parameters:
rowIndex
- the position of the rowThrows:
IllegalArgumentException
- if no row exists at given indexSee Also:
removeRow(StaticRow)
,addRowAt(int)
,appendRow()
,prependRow()
-
removeRow
public void removeRow(ROWTYPE row)
Removes the given row from the section.
Parameters:
row
- the row to be removedThrows:
IllegalArgumentException
- if the row does not exist in this sectionSee Also:
-
getRow
public ROWTYPE getRow(int rowIndex)
Gets row at given index.
Parameters:
rowIndex
- 0 based index for row. Counted from top to bottomReturns:
row at given index
-
prependRow
public ROWTYPE prependRow()
Adds a new row at the top of this section.
Returns:
the new row
See Also:
appendRow()
,addRowAt(int)
,removeRow(StaticRow)
,removeRow(int)
-
appendRow
public ROWTYPE appendRow()
Adds a new row at the bottom of this section.
Returns:
the new row
See Also:
prependRow()
,addRowAt(int)
,removeRow(StaticRow)
,removeRow(int)
-
addRowAt
public ROWTYPE addRowAt(int index)
Inserts a new row at the given position.
Parameters:
index
- the position at which to insert the rowReturns:
the new row
Throws:
IndexOutOfBoundsException
- if the index is out of boundsSee Also:
appendRow()
,prependRow()
,removeRow(StaticRow)
,removeRow(int)
-
getRowCount
public int getRowCount()
Gets the amount of rows in this section.
Returns:
row count
-
getSectionState
protected abstract GridStaticSectionState getSectionState()
-
createRow
protected abstract ROWTYPE createRow()
-
markAsDirty
protected void markAsDirty()
Informs the grid that state has changed and it should be redrawn.
-
removeColumn
protected void removeColumn(Object propertyId)
Removes a column for given property id from the section.
Parameters:
propertyId
- property to be removed
-
addColumn
protected void addColumn(Object propertyId)
Adds a column for given property id to the section.
Parameters:
propertyId
- property to be added
-
sanityCheck
protected void sanityCheck() throws IllegalStateException
Performs a sanity check that section is in correct state.
Throws:
IllegalStateException
- if merged cells are not i n continuous range
-
writeDesign
protected void writeDesign(org.jsoup.nodes.Element tableSectionElement, DesignContext designContext)
Writes the declarative design to the given table section element.
Parameters:
tableSectionElement
- Element to write design todesignContext
- the design contextSince:
7.5.0
-
readDesign
protected void readDesign(org.jsoup.nodes.Element tableSectionElement, DesignContext designContext) throws DesignException
Writes the declarative design from the given table section element.
Parameters:
tableSectionElement
- Element to read design fromdesignContext
- the design contextThrows:
DesignException
- if the table section contains unexpected childrenSince:
7.5.0
-
-