Package com.vaadin.v7.client.widgets
Class Grid.StaticSection<ROWTYPE extends Grid.StaticSection.StaticRow<?>>
- java.lang.Object
-
- com.vaadin.v7.client.widgets.Grid.StaticSection<ROWTYPE>
-
- Type Parameters:
ROWTYPE- the type of the rows in the section
- Direct Known Subclasses:
Grid.Footer,Grid.Header
public abstract static class Grid.StaticSection<ROWTYPE extends Grid.StaticSection.StaticRow<?>> extends Object
Abstract base class for Grid header and footer sections.- Since:
- 7.5.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGrid.StaticSection.StaticCellA header or footer cell.static classGrid.StaticSection.StaticRow<CELLTYPE extends Grid.StaticSection.StaticCell>Abstract base class for Grid header and footer rows.
-
Constructor Summary
Constructors Constructor Description StaticSection()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddColumn(Grid.Column<?,?> column)ROWTYPEaddRowAt(int index)Inserts a new row at the given position.ROWTYPEappendRow()Adds a new row at the bottom of this section.protected abstract ROWTYPEcreateRow()Creates and returns a new instance of the row type.protected Grid<?>getGrid()ROWTYPEgetRow(int index)Returns the row at the given position.intgetRowCount()Returns the number of rows in this section.protected List<ROWTYPE>getRows()protected intgetVisibleRowCount()booleanisVisible()Returns the visibility of this section.ROWTYPEprependRow()Adds a new row at the top of this section.protected voidremoveColumn(Grid.Column<?,?> column)voidremoveRow(int index)Removes the row at the given position.voidremoveRow(ROWTYPE row)Removes the given row from the section.protected abstract voidrequestSectionRefresh()Informs the grid that this section should be re-rendered.protected voidsetGrid(Grid<?> grid)voidsetVisible(boolean visible)Sets the visibility of the whole section.protected voidupdateColSpans()
-
-
-
Method Detail
-
createRow
protected abstract ROWTYPE createRow()
Creates and returns a new instance of the row type.- Returns:
- the created row
-
requestSectionRefresh
protected abstract void requestSectionRefresh()
Informs the grid that this section should be re-rendered.Note that re-render means calling update() on each cell, preAttach()/postAttach()/preDetach()/postDetach() is not called as the cells are not removed from the DOM.
-
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.
-
addRowAt
public ROWTYPE addRowAt(int index)
Inserts a new row at the given position. Shifts the row currently at that position and any subsequent rows down (adds one to their indices).- Parameters:
index- the position at which to insert the row- Returns:
- the new row
- Throws:
IndexOutOfBoundsException- if the index is out of bounds- See Also:
appendRow(),prependRow(),removeRow(int),removeRow(StaticRow)
-
prependRow
public ROWTYPE prependRow()
Adds a new row at the top of this section.- Returns:
- the new row
- See Also:
appendRow(),addRowAt(int),removeRow(int),removeRow(StaticRow)
-
appendRow
public ROWTYPE appendRow()
Adds a new row at the bottom of this section.- Returns:
- the new row
- See Also:
prependRow(),addRowAt(int),removeRow(int),removeRow(StaticRow)
-
removeRow
public void removeRow(int index)
Removes the row at the given position.- Parameters:
index- the position of the row- Throws:
IndexOutOfBoundsException- if the index is out of bounds- See Also:
addRowAt(int),appendRow(),prependRow(),removeRow(StaticRow)
-
removeRow
public void removeRow(ROWTYPE row)
Removes the given row from the section.- Parameters:
row- the row to be removed- Throws:
IllegalArgumentException- if the row does not exist in this section- See Also:
addRowAt(int),appendRow(),prependRow(),removeRow(int)
-
getRow
public ROWTYPE getRow(int index)
Returns the row at the given position.- Parameters:
index- the position of the row- Returns:
- the row with the given index
- Throws:
IndexOutOfBoundsException- if the index is out of bounds
-
getRowCount
public int getRowCount()
Returns the number of rows in this section.- Returns:
- the number of rows
-
getVisibleRowCount
protected int getVisibleRowCount()
-
addColumn
protected void addColumn(Grid.Column<?,?> column)
-
removeColumn
protected void removeColumn(Grid.Column<?,?> column)
-
setGrid
protected void setGrid(Grid<?> grid)
-
getGrid
protected Grid<?> getGrid()
-
updateColSpans
protected void updateColSpans()
-
-