com.vaadin.client.widget.escalator
Interface RowContainer.BodyRowContainer

All Superinterfaces:
RowContainer
Enclosing interface:
RowContainer

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:
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
 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 setSpacer(int rowIndex, double height)
          Marks a spacer and its height.
 void setSpacerUpdater(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 java.lang.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:
java.lang.IllegalArgumentException - if rowIndex is not a valid row index
See Also:
insertRows(int, int), removeRows(int, int)

setSpacerUpdater

void setSpacerUpdater(SpacerUpdater spacerUpdater)
                      throws java.lang.IllegalArgumentException
Sets a new spacer updater.

Spacers that are currently visible will be updated, i.e. destroyed with the previous one, and initialized with the new one.

Parameters:
spacerUpdater - the new spacer updater
Throws:
java.lang.IllegalArgumentException - if spacerUpdater is null

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 java.lang.IndexOutOfBoundsException,
                       java.lang.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:
java.lang.IndexOutOfBoundsException - if index is not an integer in the range [0..RowContainer.getRowCount()]
java.lang.IllegalArgumentException - if numberOfRows is less than 1.
See Also:
RowContainer.setEscalatorUpdater(EscalatorUpdater)

removeRows

void removeRows(int index,
                int numberOfRows)
                throws java.lang.IndexOutOfBoundsException,
                       java.lang.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:
java.lang.IndexOutOfBoundsException - if any integer number in the range [index..(index+numberOfRows)] is not an existing row index
java.lang.IllegalArgumentException - if numberOfRows is less than 1.


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.