Interface RowContainer.BodyRowContainer
-
- All Superinterfaces:
RowContainer
- Enclosing interface:
- RowContainer
public static interface RowContainer.BodyRowContainer extends RowContainer
The row container for the body section in anEscalator.The body section can contain both rows and spacers.
- Since:
- 7.5.0
- Author:
- Vaadin Ltd
- See Also:
Escalator.getBody()
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.client.widget.escalator.RowContainer
RowContainer.BodyRowContainer
-
-
Field Summary
-
Fields inherited from interface com.vaadin.client.widget.escalator.RowContainer
INITIAL_DEFAULT_ROW_HEIGHT
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SpacerUpdatergetSpacerUpdater()Gets the spacer updater currently in use.voidinsertRows(int index, int numberOfRows)Adds rows at a certain index in this row container.voidremoveRows(int index, int numberOfRows)Removes rows at a certain index in the current row container.voidsetSpacer(int rowIndex, double height)Marks a spacer and its height.voidsetSpacerUpdater(SpacerUpdater spacerUpdater)Sets a new spacer updater.-
Methods inherited from interface com.vaadin.client.widget.escalator.RowContainer
getCell, getDefaultRowHeight, getElement, getEscalatorUpdater, getRowCount, getRowElement, refreshRows, setDefaultRowHeight, setEscalatorUpdater
-
-
-
-
Method Detail
-
setSpacer
void setSpacer(int rowIndex, double height) throws IllegalArgumentExceptionMarks a spacer and its height.If a spacer is already registered with the given row index, that spacer will be updated with the given height.
Note: The row index for a spacer will change if rows are inserted or removed above the current position. Spacers will also be removed alongside their associated rows
- Parameters:
rowIndex- the row index for the spacer to modify. The affected spacer is underneath the given index. Use -1 to insert a spacer before the first rowheight- the pixel height of the spacer. Ifheightis negative, the affected spacer (if exists) will be removed- Throws:
IllegalArgumentException- ifrowIndexis not a valid row index- See Also:
insertRows(int, int),removeRows(int, int)
-
setSpacerUpdater
void setSpacerUpdater(SpacerUpdater spacerUpdater) throws IllegalArgumentException
Sets a new spacer updater.Spacers that are currently visible will be updated, i.e.
destroyedwith the previous one, andinitializedwith the new one.- Parameters:
spacerUpdater- the new spacer updater- Throws:
IllegalArgumentException- ifspacerUpdaterisnull
-
getSpacerUpdater
SpacerUpdater getSpacerUpdater()
Gets the spacer updater currently in use.SpacerUpdater.NULLis the default.- Returns:
- the spacer updater currently in use. Never
null
-
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,
RowContainer.refreshRows(int, int)needs to be called for those rows separately.Any spacers underneath
indexwill be offset and "pushed" down. This also modifies the row index they are associated with.- Specified by:
insertRowsin interfaceRowContainer- Parameters:
index- the index of the row before which new rows are inserted, orRowContainer.getRowCount()to add rows at the endnumberOfRows- the number of rows to insert after theindex- Throws:
IndexOutOfBoundsException- ifindexis not an integer in the range[0..RowContainer.getRowCount()]IllegalArgumentException- ifnumberOfRowsis less than 1.- See Also:
RowContainer.setEscalatorUpdater(EscalatorUpdater)
-
removeRows
void removeRows(int index, int numberOfRows) throws IndexOutOfBoundsException, IllegalArgumentExceptionRemoves rows at a certain index in the current row container.Any spacers underneath
indexwill be offset and "pulled" up. This also modifies the row index they are associated with. Any spacers in the removed range will also be closed and removed.- Specified by:
removeRowsin interfaceRowContainer- 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.
-
-