Class AbstractCellTableBuilder<T>
java.lang.Object
com.google.gwt.user.cellview.client.AbstractCellTableBuilder<T>
- Type Parameters:
T- the row data type
- All Implemented Interfaces:
CellTableBuilder<T>
- Direct Known Subclasses:
DefaultCellTableBuilder
Builder used to construct a CellTable.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractCellTableBuilder(AbstractCellTable<T> cellTable) Construct a new table builder. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidHook for subclasses to add their own attributes to each row in the table.protected voidaddRowAttributes(TableRowBuilder row, T rowValue) Hook for subclasses to add their own attributes to each row in the table.final voidBuild zero or more table rows for the specified row value.protected abstract voidbuildRowImpl(T rowValue, int absRowIndex) Build zero or more table rows for the specified row value.final Cell.ContextcreateContext(int column) Create the context for a column based on the current table building state.final TableSectionBuilderfinish()Finish the building and get theTableSectionBuildercontaining the children.getColumn(Cell.Context context, T rowValue, Element elem) Return the column containing an element.final Collection<HasCell<T, ?>> Return all the columns that this table builder has renderred.final intGet the index of the row value from the associatedTableRowElement.final intGet the index of the subrow value from the associatedTableRowElement.final booleanReturn if an element contains a cell.final <C> voidrenderCell(ElementBuilderBase<?> builder, Cell.Context context, HasCell<T, C> column, T rowValue) Render the cell into anElementBuilderBase.final voidstart(boolean isRebuildingAllRows) Start building rows.final TableRowBuilderstartRow()Start a row and return theTableRowBuilderfor this row.final TableRowBuilderStart a row and return theTableRowBuilderfor this row.
-
Field Details
-
cellTable
-
-
Constructor Details
-
AbstractCellTableBuilder
Construct a new table builder.- Parameters:
cellTable- the table this builder will build rows for
-
-
Method Details
-
buildRow
Build zero or more table rows for the specified row value.- Specified by:
buildRowin interfaceCellTableBuilder<T>- Parameters:
rowValue- the value for the row to renderabsRowIndex- the absolute row index
-
createContext
Create the context for a column based on the current table building state.- Parameters:
column- the column id- Returns:
- the context that contains the column index, row/subrow indexes, and the row value key
-
finish
Finish the building and get theTableSectionBuildercontaining the children.- Specified by:
finishin interfaceCellTableBuilder<T>
-
getColumn
Return the column containing an element.- Specified by:
getColumnin interfaceCellTableBuilder<T>- Parameters:
context- the context for the elementrowValue- the value for the row corresponding to the elementelem- the element that the column contains- Returns:
- the immediate column containing the element
-
getColumns
Return all the columns that this table builder has renderred.- Specified by:
getColumnsin interfaceCellTableBuilder<T>
-
getRowValueIndex
Get the index of the row value from the associatedTableRowElement.- Specified by:
getRowValueIndexin interfaceCellTableBuilder<T>- Parameters:
row- the row element- Returns:
- the row value index
-
getSubrowValueIndex
Get the index of the subrow value from the associatedTableRowElement. The sub row value starts at 0 for the first row that represents a row value.- Specified by:
getSubrowValueIndexin interfaceCellTableBuilder<T>- Parameters:
row- the row element- Returns:
- the subrow value index, or 0 if not found
-
isColumn
Return if an element contains a cell. This may be faster to execute thangetColumn(Element).- Specified by:
isColumnin interfaceCellTableBuilder<T>- Parameters:
elem- the element of interest
-
start
public final void start(boolean isRebuildingAllRows) Start building rows. Reset the internal table section builder. If the table builder is going to re-build all rows, the internal the maps associating the cells and ids will be cleared.- Specified by:
startin interfaceCellTableBuilder<T>- Parameters:
isRebuildingAllRows- is this start intended for rebuilding all rows
-
startRow
Start a row and return theTableRowBuilderfor this row. -
startRow
Start a row and return theTableRowBuilderfor this row. The row can be initialized according to its corresponding value.- Parameters:
rowValue- the value for the row corresponding to the element. Can be null.
-
buildRowImpl
Build zero or more table rows for the specified row value.- Parameters:
rowValue- the value for the row to renderabsRowIndex- the absolute row index
-