Esempio n. 1
0
  /**
   * Sets the ListEditor's backing data.
   *
   * <p>If a null is passed in, the ListEditor will have no backing list and edits cannot be made.
   *
   * @param value a List of data objects of type T
   */
  public void setValue(List<T> value) {
    if (list == null && value == null) {
      // fast exit
      return;
    }
    if (list != null && list.isSameValue(value)) {
      // setting the same value as the one being edited
      list.refresh();
      return;
    }

    if (list != null) {
      // Having entire value reset, so dump the wrapper gracefully
      list.detach();
    }
    if (value == null) {
      list = null;
    } else {
      list = new ListEditorWrapper<T, E>(value, chain, editorSource);
      list.attach();
    }
  }