public class FlyweightRow extends Object implements Row
Row interface.
There is only one instance per Escalator. This is designed to be re-used when rendering rows.
Escalator.AbstractRowContainer.refreshRow(TableRowElement,
int)| Constructor and Description |
|---|
FlyweightRow() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCells(int index,
int numberOfColumns)
Adds cell representations (i.e.
|
Iterable<FlyweightCell> |
getCells()
Returns flyweight cells for the client code to render.
|
Iterable<FlyweightCell> |
getCells(int offset,
int numberOfCells)
Returns a subrange of flyweight cells for the client code to render.
|
com.google.gwt.dom.client.TableRowElement |
getElement()
Gets the root element for this row.
|
int |
getRow()
Gets the row index.
|
Iterable<FlyweightCell> |
getUnattachedCells(int offset,
int numberOfCells)
Returns a subrange of unattached flyweight cells.
|
void |
removeCells(int index,
int numberOfColumns)
Removes cell representations (i.e.
|
void |
setup(com.google.gwt.dom.client.TableRowElement e,
int row,
double[] columnWidths)
Configure this FlyweightRow for the current use.
|
boolean |
teardown()
Tear down the state of the Row.
|
public void setup(com.google.gwt.dom.client.TableRowElement e,
int row,
double[] columnWidths)
e - the root element for this rowrow - the row indexcolumnWidths - widths for each column on the rowFlyweightRowpublic boolean teardown()
This is an internal check method, to prevent retrieving uninitialized
data by calling getRow(), getElement() or
getCells() at an improper time.
This should only be used with asserts ("
assert flyweightRow.teardown() ") so that the code is never
run when asserts aren't enabled.
truepublic int getRow()
Rowpublic com.google.gwt.dom.client.TableRowElement getElement()
Row
The EscalatorUpdater may update the class names of the element
and add inline styles, but may not modify the contained DOM structure.
If you wish to modify the cells within this row element, access them via
the List< objects passed in to
Cell>EscalatorUpdater.updateCells(Row, List)
getElement in interface Rowpublic void addCells(int index,
int numberOfColumns)
index - start index of the rangenumberOfColumns - length of the rangepublic void removeCells(int index,
int numberOfColumns)
index - start index of the rangenumberOfColumns - length of the rangepublic Iterable<FlyweightCell> getCells()
elements from the row
element.
Precondition: each cell has a corresponding element in the row
#setup(TableRowElement, int, int[]),
teardown()public Iterable<FlyweightCell> getCells(int offset, int numberOfCells)
elements
from the row element.
Precondition: each cell has a corresponding element in the row
offset - the index of the first cell to returnnumberOfCells - the number of cells to returnpublic Iterable<FlyweightCell> getUnattachedCells(int offset, int numberOfCells)
elements associated. Note that
FlyweightRow does not keep track of whether cells in actuality have
corresponding DOM elements or not; it is the caller's responsibility to
invoke this method with correct parameters.
Precondition: the range [offset, offset + numberOfCells) must be valid
offset - the index of the first cell to returnnumberOfCells - the number of cells to returnCopyright © 2021 Vaadin Ltd. All rights reserved.