http://gwt-code-reviews.appspot.com/1587803/diff/5002/user/src/com/google/gwt/editor/client/adapters/EditorSource.java File user/src/com/google/gwt/editor/client/adapters/EditorSource.java (right):
http://gwt-code-reviews.appspot.com/1587803/diff/5002/user/src/com/google/gwt/editor/client/adapters/EditorSource.java#newcode60 user/src/com/google/gwt/editor/client/adapters/EditorSource.java:60: * For backwards compatibility with GWT 2.5.0 and earlier, the default implemtation calls On 2013/01/15 02:55:22, skybrian wrote:
sp: implementation
Done. http://gwt-code-reviews.appspot.com/1587803/diff/5002/user/src/com/google/gwt/editor/client/adapters/HasDataEditor.java File user/src/com/google/gwt/editor/client/adapters/HasDataEditor.java (right): http://gwt-code-reviews.appspot.com/1587803/diff/5002/user/src/com/google/gwt/editor/client/adapters/HasDataEditor.java#newcode44 user/src/com/google/gwt/editor/client/adapters/HasDataEditor.java:44: return new IndexedEditor<T>(-1, null); On 2013/01/15 02:55:22, skybrian wrote:
If IndexedEditor's index is -1 then getValue() always returns null and setValue() probably throws an exception eventually in data.setRowData
(I didn't
trace it). It seems like it would be clearer to return an anonymous
subclass of
LeafValueEditor that implements getValue() and setValue() to do this
directly?
I'm assuming setValue() shouldn't be called at all, not sure about
getValue. I was assuming getValue/setValue wouldn't be called, but user code can actually call them (from the EditorVisitor passed to EditorContext#traverseSyntheticCompositeEditor). I can't see any use case for that, but still. So I fixed IndexedEditor to no longer throw if data is null.
Then dispose() can do an instanceof check and ignore this instance. Or
perhaps
keep it in a constant and use ==.
Actually, dispose() won't be called; that was a leftover from a previous iteration where I only moved the create(0) to createEditorForTraversal; I then moved both create(0) and dispose() so, in the case of HasDataEditor, dispose is no longer called for the synthetic editor. http://gwt-code-reviews.appspot.com/1587803/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors