Package com.google.gwt.editor.client
Interface EditorDriver<T>
- 
- Type Parameters:
 T- the type of data returned fromflush()
- All Known Subinterfaces:
 RequestFactoryEditorDriver<P,E>,SimpleBeanEditorDriver<T,E>
- All Known Implementing Classes:
 MockRequestFactoryEditorDriver,MockSimpleBeanEditorDriver
public interface EditorDriver<T>Defines common capabilities of editor drivers.The
EditorDriverinterface cannot be used withGWT.create()directly. Instead, use one of the specializations of this interface.- See Also:
 SimpleBeanEditorDriver,RequestFactoryEditorDriver
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaccept(EditorVisitor visitor)Visit the Editor hierarchy controlled by the EditorDriver.Tflush()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 toflush().booleanhasErrors()Indicates if the last call toflush()resulted in any errors.booleanisDirty()Returnstrueif any of the Editors in the hierarchy have been modified relative to the last value passed intoSimpleBeanEditorDriver.edit(Object).booleansetConstraintViolations(java.lang.Iterable<ConstraintViolation<?>> violations)ShowConstraintViolationsgenerated through aValidator. 
 - 
 
- 
- 
Method Detail
- 
accept
void accept(EditorVisitor visitor)
Visit the Editor hierarchy controlled by the EditorDriver. 
- 
flush
T flush()
Update the object being edited with the current state of the Editor.- Returns:
 - an implementation-specific value
 
 
- 
getErrors
java.util.List<EditorError> getErrors()
Returns any unconsumed EditorErrors from the last call toflush().- Returns:
 - a List of 
EditorErrorinstances 
 
- 
hasErrors
boolean hasErrors()
Indicates if the last call toflush()resulted in any errors.- Returns:
 trueif errors are present
 
- 
isDirty
boolean isDirty()
Returnstrueif any of the Editors in the hierarchy have been modified relative to the last value passed intoSimpleBeanEditorDriver.edit(Object).This method is not affected by
flush()to support the following workflow:EditorDriver.edit()- The user edits the on-screen values
 EditorDriver.flush()- The data in the edited object is validated:
 
- The validation fails, returning to step 2
 - The validation succeeds and the editing UI is dismissed
 
 
isDirty()is correct for the above workflow. If theflush()method were to clear the dirty state, it would be necessary to implement an alternate flag to distinguish between a newly-initialized editor entering step 2 or re-entering step 2.- See Also:
 EditorDelegate.setDirty(boolean)
 
- 
setConstraintViolations
boolean setConstraintViolations(java.lang.Iterable<ConstraintViolation<?>> violations)
ShowConstraintViolationsgenerated through aValidator. The violations will be converted intoEditorErrorobjects whosegetUserData()method can be used to access the original ConstraintViolation object.- Parameters:
 violations- an Iterable overConstraintViolationinstances- Returns:
 trueif there were any unconsumed EditorErrors which can be retrieved fromgetErrors()
 
 - 
 
 -