public abstract class

AbstractEditorDelegate

extends Object
implements EditorDelegate<T>
java.lang.Object
   ↳ com.google.gwt.editor.client.impl.AbstractEditorDelegate<T, E extends com.google.gwt.editor.client.Editor<T>>
Known Direct Subclasses

Class Overview

A base implementation of EditorDelegate for use by generated types.

Summary

Fields
protected CompositeEditor<T, ObjectEditor<Object>> composedEditor
protected Chain<ObjectEditor<Object>> editorChain
protected List<EditorError> errors
protected HasEditorErrors<T> hasEditorErrors
protected LeafValueEditor<T> leafValueEditor
protected String path
protected Map<StringEditor<?>> simpleEditors A map of local paths to sub-editors that do not have EditorDelegates (and will not be in the DelegateMap).
protected ValueAwareEditor<T> valueAwareEditor This field avoids needing to repeatedly cast #editor.
Public Constructors
AbstractEditorDelegate()
Public Methods
void flush(List<EditorError> errorAccumulator)
Flushes both data and errors.
void flushErrors(List<EditorError> errorAccumulator)
abstract T getObject()
String getPath()
Returns the Editor's path, relative to the root object.
void recordError(String message, Object value, Object userData)
This method should be called from flush() or getValue() to record an error that will be reported to the nearest super-Editor that implements the HasEditorErrors interface.
void recordError(String message, Object value, Object userData, String extraPath)
void refresh(T object)
abstract HandlerRegistration subscribe()
Register for notifications if object being edited is updated.
Protected Methods
String appendPath(String path)
static String appendPath(String prefix, String path)
abstract void attachSubEditors(DelegateMap delegates)
<C, D extends Editor<C>> AbstractEditorDelegate<C, D> createComposedDelegate()
Only implemented by delegates for a CompositeEditor.
<Q> Q ensureMutable(Q object)
abstract void flushSubEditorErrors(List<EditorError> errorAccumulator)
abstract void flushSubEditors(List<EditorError> errorAccumulator)
abstract E getEditor()
Editor<?> getSimpleEditor(String declaredPath)
void initialize(String pathSoFar, T object, E editor, DelegateMap map)
abstract <R, S extends Editor<R>> void initializeSubDelegate(AbstractEditorDelegate<R, S> subDelegate, String path, R object, S subEditor, DelegateMap map)
Initialize a sub-delegate returned from createComposedDelegate().
abstract void refreshEditors()
Refresh all of the sub-editors.
abstract void setEditor(E editor)
abstract void setObject(T object)
boolean shouldFlush()
Indicates whether or not calls to flush(List) are expected as part of normal operation.
abstract void traverse(List<String> paths)
Collect all paths being edited.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.google.gwt.editor.client.EditorDelegate

Fields

protected CompositeEditor<T, ObjectEditor<Object>> composedEditor

protected Chain<ObjectEditor<Object>> editorChain

protected List<EditorError> errors

protected HasEditorErrors<T> hasEditorErrors

protected LeafValueEditor<T> leafValueEditor

protected String path

protected Map<StringEditor<?>> simpleEditors

A map of local paths to sub-editors that do not have EditorDelegates (and will not be in the DelegateMap).

protected ValueAwareEditor<T> valueAwareEditor

This field avoids needing to repeatedly cast #editor.

Public Constructors

public AbstractEditorDelegate ()

Public Methods

public void flush (List<EditorError> errorAccumulator)

Flushes both data and errors.

public void flushErrors (List<EditorError> errorAccumulator)

public abstract T getObject ()

public String getPath ()

Returns the Editor's path, relative to the root object.

Returns
  • the path as a String

public void recordError (String message, Object value, Object userData)

This method should be called from flush() or getValue() to record an error that will be reported to the nearest super-Editor that implements the HasEditorErrors interface.

Parameters
message a textual description of the error
value the value to be returned by getValue() or null if the value currently associated with the Editor should be used
userData an arbitrary object, possibly null, that can be retrieved with getUserData()

public void recordError (String message, Object value, Object userData, String extraPath)

public void refresh (T object)

public abstract HandlerRegistration subscribe ()

Register for notifications if object being edited is updated. Not all backends support subscriptions and will return null.

The notification will occur via onPropertyChange(String...) if the backend supports in-place property updates, otherwise updates will be passed via setValue(T).

Returns
  • a HandlerRegistration to unsubscribe from the notifications or null if the delegate does not support subscription

Protected Methods

protected String appendPath (String path)

protected static String appendPath (String prefix, String path)

protected abstract void attachSubEditors (DelegateMap delegates)

protected AbstractEditorDelegate<C, D> createComposedDelegate ()

Only implemented by delegates for a CompositeEditor.

protected Q ensureMutable (Q object)

protected abstract void flushSubEditorErrors (List<EditorError> errorAccumulator)

protected abstract void flushSubEditors (List<EditorError> errorAccumulator)

protected abstract E getEditor ()

protected Editor<?> getSimpleEditor (String declaredPath)

protected void initialize (String pathSoFar, T object, E editor, DelegateMap map)

protected abstract void initializeSubDelegate (AbstractEditorDelegate<R, S> subDelegate, String path, R object, S subEditor, DelegateMap map)

Initialize a sub-delegate returned from createComposedDelegate().

protected abstract void refreshEditors ()

Refresh all of the sub-editors.

protected abstract void setEditor (E editor)

protected abstract void setObject (T object)

protected boolean shouldFlush ()

Indicates whether or not calls to flush(List) are expected as part of normal operation.

protected abstract void traverse (List<String> paths)

Collect all paths being edited.