com.vaadin.client.widget.escalator.
Interface RowContainer.BodyRowContainer
-
All Superinterfaces:
Enclosing interface:
public static interface RowContainer.BodyRowContainer extends RowContainer
The row container for the body section in an
Escalator
.The body section can contain both rows and spacers.
Since:
7.5.0
Author:
Vaadin Ltd
See Also:
-
-
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 Modifier and Type Method 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
resetSpacer(int rowIndex)
Updates the spacer corresponding with the given rowIndex to currently provided contents.
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.
boolean
spacerExists(int rowIndex)
Checks whether the given rowIndex contains a spacer.
void
updateRowPositions(int index, int numberOfRows)
Recalculates and updates the positions of rows and spacers within the given range and ensures there is no gap below the rows if there are enough rows to fill the space.
-
Methods inherited from interface com.vaadin.client.widget.escalator.RowContainer
getCell, getDefaultRowHeight, getElement, getEscalatorUpdater, getRowCount, getRowElement, isAutodetectingRowHeightLater, refreshRows, setDefaultRowHeight, setEscalatorUpdater
-
-
-
-
Method Detail
-
setSpacer
void setSpacer(int rowIndex, double height) throws IllegalArgumentException
Marks 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. Ifheight
is negative, the affected spacer (if exists) will be removedThrows:
IllegalArgumentException
- ifrowIndex
is not a valid row indexSee Also:
-
spacerExists
boolean spacerExists(int rowIndex)
Checks whether the given rowIndex contains a spacer.
Parameters:
rowIndex
- the row index for the queried spacer.Returns:
true
if spacer for given row index exists,false
otherwiseSince:
8.9
-
resetSpacer
void resetSpacer(int rowIndex)
Updates the spacer corresponding with the given rowIndex to currently provided contents.
Parameters:
rowIndex
- the row index for the spacer in need of updatingSince:
8.13
-
setSpacerUpdater
void setSpacerUpdater(SpacerUpdater spacerUpdater) throws IllegalArgumentException
Sets a new spacer updater.
Spacers that are currently visible will be updated, i.e.
destroyed
with the previous one, andinitialized
with the new one.Parameters:
spacerUpdater
- the new spacer updaterThrows:
IllegalArgumentException
- ifspacerUpdater
isnull
-
getSpacerUpdater
SpacerUpdater getSpacerUpdater()
Gets the spacer updater currently in use.
SpacerUpdater.NULL
is the default.Returns:
the spacer updater currently in use. Never
null
-
insertRows
void insertRows(int index, int numberOfRows) throws IndexOutOfBoundsException, IllegalArgumentException
Adds 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
index
will be offset and "pushed" down. This also modifies the row index they are associated with.Specified by:
insertRows
in 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
- ifindex
is not an integer in the range[0..
RowContainer.getRowCount()
]IllegalArgumentException
- ifnumberOfRows
is less than 1.See Also:
-
removeRows
void removeRows(int index, int numberOfRows) throws IndexOutOfBoundsException, IllegalArgumentException
Removes rows at a certain index in the current row container.
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.Specified by:
removeRows
in interfaceRowContainer
Parameters:
index
- the index of the first row to be removednumberOfRows
- the number of rows to remove, starting from the indexThrows:
IndexOutOfBoundsException
- if any integer number in the range[index..(index+numberOfRows)]
is not an existing row indexIllegalArgumentException
- ifnumberOfRows
is less than 1.
-
updateRowPositions
void updateRowPositions(int index, int numberOfRows)
Recalculates and updates the positions of rows and spacers within the given range and ensures there is no gap below the rows if there are enough rows to fill the space. Recalculates the scrollbars for virtual viewport.
Parameters:
index
- logical index of the first row to repositionnumberOfRows
- the number of rows to repositionSince:
8.9
-
-