Package com.google.gwt.editor.client
Interface CompositeEditor<T,C,E extends Editor<? super C>>
-
- Type Parameters:
T- the base type being editedC- the component type to be editedE- the type of Editor that will edit the component type
- All Superinterfaces:
Editor<T>,HasEditorDelegate<T>,ValueAwareEditor<T>
- All Known Implementing Classes:
HasDataEditor,ListEditor,OptionalFieldEditor
public interface CompositeEditor<T,C,E extends Editor<? super C>> extends ValueAwareEditor<T>
An interface that indicates that a given Editor is composed of an unknown number of sub-Editors all of the same type.For example, the
ListEditortype is aCompositeEditor<List<T>, T, E extends Editor<T>>; that is, ListEditor will accept a List<T> and will edit some unknown number ofT's using the Editor typeE. Another example might be:class WorkgroupEditor implements CompositeEditor<Workgroup, Person, PersonSummaryEditor>{ public void setValue(Workgroup workgroup) { // Assuming Workgroup implements Iterable<Person> for (Person p : workgroup) { PersonSummaryEditor editor = new PersonSummaryEditor(); // Attach editor to DOM somePanel.add(editor); // Let the generated code drive the sub-editor editorChain.attach(p, editor); } } }
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceCompositeEditor.EditorChain<C,E extends Editor<? super C>>Allows instances of the component type to be attached to the Editor framework.-
Nested classes/interfaces inherited from interface com.google.gwt.editor.client.Editor
Editor.Ignore, Editor.Path
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description EcreateEditorForTraversal()Returns an canonical sub-editor instance that will be used by the driver for computing all edited paths.java.lang.StringgetPathElement(E subEditor)Used to implementEditorDelegate.getPath()for the component Editors.voidsetEditorChain(CompositeEditor.EditorChain<C,E> chain)Called by the Editor framework to provide theCompositeEditor.EditorChain.-
Methods inherited from interface com.google.gwt.editor.client.HasEditorDelegate
setDelegate
-
Methods inherited from interface com.google.gwt.editor.client.ValueAwareEditor
flush, onPropertyChange, setValue
-
-
-
-
Method Detail
-
createEditorForTraversal
E createEditorForTraversal()
Returns an canonical sub-editor instance that will be used by the driver for computing all edited paths.- Returns:
- an instance of the Editor type
-
getPathElement
java.lang.String getPathElement(E subEditor)
Used to implementEditorDelegate.getPath()for the component Editors.- Parameters:
subEditor- an instance of the Editor type previously passed intoCompositeEditor.EditorChain.attach(C, E)- Returns:
- the path element as a String
-
setEditorChain
void setEditorChain(CompositeEditor.EditorChain<C,E> chain)
Called by the Editor framework to provide theCompositeEditor.EditorChain.- Parameters:
chain- anCompositeEditor.EditorChaininstance
-
-