Reviewers: rjrjr, unnur_google.com,

Description:
Adding a new CellTableHeaderBuilder API, which allows custom headers and
footers in CellTable. CellTableHeaderBuilder has one method
#buildHeader(Utility) which lets the user build the entire header (or
footer) table.  The Utility is used to add a row to the header table,
render a Header instance into the header table, or associate a column
with an element.  Headers (which are basically a Cell with a static
value) now use the same method as Cells to fire events.  We walk up the
DOM until we find an attribute added by Utility.renderHeader(), then
lookup the header based on the attribute.  You can add multiple headers
per DOM table cell.

Utility#associateColumn(ElementBuilderBase, Column) associates the
specified column with the Element created by the specified builder.
This allows you to specify which columns are sortable, and which Column
to pass to the ColumnSortList when sorting occurs.  With this change,
Columns are entirely superficial if you specify a CellTableBuilder and a
CellTableHeaderBuilder. The default implementation render based on the
Columns, but if you provide your own builders, you do not need to
specify any Columns in CellTable.  This is very useful if you want to
break the grid pattern in favor of something more complicated.

The DefaultHeaderBuilder defined in AbstractCellTable creates one header
per Column, exactly as you would expect. It also supports the method
#setSortIconStartOfLine(boolean), which allows you to specify whether
the sort icon appears on the right or left side (in RTL safe verbiage).
This was a widely requested feature, and something that is easy to do
with a HeaderBuilder.

The example in Showcase shows a multi row header with a combination of
sortable columns and non-sortable columns. It also takes advantage of
the fact the columns are optional to show how users might maintain
columns manually.
http://showcase3.jlabanca-testing.appspot.com/#!CwCustomDataGrid


Please review this at http://gwt-code-reviews.appspot.com/1499808/

Affected files:
M samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCustomDataGrid.css M samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCustomDataGrid.java
  M user/src/com/google/gwt/dom/builder/client/DomStylesBuilder.java
  M user/src/com/google/gwt/dom/builder/shared/HtmlStylesBuilder.java
  M user/src/com/google/gwt/dom/builder/shared/StylesBuilder.java
  M user/src/com/google/gwt/dom/client/Style.java
  M user/src/com/google/gwt/safecss/shared/SafeStylesUtils.java
  M user/src/com/google/gwt/user/cellview/client/AbstractCellTable.java
  M user/src/com/google/gwt/user/cellview/client/CellTable.java
  A user/src/com/google/gwt/user/cellview/client/CellTableHeaderBuilder.java
  M user/src/com/google/gwt/user/cellview/client/DataGrid.java
M user/test/com/google/gwt/user/cellview/client/AbstractCellTableTestBase.java
  M user/test/com/google/gwt/user/cellview/client/CellTableTest.java
  M user/test/com/google/gwt/user/cellview/client/DataGridTest.java


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to