public class

ListEditor

extends Object
implements CompositeEditor<T, C, E extends Editor<C>>
java.lang.Object
   ↳ com.google.gwt.editor.client.adapters.ListEditor<T, E extends com.google.gwt.editor.client.Editor<T>>
Known Direct Subclasses

Class Overview

Manages a list of objects and their associated Editors.

Summary

Protected Constructors
ListEditor(EditorSource<E> source)
Create a ListEditor backed by an EditorSource.
Public Methods
E createEditorForTraversal()
Creates a temporary sub-Editor to use for traversal.
void flush()
Indicates that the Editor cycle is finished.
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)
Used to implement getPath() for the component Editors.
static <T, E extends Editor<T>> ListEditor<T, E> of(EditorSource<E> source)
Create a ListEditor backed by an EditorSource.
void onPropertyChange(String... paths)
Notifies the Editor that one or more value properties have changed.
void setDelegate(EditorDelegate<List<T>> delegate)
void setEditorChain(EditorChain<T, E> chain)
void setValue(List<T> value)
Sets the ListEditor's backing data.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.google.gwt.editor.client.CompositeEditor
From interface com.google.gwt.editor.client.HasEditorDelegate
From interface com.google.gwt.editor.client.ValueAwareEditor

Protected Constructors

protected ListEditor (EditorSource<E> source)

Create a ListEditor backed by an EditorSource.

Parameters
source the EditorSource which will create sub-Editors

Public Methods

public E createEditorForTraversal ()

Creates a temporary sub-Editor to use for traversal.

Returns

public void flush ()

Indicates that the Editor cycle is finished. This method will be called in a depth-first order by the EditorDriver, so Editors do not generally need to flush their sub-editors.

public List<E> getEditors ()

Returns an unmodifiable, live view of the Editors managed by the ListEditor.

Returns

public List<T> getList ()

Returns a live view of the ListEditor's backing data. 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.

 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(....);
 

Returns
  • a live view of the ListEditor's backing data

public String getPathElement (E subEditor)

Used to implement getPath() for the component Editors.

Parameters
subEditor an instance of the Editor type previously passed into EditorChain#attach
Returns
  • the path element as a String

public static ListEditor<T, E> of (EditorSource<E> source)

Create a ListEditor backed by an EditorSource.

Parameters
source the EditorSource which will create sub-Editors
Returns
  • a new instance of ListEditor

public void onPropertyChange (String... paths)

Notifies the Editor that one or more value properties have changed. Not all backing services support property-based notifications.

Parameters
paths a list of String paths

public void setDelegate (EditorDelegate<List<T>> delegate)

public void setEditorChain (EditorChain<T, E> chain)

public void setValue (List<T> value)

Sets the ListEditor's backing data.

Parameters
value a List of data objects of type T