Reviewers: sbrubaker,

Description:
Adding a new SimpleCheckboxCell and LabeledCheckboxCell cells, and a
Checkbox widget backed by the LabledCheckboxCell.  The Cell supports
different images for checked and unchecked states, as as well as a text
label.  It renders a hidden input element so the cell/widget can be used
in a form, and it supports access keys.  I created some common
interfaces that Widgets and Cells can share.  The actual images are
temporary until josh returns.

In addition, this change cleans up some shared code.  TextButton now
uses IconCellDecorator's icon decoration implementation instead of
copying it, which should save on complexity and code size. I added a
static convenience method to AbstractImagePrototype to go from
ImageResource to SafeHtml, something that we use very often in Cells.
Also, I added TextButton#setIcon(), which was missing from the API.

Currently, Cell-backed Widgets redraw themselves every time a change is
made. This leads to degenerate performance where you create the widget,
then call 4 setters, and the widget is rendered 5 times! I'm going to
propose a solution where we defer rendering and add a flush() command to
CellWidget, but that will require a design doc and a separate CL.


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

Affected files:
M samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellSampler.java
  M user/src/com/google/gwt/cell/Cell.gwt.xml
  A user/src/com/google/gwt/cell/LabeledCheckboxCell.gwt.xml
  A user/src/com/google/gwt/cell/SimpleCheckboxCell.gwt.xml
  M user/src/com/google/gwt/cell/client/ButtonCellBase.java
  M user/src/com/google/gwt/cell/client/CheckboxCell.java
  A user/src/com/google/gwt/cell/client/CheckboxCellBase.css
  A user/src/com/google/gwt/cell/client/CheckboxCellBase.java
  M user/src/com/google/gwt/cell/client/IconCellDecorator.java
  A user/src/com/google/gwt/cell/client/IdentityValueGetter.java
  M user/src/com/google/gwt/cell/client/ImageLoadingCell.java
  M user/src/com/google/gwt/cell/client/ImageResourceCell.java
  A user/src/com/google/gwt/cell/client/LabeledCheckboxCell.java
  A user/src/com/google/gwt/cell/client/SimpleCheckboxCell.java
  A user/src/com/google/gwt/cell/client/ValueGetter.java
  M user/src/com/google/gwt/user/cellview/client/CellWidget.java
  M user/src/com/google/gwt/user/client/ui/AbstractImagePrototype.java
  M user/src/com/google/gwt/user/client/ui/Focusable.java
  A user/src/com/google/gwt/user/client/ui/HasAccessKey.java
  A user/src/com/google/gwt/user/client/ui/HasTabIndex.java
  M user/src/com/google/gwt/widget/client/ButtonBase.java
  A user/src/com/google/gwt/widget/client/Checkbox.java
  M user/src/com/google/gwt/widget/client/TextButton.java
  M user/test/com/google/gwt/cell/CellSuite.java
  M user/test/com/google/gwt/cell/client/ButtonCellTestBase.java
  A user/test/com/google/gwt/cell/client/CheckboxCellTestBase.java
  M user/test/com/google/gwt/cell/client/IconCellDecoratorTest.java
  A user/test/com/google/gwt/cell/client/LabeledCheckboxCellTest.java
  A user/test/com/google/gwt/cell/client/SimpleCheckboxCellTest.java
  M user/test/com/google/gwt/widget/WidgetSuite.java
  A user/test/com/google/gwt/widget/client/CheckboxTest.java


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

Reply via email to