EditorDelegate (GWT Javadoc)

Overview | Package | Class | Use | Deprecated | Help
| GWT 2.7.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.google.gwt.editor.client
Interface EditorDelegate<T>

Type Parameters:
  `T` - the type of object the delegate can accept

All Known Implementing Classes:
  MockEditorDelegate

    public interface EditorDelegate<T>

Binds an individual Editor to the backing service. Every Editor has a peer EditorDelegate. If an Editor implements the `ValueAwareEditor` interface, the EditorDriver will make the delegate available through the `HasEditorDelegate.setDelegate(com.google.gwt.editor.client.EditorDelegate)` method.

See Also:
  `MockEditorDelegate`

Method Summary
`java.lang.String` | `getPath()` Returns the Editor's path, relative to the root object.
`void` | `recordError(java.lang.String message, java.lang.Object value, java.lang.Object userData)` This method should be called from `ValueAwareEditor.flush()` or `TakesValue.getValue()` to record an error that will be reported to the nearest super-Editor that implements the `HasEditorErrors` interface.
`void` | `setDirty(boolean dirty)` Toggle the dirty-state flag for the Editor.
`HandlerRegistration` | `subscribe()` Register for notifications if object being edited is updated.

Method Detail

### getPath

    java.lang.String getPath()

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

  Returns:
    the path as a String

### recordError

    void recordError(java.lang.String message,
                     java.lang.Object value,
                     java.lang.Object userData)

  This method should be called from `ValueAwareEditor.flush()` or `TakesValue.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 `EditorError.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 `EditorError.getUserData()`

### setDirty

    void setDirty(boolean dirty)

  Toggle the dirty-state flag for the Editor.

  The dirty state of an Editor will be automatically cleared any time the Driver's `edit()` or `flush()` methods are called.

  The dirty state will be automatically calculated for `LeafValueEditor` instances based on an `Object.equals(Object)` comparison of `TakesValue.getValue()` and the value last passed to `TakesValue.setValue(Object)`, however a clean state can be overridden by calling `setDirty(true)`.

  Parameters:
    `dirty` - the dirty state of the Editor

### subscribe

    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 `ValueAwareEditor.onPropertyChange(java.lang.String...)` if the backend supports in-place property updates, otherwise updates will be passed via `ValueAwareEditor.setValue(T)`.

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

Overview | Package | Class | Use | Deprecated | Help
| GWT 2.7.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD