Package 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<T>)
method.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetPath()
Returns the Editor's path, relative to the root object.void
recordError
(String message, Object value, Object userData) This method should be called fromValueAwareEditor.flush()
orTakesValue.getValue()
to record an error that will be reported to the nearest super-Editor that implements theHasEditorErrors
interface.void
setDirty
(boolean dirty) Toggle the dirty-state flag for the Editor.Register for notifications if object being edited is updated.
-
Method Details
-
getPath
String getPath()Returns the Editor's path, relative to the root object.- Returns:
- the path as a String
-
recordError
This method should be called fromValueAwareEditor.flush()
orTakesValue.getValue()
to record an error that will be reported to the nearest super-Editor that implements theHasEditorErrors
interface.- Parameters:
message
- a textual description of the errorvalue
- the value to be returned byEditorError.getValue()
ornull
if the value currently associated with the Editor should be useduserData
- an arbitrary object, possiblynull
, that can be retrieved withEditorError.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()
orflush()
methods are called.The dirty state will be automatically calculated for
LeafValueEditor
instances based on anObject.equals(Object)
comparison ofTakesValue.getValue()
and the value last passed toTakesValue.setValue(Object)
, however a clean state can be overridden by callingsetDirty(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 returnnull
.The notification will occur via
ValueAwareEditor.onPropertyChange(java.lang.String...)
if the backend supports in-place property updates, otherwise updates will be passed viaValueAwareEditor.setValue(T)
.- Returns:
- a HandlerRegistration to unsubscribe from the notifications or
null
if the delegate does not support subscription
-