Reviewers: Ray Ryan,
Description:
Adding support for non-propagating events in Cell based widgets. In
modern browsers, we make the widget's outer element the capture element,
which allows us to catch and dispatch non-bubbling events from the
cells.
In IE, we use onfocusin/onfocusout (which bubble) to catch focus/blur
events, then fire synthetic events on the Cell. We use
focus/blur/keyup/mouseup/mousewheel events to fire synthetic change
events on the Cell. In all of these cases, we temporarily set the widget
as the Cells event listener, so the event can pass through the normal
GWT event system. Load/Error events are more complicated because IE
doesn't provide anything that helps catch these non-bubbling events.
This patch modifies the html generated by Cells, adding onload/onerror
listeners directly into the html. While a little hacky, this approach
allows Cells to receive load/error events without having to do anything
special. The handlers call a method hanging off of $wnd, which in turn
calls back into GWT code.
This patch introduces a few new image based cells. ImageCell and
ImageResourceCell display images. ImageLoadingCell displays a loading
icon until an image finishes loading, which is useful for larger images.
I also fixed a bug in IE that prevents tables from rendering at all.
Please review this at http://gwt-code-reviews.appspot.com/720801/show
Affected files:
M
samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/ContactTreeViewModel.java
M
samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellSampler.java
M user/src/com/google/gwt/cell/client/EditTextCell.java
A user/src/com/google/gwt/cell/client/ImageCell.java
A user/src/com/google/gwt/cell/client/ImageLoadingCell.java
A user/src/com/google/gwt/cell/client/ImageResourceCell.java
M user/src/com/google/gwt/cell/client/SelectionCell.java
M user/src/com/google/gwt/user/cellview/CellView.gwt.xml
A user/src/com/google/gwt/user/cellview/client/CellImpl.java
A user/src/com/google/gwt/user/cellview/client/CellImplStandard.java
A user/src/com/google/gwt/user/cellview/client/CellImplTrident.java
M user/src/com/google/gwt/user/cellview/client/CellList.java
M user/src/com/google/gwt/user/cellview/client/CellTable.java
M user/src/com/google/gwt/user/cellview/client/CellTree.java
M user/src/com/google/gwt/user/cellview/client/CellTreeNodeView.java
M
user/src/com/google/gwt/user/cellview/client/PagingListViewPresenter.java
M user/test/com/google/gwt/cell/CellSuite.java
M user/test/com/google/gwt/cell/client/EditTextCellTest.java
A user/test/com/google/gwt/cell/client/ImageCellTest.java
A user/test/com/google/gwt/cell/client/ImageLoadingCellTest.java
A user/test/com/google/gwt/cell/client/ImageResourceCellTest.java
M user/test/com/google/gwt/cell/client/SelectionCellTest.java
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors