Permalink
Browse files

Reverting behavior in DefaultCellTableBuilder so it renders Cells usi…

…ng Column#render(), if available. CellTableBuilder uses the HasCell interface to define the Cells used in the table. If the HasCell is an instance of Column, we should defer to Column#render() for legacy support instead of calling HasCell#getCell()#render(). Some users override Column#render() to add custom html to the rendered cell.

Review at http://gwt-code-reviews.appspot.com/1513805

Review by: katerina@google.com

git-svn-id: http://google-web-toolkit.googlecode.com/svn/trunk@10513 8db76d5a-ed1c-0410-87a9-c151d255dfc7
  • Loading branch information...
1 parent 4cc6340 commit f91de3bb5e14d1a8c272752974167c4d50ef5161 jlabanca@google.com committed Aug 9, 2011
Showing with 10 additions and 1 deletion.
  1. +10 −1 user/src/com/google/gwt/user/cellview/client/AbstractCellTable.java
@@ -855,7 +855,16 @@ public Context createContext(int column) {
// Render the cell into the builder.
SafeHtmlBuilder cellBuilder = new SafeHtmlBuilder();
- column.getCell().render(context, column.getValue(rowValue), cellBuilder);
+ if (column instanceof Column) {
+ /*
+ * If the HasCell is a Column, let it render the Cell itself. This is
+ * here for legacy support.
+ */
+ Column<T, C> theColumn = (Column<T, C>) column;
+ theColumn.render(context, rowValue, cellBuilder);
+ } else {
+ column.getCell().render(context, column.getValue(rowValue), cellBuilder);
+ }
builder.html(cellBuilder.toSafeHtml());
}

0 comments on commit f91de3b

Please sign in to comment.