GWT 2.7.0

com.google.gwt.user.cellview.client
Class AbstractCellTableBuilder<T>

java.lang.Object
  extended by com.google.gwt.user.cellview.client.AbstractCellTableBuilder<T>
Type Parameters:
T - the row data type
All Implemented Interfaces:
CellTableBuilder<T>
Direct Known Subclasses:
DefaultCellTableBuilder

public abstract class AbstractCellTableBuilder<T>
extends java.lang.Object
implements CellTableBuilder<T>

Builder used to construct a CellTable.


Field Summary
protected  AbstractCellTable<T> cellTable
           
 
Constructor Summary
AbstractCellTableBuilder(AbstractCellTable<T> cellTable)
          Construct a new table builder.
 
Method Summary
protected  void addRowAttributes(TableRowBuilder row)
          Hook for subclasses to add their own attributes to each row in the table.
 void buildRow(T rowValue, int absRowIndex)
          Build zero or more table rows for the specified row value.
protected abstract  void buildRowImpl(T rowValue, int absRowIndex)
          Build zero or more table rows for the specified row value.
 Cell.Context createContext(int column)
          Create the context for a column based on the current table building state.
 TableSectionBuilder finish()
          Finish the building and get the TableSectionBuilder containing the children.
 HasCell<T,?> getColumn(Cell.Context context, T rowValue, Element elem)
          Return the column containing an element.
 java.util.Collection<HasCell<T,?>> getColumns()
          Return all the columns that this table builder has renderred.
 int getRowValueIndex(TableRowElement row)
          Get the index of the row value from the associated TableRowElement.
 int getSubrowValueIndex(TableRowElement row)
          Get the index of the subrow value from the associated TableRowElement.
 boolean isColumn(Element elem)
          Return if an element contains a cell.
<C> void
renderCell(ElementBuilderBase<?> builder, Cell.Context context, HasCell<T,C> column, T rowValue)
          Render the cell into an ElementBuilderBase.
 void start(boolean isRebuildingAllRows)
          Start building rows.
 TableRowBuilder startRow()
          Start a row and return the TableRowBuilder for this row.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cellTable

protected final AbstractCellTable<T> cellTable
Constructor Detail

AbstractCellTableBuilder

public AbstractCellTableBuilder(AbstractCellTable<T> cellTable)
Construct a new table builder.

Parameters:
cellTable - the table this builder will build rows for
Method Detail

buildRow

public final void buildRow(T rowValue,
                           int absRowIndex)
Build zero or more table rows for the specified row value.

Specified by:
buildRow in interface CellTableBuilder<T>
Parameters:
rowValue - the value for the row to render
absRowIndex - the absolute row index

createContext

public final Cell.Context createContext(int column)
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

public final TableSectionBuilder finish()
Finish the building and get the TableSectionBuilder containing the children.

Specified by:
finish in interface CellTableBuilder<T>

getColumn

public final HasCell<T,?> getColumn(Cell.Context context,
                                    T rowValue,
                                    Element elem)
Return the column containing an element.

Specified by:
getColumn in interface CellTableBuilder<T>
Parameters:
context - the context for the element
rowValue - the value for the row corresponding to the element
elem - the element that the column contains
Returns:
the immediate column containing the element

getColumns

public final java.util.Collection<HasCell<T,?>> getColumns()
Return all the columns that this table builder has renderred.

Specified by:
getColumns in interface CellTableBuilder<T>

getRowValueIndex

public final int getRowValueIndex(TableRowElement row)
Get the index of the row value from the associated TableRowElement.

Specified by:
getRowValueIndex in interface CellTableBuilder<T>
Parameters:
row - the row element
Returns:
the row value index

getSubrowValueIndex

public final int getSubrowValueIndex(TableRowElement row)
Get the index of the subrow value from the associated TableRowElement. The sub row value starts at 0 for the first row that represents a row value.

Specified by:
getSubrowValueIndex in interface CellTableBuilder<T>
Parameters:
row - the row element
Returns:
the subrow value index, or 0 if not found

isColumn

public final boolean isColumn(Element elem)
Return if an element contains a cell. This may be faster to execute than getColumn.

Specified by:
isColumn in interface CellTableBuilder<T>
Parameters:
elem - the element of interest

renderCell

public final <C> void renderCell(ElementBuilderBase<?> builder,
                                 Cell.Context context,
                                 HasCell<T,C> column,
                                 T rowValue)
Render the cell into an ElementBuilderBase.

Parameters:
builder - the ElementBuilderBase that cell contents append to
context - the context for the element
column - the column containing the cell
rowValue - the value for the row corresponding to the element

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:
start in interface CellTableBuilder<T>
Parameters:
isRebuildingAllRows - is this start intended for rebuilding all rows

startRow

public final TableRowBuilder startRow()
Start a row and return the TableRowBuilder for this row.


addRowAttributes

protected void addRowAttributes(TableRowBuilder row)
Hook for subclasses to add their own attributes to each row in the table. The default does nothing.

Parameters:
row - the row element

buildRowImpl

protected abstract void buildRowImpl(T rowValue,
                                     int absRowIndex)
Build zero or more table rows for the specified row value.

Parameters:
rowValue - the value for the row to render
absRowIndex - the absolute row index

GWT 2.7.0