gwt /
gwt /
6bef5d4e6db1e71a18fafcd5723af4285163f8e7 Revise CellTableBuilder API. In the earlier version, a Utility class is used to
render the rows/cells. The utility performs various checks to ensure the proper
DOM structure. It also appends a cell id to each TD element so that it can
retrieve the Column quickly during event handling. These introduce additional
rendering latency and could become problematic for tables of extremely large
size and/or in slow browsers. This change removes the Utility class and replace
it with AbstractCellTableBuilder. This makes the CellTableBuilder API more
flexible. Users can choose to implement a CellTableBuilder without the above
mentioned overheads, or subclass AbstractCellTableBuilder, in a way almost
identical to the earlier table builder version.
A method getColumn(Context context, T rowValue, Element elem) is added to the
CellTableBuilder interface. User can implement this method to tell the CellTable
which column contains a particular element (e.g., the event target element). If
all columns are renderer, users may simply return
CellTable.getColumn(context.col). Or, users can "replay" the row building logic
to locate the column for the element. Of course the cell id based approach is
still supported and is now in AbstractCellTableBuilder. Two similar methods
isColumn and getColumns are also added. Please see javadoc for more details.
The buildRows method is refactored to remove the utility. Users can choose to
still use an element builder based approach (see AbstractCellTableBuilder), in
which each time a cell is rendered, checks are performed to ensure the proper
DOM structure. Or, users can choose to use a simple string builder based
approach and create a TableSectionBuilder in the new "finish()" method (e.g.,
using the new FastHtmlTableSectionBuilder in this change). This
will be much faster, won't be able to detect a malformed html.
Review at http://gwt-code-reviews.appspot.com/1527803
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@10550 8db76d5a-ed1c-0410-87a9-c151d255dfc7
6 files changed