Interface RowContainer
-
- All Known Subinterfaces:
RowContainer.BodyRowContainer
- All Known Implementing Classes:
Escalator.AbstractRowContainer
public interface RowContainerA representation of the rows in each of the sections (header, body and footer) in anEscalator.- Since:
- 7.4
- Author:
- Vaadin Ltd
- See Also:
Escalator.getHeader(),Escalator.getBody(),Escalator.getFooter(),SpacerContainer
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceRowContainer.BodyRowContainerThe row container for the body section in anEscalator.
-
Field Summary
Fields Modifier and Type Field Description static doubleINITIAL_DEFAULT_ROW_HEIGHTAn arbitrary pixel height of a row, before any autodetection for the row height has been made.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CellgetCell(com.google.gwt.dom.client.Element element)Returns the cell object which contains information about the cell the element is in.doublegetDefaultRowHeight()Returns the default height of the rows in this RowContainer.intgetDomRowCount()This method calculates the current row count directly from the DOM.com.google.gwt.dom.client.TableSectionElementgetElement()Returns the root element of RowContainer.EscalatorUpdatergetEscalatorUpdater()Returns the currentEscalatorUpdaterused to render cells.intgetRowCount()Gets the number of rows in the current row container.com.google.gwt.dom.client.TableRowElementgetRowElement(int index)Gets the row element with given logical index.voidinsertRows(int index, int numberOfRows)Adds rows at a certain index in this row container.voidrefreshRows(int index, int numberOfRows)Refreshes a range of rows in the current row container.voidremoveRows(int index, int numberOfRows)Removes rows at a certain index in the current row container.voidsetDefaultRowHeight(double px)The default height of the rows in this RowContainer.voidsetEscalatorUpdater(EscalatorUpdater escalatorUpdater)Sets theEscalatorUpdaterto use when displaying data in the escalator.
-
-
-
Field Detail
-
INITIAL_DEFAULT_ROW_HEIGHT
static final double INITIAL_DEFAULT_ROW_HEIGHT
An arbitrary pixel height of a row, before any autodetection for the row height has been made.- See Also:
- Constant Field Values
-
-
Method Detail
-
getEscalatorUpdater
EscalatorUpdater getEscalatorUpdater()
Returns the currentEscalatorUpdaterused to render cells.- Returns:
- the current escalator updater
-
setEscalatorUpdater
void setEscalatorUpdater(EscalatorUpdater escalatorUpdater) throws IllegalArgumentException
Sets theEscalatorUpdaterto use when displaying data in the escalator.- Parameters:
escalatorUpdater- the escalator updater to use to render cells. May not benull- Throws:
IllegalArgumentException- ifcellRendererisnull- See Also:
EscalatorUpdater.NULL
-
removeRows
void removeRows(int index, int numberOfRows) throws IndexOutOfBoundsException, IllegalArgumentExceptionRemoves rows at a certain index in the current row container.- Parameters:
index- the index of the first row to be removednumberOfRows- the number of rows to remove, starting from the index- Throws:
IndexOutOfBoundsException- if any integer number in the range[index..(index+numberOfRows)]is not an existing row indexIllegalArgumentException- ifnumberOfRowsis less than 1.
-
insertRows
void insertRows(int index, int numberOfRows) throws IndexOutOfBoundsException, IllegalArgumentExceptionAdds rows at a certain index in this row container.The new rows will be inserted between the row at the index, and the row before (an index of 0 means that the rows are inserted at the beginning). Therefore, the rows currently at the index and afterwards will be moved downwards.
The contents of the inserted rows will subsequently be queried from the escalator updater.
Note: Only the contents of the inserted rows will be rendered. If inserting new rows affects the contents of existing rows,
refreshRows(int, int)needs to be called for those rows separately.- Parameters:
index- the index of the row before which new rows are inserted, orgetRowCount()to add rows at the endnumberOfRows- the number of rows to insert after theindex- Throws:
IndexOutOfBoundsException- ifindexis not an integer in the range[0..getRowCount()]IllegalArgumentException- ifnumberOfRowsis less than 1.- See Also:
setEscalatorUpdater(EscalatorUpdater)
-
refreshRows
void refreshRows(int index, int numberOfRows) throws IndexOutOfBoundsException, IllegalArgumentExceptionRefreshes a range of rows in the current row container.The data for the refreshed rows is queried from the current cell renderer.
- Parameters:
index- the index of the first row that will be updatednumberOfRows- the number of rows to update, starting from the index- Throws:
IndexOutOfBoundsException- if any integer number in the range[index..(index+numberOfColumns)]is not an existing column index.IllegalArgumentException- ifnumberOfRowsis less than 1.- See Also:
setEscalatorUpdater(EscalatorUpdater)
-
getRowCount
int getRowCount()
Gets the number of rows in the current row container.- Returns:
- the number of rows in the current row container
-
getDomRowCount
int getDomRowCount()
This method calculates the current row count directly from the DOM.While the container is stable, this value should equal to
getRowCount(), but while row counts are being updated, these two values might differ for a short while.Any extra content, such as spacers for the body, should not be included in this count.
- Returns:
- the actual DOM count of rows
- Since:
- 8.7
-
setDefaultRowHeight
void setDefaultRowHeight(double px) throws IllegalArgumentExceptionThe default height of the rows in this RowContainer.- Parameters:
px- the default height in pixels of the rows in this RowContainer- Throws:
IllegalArgumentException- ifpx < 1- See Also:
getDefaultRowHeight()
-
getDefaultRowHeight
double getDefaultRowHeight()
Returns the default height of the rows in this RowContainer.This value will be equal to
INITIAL_DEFAULT_ROW_HEIGHTif theEscalatorhas not yet had a chance to autodetect the row height, or no explicit value has yet given via#setDefaultRowHeight(int)- Returns:
- the default height of the rows in this RowContainer, in pixels
- See Also:
#setDefaultRowHeight(int)
-
getCell
Cell getCell(com.google.gwt.dom.client.Element element)
Returns the cell object which contains information about the cell the element is in.- Parameters:
element- The element to get the cell for. If element is not present in row container thennullis returned.- Returns:
- the cell of the element, or
nullif element is not present in theRowContainer.
-
getRowElement
com.google.gwt.dom.client.TableRowElement getRowElement(int index) throws IndexOutOfBoundsException, IllegalStateExceptionGets the row element with given logical index. For lazy loaded containers such as Escalators BodyRowContainer visibility should be checked before calling this function. SeeEscalator.getVisibleRowRange().- Parameters:
index- the logical index of the element to retrieve- Returns:
- the element at position
index - Throws:
IndexOutOfBoundsException- ifindexis not valid within containerIllegalStateException- ifindexis currently not available in the DOM
-
getElement
com.google.gwt.dom.client.TableSectionElement getElement()
Returns the root element of RowContainer.- Returns:
- RowContainer root element
-
-