LGTM

On Thu, Sep 9, 2010 at 12:04 PM, <b...@google.com> wrote:

>
> http://gwt-code-reviews.appspot.com/848801/diff/1/5
> File user/src/com/google/gwt/editor/client/CompositeEditor.java (right):
>
> http://gwt-code-reviews.appspot.com/848801/diff/1/5#newcode20
> user/src/com/google/gwt/editor/client/CompositeEditor.java:20: * some
> other type.
>  * An interface that indicates that a given Editor is composed of an
> unknown
>  * number of sub-Editors all of the same type.
>  * <p>
>  * For example, the {...@link
>
> com.google.gwt.editor.client.adapters.ListEditor
>  * ListEditor} type is a
>  * <code>CompositeEditor&lt;List&lt;T>, T, E extends
> Editor&lt;T></code>; that
>  * is, ListEditor will accept a List&lt;T> and will edit some unknown
> number of
>  * <code>T</code>'s using the Editor type <code>E</code>. Another
> example might
>  * be:
>  *
>  * <pre>
>  * class WorkgroupEditor implements CompositeEditor&lt;Workgroup,
> Person, PersonSummaryEditor>{
>  *   public void setValue(Workgroup workgroup) {
>  *     // Assuming Workgroup implements Iterable&lt;Person>
>  *     for (Person p : workgroup) {
>  *       PersonSummaryEditor editor = new PersonSummaryEditor();
>  *       // Attach editor to DOM
>  *       somePanel.add(editor);
>  *       // Let the generated code drive the sub-editor
>  *       editorChain.attach(p, editor);
>  *     }
>  *   }
>  * }
>  * </pre>
>
>
> http://gwt-code-reviews.appspot.com/848801/diff/1/16
> File user/src/com/google/gwt/editor/client/adapters/ListEditor.java
> (right):
>
> http://gwt-code-reviews.appspot.com/848801/diff/1/16#newcode34
> user/src/com/google/gwt/editor/client/adapters/ListEditor.java:34:
> public class ListEditor<T, E extends Editor<T>> implements
> On 2010/09/09 18:24:01, rjrjr wrote:
>
>> You need E as input to the code generator, right?
>>
>
> Yes, the EditorDriver generator needs to make sure that there is an
> EditorDelegate peer for the editor type that will display the list
> elements.
>
>
> http://gwt-code-reviews.appspot.com/848801/diff/1/26
> File user/src/com/google/gwt/editor/client/testing/FakeEditorSource.java
> (right):
>
> http://gwt-code-reviews.appspot.com/848801/diff/1/26#newcode29
> user/src/com/google/gwt/editor/client/testing/FakeEditorSource.java:29:
> public class FakeEditorSource<T> extends
> EditorSource<FakeLeafValueEditor<T>> {
> On 2010/09/09 18:24:01, rjrjr wrote:
>
>> Should the fakes and mocks live in user/test? Or would that make them
>>
> not
>
>> available to third parties?
>>
>
> The contents of user/test aren't packed into gwt-user.jar.
>
>
> http://gwt-code-reviews.appspot.com/848801/diff/1/37
> File user/test/com/google/gwt/editor/client/SimpleBeanEditorTest.java
> (right):
>
> http://gwt-code-reviews.appspot.com/848801/diff/1/37#newcode299
> user/test/com/google/gwt/editor/client/SimpleBeanEditorTest.java:299:
> class StringSource extends EditorSource<SimpleEditor<String>> {
> On 2010/09/09 18:24:01, rjrjr wrote:
>
>> Will I always have to create a source to use a ListEditor? Could it be
>> generated?
>>
>
> I have this rough idea that you could write something like this in
> UiBinder:
>
>
> <e:ListEditor path='person.aliases'>
>  <e:container>
>    <g:FlowPanel />
>  </e:container>
>  <e:subeditor>
>    <g:FlowPanel>
>      <g:TextBox e:path='name'>John Doe</g:TextBox>
>      <g:TextBox e:path='locale'>East Nowhere</g:TextBox>
>      <g:DateBox e:path='last_seen'>9/9/2010</g:DateBox>
>    </g:FlowPanel>
>  <e:subeditor>
> </e:ListEditor>
>
> UiBinder would generate an EditorChain that automatically creates
> instances of the widget described by the subeditor clause and manages
> their attachment to an InsertPanel described in the container clause.
>
>
> http://gwt-code-reviews.appspot.com/848801/show
>

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

Reply via email to