T - The type of data being managedE - The type of Editorpublic class ListValidationEditor<T,E extends com.google.gwt.editor.client.Editor<? super T>> extends Object implements com.google.gwt.editor.client.CompositeEditor<List<T>,T,E>, HasParentDriverSetter
The ListEditor will have no backing list until setValue(List) is called with a non-null
value.
| Modifier | Constructor and Description |
|---|---|
protected |
ListValidationEditor(com.google.gwt.editor.client.adapters.EditorSource<E> source)
Create a ListEditor backed by an EditorSource.
|
| Modifier and Type | Method and Description |
|---|---|
E |
createEditorForTraversal()
Creates a temporary sub-Editor to use for traversal.
|
void |
flush() |
List<E> |
getEditors()
Returns an unmodifiable, live view of the Editors managed by the ListEditor.
|
List<T> |
getList()
Returns a live view of the ListEditor's backing data.
|
String |
getPathElement(E subEditor) |
static <T,E extends com.google.gwt.editor.client.Editor<? super T>> |
of(com.google.gwt.editor.client.adapters.EditorSource<E> source)
Create a ListEditor backed by an EditorSource.
|
void |
onPropertyChange(String... paths) |
void |
setDelegate(com.google.gwt.editor.client.EditorDelegate<List<T>> delegate) |
void |
setEditorChain(com.google.gwt.editor.client.CompositeEditor.EditorChain<T,E> chain) |
void |
setParentDriver(BeanValidationEditorDriver<?,?> pparentDriver) |
void |
setValue(List<T> value)
Sets the ListEditor's backing data.
|
protected ListValidationEditor(com.google.gwt.editor.client.adapters.EditorSource<E> source)
source - the EditorSource which will create sub-Editorspublic static <T,E extends com.google.gwt.editor.client.Editor<? super T>> ListValidationEditor<T,E> of(com.google.gwt.editor.client.adapters.EditorSource<E> source)
T - The type of data being managedE - The type of Editorsource - the EditorSource which will create sub-Editorspublic final void setParentDriver(BeanValidationEditorDriver<?,?> pparentDriver)
setParentDriver in interface HasParentDriverSetterpublic E createEditorForTraversal()
public void flush()
public List<E> getEditors()
The returned list will be live until the next call to setValue(List) and shouldn't be
used after that. Editors might (or might not) be reused after a call to
setValue(List).
If there is no backing list, an empty list will be returned.
Editors of type Epublic List<T> getList()
The structure of the List may be mutated arbitrarily, subject to the limitations of the backing
List, but the elements themselves should not be mutated except through getEditors() to
avoid data inconsistency.
Returns null if there is no backing list, and edits cannot be made.
ListEditor<Foo, MyFooEditor> listEditor = ListEditor.of(...); listEditor.setValue(listOfFoo); // Usually called by EditorDriver listEditor.getList().set(1, new Foo()); listEditor.getEditors().get(1).getFooFieldEditor().setValue(....);
null if there is no
backing list.public void onPropertyChange(String... paths)
public void setEditorChain(com.google.gwt.editor.client.CompositeEditor.EditorChain<T,E> chain)
Copyright © 2015–2019. All rights reserved.