com.vaadin.client.widget.escalator.

Interface RowContainer.BodyRowContainer

    • 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 row

        height - the pixel height of the spacer. If height is negative, the affected spacer (if exists) will be removed

        Throws:

        IllegalArgumentException - if rowIndex is not a valid row index

        See Also:

        insertRows(int, int), removeRows(int, int)

      • 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 otherwise

        Since:

        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 updating

        Since:

        8.13

      • 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 interface RowContainer

        Parameters:

        index - the index of the row before which new rows are inserted, or RowContainer.getRowCount() to add rows at the end

        numberOfRows - the number of rows to insert after the index

        Throws:

        IndexOutOfBoundsException - if index is not an integer in the range [0..RowContainer.getRowCount()]

        IllegalArgumentException - if numberOfRows is less than 1.

        See Also:

        RowContainer.setEscalatorUpdater(EscalatorUpdater)

      • 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 interface RowContainer

        Parameters:

        index - the index of the first row to be removed

        numberOfRows - 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 index

        IllegalArgumentException - if numberOfRows 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 reposition

        numberOfRows - the number of rows to reposition

        Since:

        8.9

      • setNewRowCallback

        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.

        Parameters:

        consumer - A Consumer function that receives the newly added table row elements.

        Since:

        8.1