com.vaadin.ui.components.grid.
Class StaticSection<ROW extends StaticSection.StaticRow<?>>
- java.lang.Object
-
- com.vaadin.ui.components.grid.StaticSection<ROW>
-
Type Parameters:
ROW
- the type of the rows in the sectionAll Implemented Interfaces:
public abstract class StaticSection<ROW extends StaticSection.StaticRow<?>> extends Object implements Serializable
Represents the header or footer section of a Grid.
Since:
8.0
Author:
Vaadin Ltd.
See Also:
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StaticSection.StaticRow<CELL extends com.vaadin.ui.components.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 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.
boolean
isVisible()
Gets the visibility 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
setVisible(boolean visible)
Sets the visibility of this section.
void
writeDesign(org.jsoup.nodes.Element tableSectionElement, DesignContext designContext)
Writes the declarative design to the given table section element.
-
-
-
Method Detail
-
createRow
protected abstract ROW createRow()
Creates a new row instance.
Returns:
the new row
-
getState
protected abstract SectionState getState(boolean markAsDirty)
Returns the shared state of this section.
Parameters:
markAsDirty
-true
to mark the state as modified,false
otherwiseReturns:
the section state
-
getGrid
protected abstract Grid<?> getGrid()
-
getColumnByInternalId
protected abstract Grid.Column<?,?> getColumnByInternalId(String internalId)
-
getInternalIdForColumn
protected abstract String getInternalIdForColumn(Grid.Column<?,?> column)
-
markAsDirty
protected void markAsDirty()
Marks the state of this section as modified.
-
addRowAt
public ROW addRowAt(int index)
Adds a new row at the given index.
Parameters:
index
- the index of the new rowReturns:
the added row
Throws:
IndexOutOfBoundsException
- ifindex < 0 || index > getRowCount()
-
removeRow
public void removeRow(int index)
Removes the row at the given index.
Parameters:
index
- the index of the row to removeThrows:
IndexOutOfBoundsException
- ifindex < 0 || index >= getRowCount()
-
removeRow
public void removeRow(Object row)
Removes the given row from this section.
Parameters:
row
- the row to remove, not nullThrows:
IllegalArgumentException
- if this section does not contain the row
-
getRow
public ROW getRow(int index)
Returns the row at the given index.
Parameters:
index
- the index of the rowReturns:
the row at the index
Throws:
IndexOutOfBoundsException
- ifindex < 0 || index >= getRowCount()
-
getRowCount
public int getRowCount()
Returns the number of rows in this section.
Returns:
the number of rows
-
addColumn
public void addColumn(String columnId)
Adds a cell corresponding to the given column id to this section.
Parameters:
columnId
- the id of the column for which to add a cell
-
removeColumn
public void removeColumn(String columnId)
Removes the cell corresponding to the given column id.
Parameters:
columnId
- the id of the column whose cell to remove
-
writeDesign
public 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 context
-
readDesign
public void readDesign(org.jsoup.nodes.Element tableSectionElement, DesignContext designContext) throws DesignException
Reads 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
-
getRows
protected List<ROW> getRows()
Returns an unmodifiable list of the rows in this section.
Returns:
the rows in this section
-
setVisible
public void setVisible(boolean visible)
Sets the visibility of this section.
Parameters:
visible
-true
if visible;false
if notSince:
8.1.1
-
isVisible
public boolean isVisible()
Gets the visibility of this section.
Returns:
true
if visible;false
if notSince:
8.1.1
-
-