Class ListEditorWrapper<T,E extends Editor<? super T>>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractList<T>
com.google.gwt.editor.client.adapters.ListEditorWrapper<T,E>
- Type Parameters:
T
- the type of data being editedE
- the type of Editor
- All Implemented Interfaces:
Iterable<T>
,Collection<T>
,List<T>
,SequencedCollection<T>
Synchronizes a list of objects and a list of Editors.
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorsConstructorDescriptionListEditorWrapper
(List<T> backing, CompositeEditor.EditorChain<T, E> chain, EditorSource<E> editorSource) -
Method Summary
Modifier and TypeMethodDescriptionvoid
(package private) void
attach()
Must be called after construction.(package private) void
detach()
(package private) void
flush()
get
(int index) For testing only.(package private) boolean
isSameValue
(List<T> value) Checks whether that ListEditorWrapper can be reused for the passed list.(package private) void
refresh()
Refresh the editors in case the backing list has been modified from outside the ListEditorWrapper list.remove
(int index) int
size()
Methods inherited from class java.util.AbstractList
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addAll, addFirst, addLast, contains, containsAll, getFirst, getLast, isEmpty, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator, toArray, toArray
-
Constructor Details
-
ListEditorWrapper
public ListEditorWrapper(List<T> backing, CompositeEditor.EditorChain<T, E> chain, EditorSource<E> editorSource)
-
-
Method Details
-
add
-
get
-
remove
-
set
-
size
public int size()- Specified by:
size
in interfaceCollection<T>
- Specified by:
size
in interfaceList<T>
- Specified by:
size
in classAbstractCollection<T>
-
attach
void attach()Must be called after construction. This is a two-phase initialization so that ListEditor can assign its list field before any sub-editors might callListEditor.getList()
-
detach
void detach() -
flush
void flush() -
getEditors
For testing only. -
isSameValue
Checks whether that ListEditorWrapper can be reused for the passed list.The ListEditorWrapper can be reused if and only if the backing list is the same instance as the passed list.
-
refresh
void refresh()Refresh the editors in case the backing list has been modified from outside the ListEditorWrapper list.This is basically the opposite from
flush()
. It's used to reuse sub-editors instead of recreating a ListEditorWrapper from scratch.
-