Class ListEditorWrapper<T,E extends Editor<? super T>>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- 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:
java.lang.Iterable<T>,java.util.Collection<T>,java.util.List<T>
class ListEditorWrapper<T,E extends Editor<? super T>> extends java.util.AbstractList<T>Synchronizes a list of objects and a list of Editors.
-
-
Constructor Summary
Constructors Constructor Description ListEditorWrapper(java.util.List<T> backing, CompositeEditor.EditorChain<T,E> chain, EditorSource<E> editorSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, T element)(package private) voidattach()Must be called after construction.(package private) voiddetach()(package private) voidflush()Tget(int index)(package private) java.util.List<? extends E>getEditors()For testing only.(package private) booleanisSameValue(java.util.List<T> value)Checks whether that ListEditorWrapper can be reused for the passed list.(package private) voidrefresh()Refresh the editors in case the backing list has been modified from outside the ListEditorWrapper list.Tremove(int index)Tset(int index, T element)intsize()-
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
-
-
-
-
Constructor Detail
-
ListEditorWrapper
public ListEditorWrapper(java.util.List<T> backing, CompositeEditor.EditorChain<T,E> chain, EditorSource<E> editorSource)
-
-
Method Detail
-
add
public void add(int index, T element)
-
get
public T get(int index)
-
remove
public T remove(int index)
-
size
public int size()
-
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
java.util.List<? extends E> getEditors()
For testing only.
-
isSameValue
boolean isSameValue(java.util.List<T> value)
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.
-
-