com.vaadin.client.widget.escalator.
Interface RowContainer
-
All Known Subinterfaces:
All Known Implementing Classes:
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
Nested Classes Modifier and Type Interface Description static interface
RowContainer.BodyRowContainer
The row container for the body section in an
Escalator
.
-
Field Summary
Fields Modifier and Type Field Description 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
All Methods Modifier and Type Method Description Cell
getCell(com.google.gwt.dom.client.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.
com.google.gwt.dom.client.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.
com.google.gwt.dom.client.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.
-
-
-
Method Detail
-
getEscalatorUpdater
EscalatorUpdater getEscalatorUpdater()
Returns the current
EscalatorUpdater
used to render cells.Returns:
the current escalator updater
-
setEscalatorUpdater
void setEscalatorUpdater(EscalatorUpdater escalatorUpdater) throws IllegalArgumentException
Sets the
EscalatorUpdater
to use when displaying data in the escalator.Parameters:
escalatorUpdater
- the escalator updater to use to render cells. May not benull
Throws:
IllegalArgumentException
- ifcellRenderer
isnull
See Also:
-
removeRows
void removeRows(int index, int numberOfRows) throws IndexOutOfBoundsException, IllegalArgumentException
Removes rows at a certain index in the current row container.
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.
-
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,
refreshRows(int, int)
needs to be called for those rows separately.Parameters:
index
- the index of the row before which new rows are inserted, orgetRowCount()
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..
getRowCount()
]IllegalArgumentException
- ifnumberOfRows
is less than 1.See Also:
-
refreshRows
void refreshRows(int index, int numberOfRows) throws IndexOutOfBoundsException, 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 updatednumberOfRows
- the number of rows to update, starting from the indexThrows:
IndexOutOfBoundsException
- if any integer number in the range[index..(index+numberOfColumns)]
is not an existing column index.IllegalArgumentException
- ifnumberOfRows
is less than 1.See Also:
-
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 IllegalArgumentException
The default height of the rows in this RowContainer.
Parameters:
px
- the default height in pixels of the rows in this RowContainerThrows:
IllegalArgumentException
- ifpx < 1
See Also:
-
getDefaultRowHeight
double getDefaultRowHeight()
Returns the default height of the rows in this RowContainer.
This value will be equal to
INITIAL_DEFAULT_ROW_HEIGHT
if theEscalator
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(com.google.gwt.dom.client.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 thennull
is returned.Returns:
the cell of the element, or
null
if element is not present in theRowContainer
.
-
getRowElement
com.google.gwt.dom.client.TableRowElement getRowElement(int index) throws IndexOutOfBoundsException, 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 retrieveReturns:
the element at position
index
Throws:
IndexOutOfBoundsException
- ifindex
is not valid within containerIllegalStateException
- ifindex
is currently not available in the DOM
-
getElement
com.google.gwt.dom.client.TableSectionElement getElement()
Returns the root element of RowContainer
Returns:
RowContainer root element
-
-