if (list != null && list.isSameValue(value)) { list.refresh(); return; list.detach(); list = new ListEditorWrapper<T, E>(value, chain, editorSource); list.attach();
/** * Refresh the editors in case the backing list has been modified from * outside the ListEditorWrapper list. * <p> * This is basically the opposite from {@link #flush()}. It's used to * reuse sub-editors instead of recreating a ListEditorWrapper from * scratch. */ void refresh() { int i = 0; for (T item : backing) { if (i < size()) { this.set(i, item); } else { assert i == size(); this.add(i, item); } i++; } while (backing.size() < size()) { remove(size() - 1); } assert backing.size() == size(); assert backing.equals(workingCopy); } }
public void flush() { if (list != null) { list.flush(); } }
public String getPathElement(E subEditor) { return "[" + list.getEditors().indexOf(subEditor) + "]"; }
/** * Returns an unmodifiable, live view of the Editors managed by the * ListEditor. * <p> * The returned list will be live until the next call to {@link #setValue(List)} * and shouldn't be used after that. Editors might (or might not) be reused * after a call to {@link #setValue(List)}. * <p> * If there is no backing list, an empty list will be returned. * * @return a List of {@link Editor Editors} of type E */ public List<E> getEditors() { if (list == null) { return Collections.emptyList(); } return Collections.unmodifiableList(list.getEditors()); }
if (list != null && list.isSameValue(value)) { list.refresh(); return; list.detach(); list = new ListEditorWrapper<T, E>(value, chain, editorSource); list.attach();
/** * Refresh the editors in case the backing list has been modified from * outside the ListEditorWrapper list. * <p> * This is basically the opposite from {@link #flush()}. It's used to * reuse sub-editors instead of recreating a ListEditorWrapper from * scratch. */ void refresh() { int i = 0; for (T item : backing) { if (i < size()) { this.set(i, item); } else { assert i == size(); this.add(i, item); } i++; } while (backing.size() < size()) { remove(size() - 1); } assert backing.size() == size(); assert backing.equals(workingCopy); } }
public String getPathElement(E subEditor) { return "[" + list.getEditors().indexOf(subEditor) + "]"; }
public void flush() { if (list != null) { list.flush(); } }
if (list != null && list.isSameValue(value)) { list.refresh(); return; list.detach(); list = new ListEditorWrapper<T, E>(value, chain, editorSource); list.attach();
/** * Refresh the editors in case the backing list has been modified from * outside the ListEditorWrapper list. * <p> * This is basically the opposite from {@link #flush()}. It's used to * reuse sub-editors instead of recreating a ListEditorWrapper from * scratch. */ void refresh() { int i = 0; for (T item : backing) { if (i < size()) { this.set(i, item); } else { assert i == size(); this.add(i, item); } i++; } while (backing.size() < size()) { remove(size() - 1); } assert backing.size() == size(); assert backing.equals(workingCopy); } }
public String getPathElement(E subEditor) { return "[" + list.getEditors().indexOf(subEditor) + "]"; }
public void flush() { if (list != null) { list.flush(); } }
/** * Returns an unmodifiable, live view of the Editors managed by the * ListEditor. * <p> * The returned list will be live until the next call to {@link #setValue(List)} * and shouldn't be used after that. Editors might (or might not) be reused * after a call to {@link #setValue(List)}. * <p> * If there is no backing list, an empty list will be returned. * * @return a List of {@link Editor Editors} of type E */ public List<E> getEditors() { if (list == null) { return Collections.emptyList(); } return Collections.unmodifiableList(list.getEditors()); }
/** * Returns an unmodifiable, live view of the Editors managed by the * ListEditor. * <p> * The returned list will be live until the next call to {@link #setValue(List)} * and shouldn't be used after that. Editors might (or might not) be reused * after a call to {@link #setValue(List)}. * <p> * If there is no backing list, an empty list will be returned. * * @return a List of {@link Editor Editors} of type E */ public List<E> getEditors() { if (list == null) { return Collections.emptyList(); } return Collections.unmodifiableList(list.getEditors()); }