com.vaadin.client.widget.escalator
Interface RowContainer

All Known Subinterfaces:
RowContainer.BodyRowContainer
All Known Implementing Classes:
Escalator.AbstractRowContainer

public interface RowContainer

A representation of the rows in each of the sections (header, body and footer) in an Escalator.

Since:
7.4
Author:
Vaadin Ltd
See Also:
Escalator.getHeader(), Escalator.getBody(), Escalator.getFooter(), SpacerContainer

Nested Class Summary
static interface RowContainer.BodyRowContainer
          The row container for the body section in an Escalator.
 
Field Summary
static double INITIAL_DEFAULT_ROW_HEIGHT
          An arbitrary pixel height of a row, before any autodetection for the row height has been made.
 
Method Summary
 Cell getCell(Element element)
          Returns the cell object which contains information about the cell the element is in.
 double getDefaultRowHeight()
          Returns the default height of the rows in this RowContainer.
 TableSectionElement getElement()
          Returns the root element of RowContainer
 EscalatorUpdater getEscalatorUpdater()
          Returns the current EscalatorUpdater used to render cells.
 int getRowCount()
          Gets the number of rows in the current row container.
 TableRowElement getRowElement(int index)
          Gets the row element with given logical index.
 void insertRows(int index, int numberOfRows)
          Adds rows at a certain index in this row container.
 void refreshRows(int index, int numberOfRows)
          Refreshes a range of rows in the current row container.
 void removeRows(int index, int numberOfRows)
          Removes rows at a certain index in the current row container.
 void setDefaultRowHeight(double px)
          The default height of the rows in this RowContainer.
 void setEscalatorUpdater(EscalatorUpdater escalatorUpdater)
          Sets the EscalatorUpdater to use when displaying data in the escalator.
 

Field Detail

INITIAL_DEFAULT_ROW_HEIGHT

static final double INITIAL_DEFAULT_ROW_HEIGHT
An arbitrary pixel height of a row, before any autodetection for the row height has been made.

See Also:
Constant Field Values
Method Detail

getEscalatorUpdater

EscalatorUpdater getEscalatorUpdater()
Returns the current EscalatorUpdater used to render cells.

Returns:
the current escalator updater

setEscalatorUpdater

void setEscalatorUpdater(EscalatorUpdater escalatorUpdater)
                         throws java.lang.IllegalArgumentException
Sets the EscalatorUpdater to use when displaying data in the escalator.

Parameters:
escalatorUpdater - the escalator updater to use to render cells. May not be null
Throws:
java.lang.IllegalArgumentException - if cellRenderer is null
See Also:
EscalatorUpdater.NULL

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.

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.

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, refreshRows(int, int) needs to be called for those rows separately.

Parameters:
index - the index of the row before which new rows are inserted, or 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..getRowCount()]
java.lang.IllegalArgumentException - if numberOfRows is less than 1.
See Also:
setEscalatorUpdater(EscalatorUpdater)

refreshRows

void refreshRows(int index,
                 int numberOfRows)
                 throws java.lang.IndexOutOfBoundsException,
                        java.lang.IllegalArgumentException
Refreshes a range of rows in the current row container.

The data for the refreshed rows is queried from the current cell renderer.

Parameters:
index - the index of the first row that will be updated
numberOfRows - the number of rows to update, starting from the index
Throws:
java.lang.IndexOutOfBoundsException - if any integer number in the range [index..(index+numberOfColumns)] is not an existing column index.
java.lang.IllegalArgumentException - if numberOfRows is less than 1.
See Also:
setEscalatorUpdater(EscalatorUpdater)

getRowCount

int getRowCount()
Gets the number of rows in the current row container.

Returns:
the number of rows in the current row container

setDefaultRowHeight

void setDefaultRowHeight(double px)
                         throws java.lang.IllegalArgumentException
The default height of the rows in this RowContainer.

Parameters:
px - the default height in pixels of the rows in this RowContainer
Throws:
java.lang.IllegalArgumentException - if px < 1
See Also:
getDefaultRowHeight()

getDefaultRowHeight

double getDefaultRowHeight()
Returns the default height of the rows in this RowContainer.

This value will be equal to INITIAL_DEFAULT_ROW_HEIGHT if the Escalator has not yet had a chance to autodetect the row height, or no explicit value has yet given via #setDefaultRowHeight(int)

Returns:
the default height of the rows in this RowContainer, in pixels
See Also:
#setDefaultRowHeight(int)

getCell

Cell getCell(Element element)
Returns the cell object which contains information about the cell the element is in.

Parameters:
element - The element to get the cell for. If element is not present in row container then null is returned.
Returns:
the cell of the element, or null if element is not present in the RowContainer.BodyRowContainer.

getRowElement

TableRowElement getRowElement(int index)
                              throws java.lang.IndexOutOfBoundsException,
                                     java.lang.IllegalStateException
Gets the row element with given logical index. For lazy loaded containers such as Escalators BodyRowContainer visibility should be checked before calling this function. See Escalator#getVisibleRowRange().

Parameters:
index - the logical index of the element to retrieve
Returns:
the element at position index
Throws:
java.lang.IndexOutOfBoundsException - if index is not valid within container
java.lang.IllegalStateException - if index is currently not available in the DOM

getElement

TableSectionElement getElement()
Returns the root element of RowContainer

Returns:
RowContainer root element


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