title: How to edit a multi-value field with GWT Editor framework?
body: <p>I am trying to figure out how to use GWT Editor when my model has a field that is a Set, List, etc. </p>
  
  <p>I have this entity proxy:</p>
  
  <pre><code>public interface MyModel {
    void setSomeCollection(Set&lt;String&gt; c);
    Set&lt;String&gt; getSomeCollection();
  }
  </code></pre>
  
  <p>Here is my multiselect field. I am extending ListBox so that I can change some of its behavior later.</p>
  
  <pre><code>public class DualListBox extends ListBox implements LeafValueEditor&lt;Set&lt;String&gt;&gt; {
  
      public DualListBox() {
          super(true);
      }
  
      @Override
      public void setValue(Set&lt;String&gt; values) {
          if (values == null) {
              return;
          }
  
          for (String value : values) {
              for (int i = 0; i &lt; getItemCount(); i++) {
                  if (getValue(i).equals(value)) {
                      setItemSelected(i, true);
                  } else {
                      setItemSelected(i, false);
                  }
              }
          }
      }
  
      @Override
      public Set&lt;String&gt; getValue() {
          Set&lt;String&gt; values = new HashSet&lt;String&gt;();
          for (int i = 0; i &lt; getItemCount(); i++) {
              if (isItemSelected(i)) {
                  values.add(getValue(i));
              }
          }
  
          // Debug shows that the set of values is populated correctly..
          return values;
      }
  }
  </code></pre>
  
  <p>Basically I just cant figure out how to get fields with a Set (I have tried List as well) to work with GWTs Editor framework. Debugging so far shows that the values are coming out of the editor correctly.</p>
  
  <p>I have looked at ListEditor but that looks like its used to edit a list of more complex that object types; not a single field with multiple possible values. I am implementing the wrong editor type? Is GWT Editor not able to handle fields that are collections yet?</p>