I'm not all that familiar with the editor framework but perhaps there's
a cleaner way to do this? (See comments.)


http://gwt-code-reviews.appspot.com/1587803/diff/1/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/1/user/src/com/google/gwt/editor/client/adapters/EditorSource.java#newcode42
user/src/com/google/gwt/editor/client/adapters/EditorSource.java:42:
public abstract E create(int index);
Instead of using -1 to indicate a synthetic editor, it seems cleaner to
add a new createEditorForTraversal() method. The default implementation
could just call create(0) for backward compatibility, but HasDataEditor
could implement it to either set a flag on IndexedEditor or alternately
use a different subclass altogether.

http://gwt-code-reviews.appspot.com/1587803/diff/1/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/1/user/src/com/google/gwt/editor/client/adapters/HasDataEditor.java#newcode56
user/src/com/google/gwt/editor/client/adapters/HasDataEditor.java:56:
((IndexedEditor<T>) editor).setIndex(index);
assert index >=0?

http://gwt-code-reviews.appspot.com/1587803/diff/1/user/src/com/google/gwt/editor/client/adapters/HasDataEditor.java#newcode60
user/src/com/google/gwt/editor/client/adapters/HasDataEditor.java:60:
static class IndexedEditor<Q> implements LeafValueEditor<Q> {
Perhaps IndexedEditor should be private? I see no usages other than in
this class.

http://gwt-code-reviews.appspot.com/1587803/

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

Reply via email to