GWT 0.0.0

com.google.gwt.editor.client
Interface SimpleBeanEditorDriver<T,E extends Editor<? super T>>

Type Parameters:
T - the type being edited
E - the Editor for the type
All Known Implementing Classes:
MockSimpleBeanEditorDriver

public interface SimpleBeanEditorDriver<T,E extends Editor<? super T>>

Automates editing of simple bean-like objects. The EditorDelegate provided from this driver has a no-op implementation of EditorDelegate.subscribe().

 interface MyDriver extends SimpleBeanEditorDriver<MyObject, MyObjectEditor> {}
 MyDriver instance = GWT.create(MyDriver.class);
 {
 MyObjectEditor editor = new MyObjectEditor();
 instance.initialize(editor);
 // Do stuff 
 instance.edit(myObjectInstance);
 // Do more stuff 
 instance.flush();
 }
 

See Also:
MockSimpleBeanEditorDriver

Method Summary
 void edit(T object)
          Push the data in an object graph into the Editor given to initialize(E).
 T flush()
          Update the object being edited with the current state of the Editor.
 java.util.List<EditorError> getErrors()
          Returns any unconsumed EditorErrors from the last call to flush().
 boolean hasErrors()
          Indicates if the last call to flush() resulted in any errors.
 void initialize(E editor)
          Initialize the editor driver.
 

Method Detail

edit

void edit(T object)
Push the data in an object graph into the Editor given to initialize(E).

Parameters:
object - the object providing input data
Throws:
java.lang.IllegalStateException - if initialize(E) has not been called

flush

T flush()
Update the object being edited with the current state of the Editor.

Returns:
the object passed into edit(T)
Throws:
java.lang.IllegalStateException - if edit(T) has not been called

getErrors

java.util.List<EditorError> getErrors()
Returns any unconsumed EditorErrors from the last call to flush().

Returns:
a List of EditorError instances

hasErrors

boolean hasErrors()
Indicates if the last call to flush() resulted in any errors.

Returns:
true if errors are present

initialize

void initialize(E editor)
Initialize the editor driver.

Parameters:
editor - the Editor to populate

GWT 0.0.0