public static interface RowContainer.BodyRowContainer extends RowContainer
Escalator.
The body section can contain both rows and spacers.
Escalator.getBody()RowContainer.BodyRowContainerINITIAL_DEFAULT_ROW_HEIGHT| Modifier and Type | Method and Description |
|---|---|
SpacerUpdater |
getSpacerUpdater()
Gets the spacer updater currently in use.
|
void |
insertRows(int index,
int numberOfRows)
Adds rows at a certain index in this row container.
|
void |
removeRows(int index,
int numberOfRows)
Removes rows at a certain index in the current row container.
|
void |
setNewRowCallback(Consumer<List<com.google.gwt.dom.client.TableRowElement>> consumer)
Sets a callback function that is executed when new rows are added to
the escalator.
|
void |
setSpacer(int rowIndex,
double height)
Marks a spacer and its height.
|
void |
setSpacerUpdater(SpacerUpdater spacerUpdater)
Sets a new spacer updater.
|
getCell, getDefaultRowHeight, getElement, getEscalatorUpdater, getRowCount, getRowElement, refreshRows, setDefaultRowHeight, setEscalatorUpdatervoid setSpacer(int rowIndex,
double height)
throws IllegalArgumentException
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
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. If height is
negative, the affected spacer (if exists) will be removedIllegalArgumentException - if rowIndex is not a valid row indexinsertRows(int, int),
removeRows(int, int)void setSpacerUpdater(SpacerUpdater spacerUpdater) throws IllegalArgumentException
Spacers that are currently visible will be updated, i.e.
destroyed with the previous
one, and initialized with the new
one.
spacerUpdater - the new spacer updaterIllegalArgumentException - if spacerUpdater is nullSpacerUpdater getSpacerUpdater()
SpacerUpdater.NULL is the default.
nullvoid insertRows(int index,
int numberOfRows)
throws IndexOutOfBoundsException,
IllegalArgumentException
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 index will be offset and "pushed"
down. This also modifies the row index they are associated with.
insertRows in interface RowContainerindex - the index of the row before which new rows are inserted, or
RowContainer.getRowCount() to add rows at the endnumberOfRows - the number of rows to insert after the indexIndexOutOfBoundsException - if index is not an integer in the range
[0..RowContainer.getRowCount()]IllegalArgumentException - if numberOfRows is less than 1.RowContainer.setEscalatorUpdater(EscalatorUpdater)void removeRows(int index,
int numberOfRows)
throws IndexOutOfBoundsException,
IllegalArgumentException
Any spacers underneath index will 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.
removeRows in interface RowContainerindex - the index of the first row to be removednumberOfRows - the number of rows to remove, starting from the indexIndexOutOfBoundsException - if any integer number in the range
[index..(index+numberOfRows)] is not an existing
row indexIllegalArgumentException - if numberOfRows is less than 1.Copyright © 2018 Vaadin Ltd. All rights reserved.