public PersonListEditor() {

    // Create the UI
    initWidget(GWT.<Binder>create(Binder.class).createAndBindUi(this));

    // Create the driver which manages the data-bound widgets
    Driver driver = GWT.<Driver>create(Driver.class);

    // Use a ListEditor that uses our NameLabelSource
    ListEditor<PersonProxy, NameLabel> editor = ListEditor.of(new NameLabelSource());

    // Configure the driver
    ListEditor<PersonProxy, NameLabel> listEditor = editor;
    driver.initialize(listEditor);

    /*
     * Notice the backing list is essentially anonymous.
     */
    driver.display(new ArrayList<PersonProxy>());

    // Modifying this list triggers widget creation and destruction
    displayedList = listEditor.getList();

    editing = false;
  }
Ejemplo n.º 2
0
 public KeywordListEditor() {
   initWidget(GWT.<Binder>create(Binder.class).createAndBindUi(this));
   Driver driver = GWT.<Driver>create(Driver.class);
   ListEditor<KeywordProxy, NameLabel> editor = ListEditor.of(new NameLabelSource());
   ListEditor<KeywordProxy, NameLabel> listEditor = editor;
   driver.initialize(listEditor);
   driver.display(new ArrayList<KeywordProxy>());
   displayedList = listEditor.getList();
   editing = false;
 }