Reverting behavior in AbstractCellTable so it calls Column#onBrowserEvent() if the target Cell is in a Column. AbstractCellTable now supports any HasCell implementation, not just Columns, and a recent change modified the behavior to fire the event to the Cell directly, instead of going through Column#onBrowserEvent(). However, overriding onBrowserEvent() is common, and this behavior was a breaking change. The fix checks if the HasCell is a column and uses the legacy Column#onBrowserEvent() method. Review at http://gwt-code-reviews.appspot.com/1500805 Review by: tlaubach@google.com git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@10477 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/user/cellview/client/AbstractCellTable.java b/user/src/com/google/gwt/user/cellview/client/AbstractCellTable.java index c8b3331..7227a5d 100644 --- a/user/src/com/google/gwt/user/cellview/client/AbstractCellTable.java +++ b/user/src/com/google/gwt/user/cellview/client/AbstractCellTable.java
@@ -2370,20 +2370,29 @@ return; } - // Create a FieldUpdater. - final FieldUpdater<T, C> fieldUpdater = column.getFieldUpdater(); - final int index = context.getIndex(); - ValueUpdater<C> valueUpdater = (fieldUpdater == null) ? null : new ValueUpdater<C>() { - @Override - public void update(C value) { - fieldUpdater.update(index, rowValue, value); - } - }; - - // Fire the event to the cell. C cellValue = column.getValue(rowValue); boolean cellWasEditing = cell.isEditing(context, parentElem, cellValue); - cell.onBrowserEvent(context, parentElem, column.getValue(rowValue), event, valueUpdater); + if (column instanceof Column) { + /* + * If the HasCell is a Column, let it handle the event itself. This is + * here for legacy support. + */ + Column<T, C> col = (Column<T, C>) column; + col.onBrowserEvent(context, parentElem, rowValue, event); + } else { + // Create a FieldUpdater. + final FieldUpdater<T, C> fieldUpdater = column.getFieldUpdater(); + final int index = context.getIndex(); + ValueUpdater<C> valueUpdater = (fieldUpdater == null) ? null : new ValueUpdater<C>() { + @Override + public void update(C value) { + fieldUpdater.update(index, rowValue, value); + } + }; + + // Fire the event to the cell. + cell.onBrowserEvent(context, parentElem, column.getValue(rowValue), event, valueUpdater); + } // Reset focus if needed. cellIsEditing = cell.isEditing(context, parentElem, cellValue);