Interface RequestFactoryEditorDriver<P,E extends Editor<? super P>>
-
- Type Parameters:
P- the type of Proxy being editedE- the type of Editor that will edit the Record
- All Superinterfaces:
EditorDriver<RequestContext>
- All Known Implementing Classes:
MockRequestFactoryEditorDriver
public interface RequestFactoryEditorDriver<P,E extends Editor<? super P>> extends EditorDriver<RequestContext>
The interface that links RequestFactory and the Editor framework together.Instances of this interface are created with
interface MyRFED extends RequestFactoryEditorDriver<MyObjectProxy, MyObjectEditor> {} MyRFED instance = GWT.create(MyRFED.class); { instance.initialize(.....); myRequest.with(instance.getPaths()); // Fire the request, in the callback instance.edit(retrievedRecord); // Control when the request is sent instance.flush().fire(new Receiver {...}); }- See Also:
HasRequestContext,MockRequestFactoryEditorDriver
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voiddisplay(P proxy)Start driving the Editor and its sub-editors with data for display-only mode.voidedit(P proxy, RequestContext request)Start driving the Editor and its sub-editors with data.RequestContextflush()Update the object being edited with the current state of the Editor.java.lang.String[]getPaths()Returns a new array containing the request paths.voidinitialize(EventBus eventBus, RequestFactory requestFactory, E editor)Overload ofinitialize(RequestFactory, Editor)to allow a modifiedEventBusto be monitored for subscription services.voidinitialize(RequestFactory requestFactory, E editor)Initializes a driver with the editor it will run, and a RequestFactory to use for subscription services.voidinitialize(E editor)Initializes a driver that will not be able to support subscriptions.booleansetViolations(java.lang.Iterable<Violation> violations)Deprecated.Users should switch toEditorDriver.setConstraintViolations(Iterable)-
Methods inherited from interface com.google.gwt.editor.client.EditorDriver
accept, getErrors, hasErrors, isDirty, setConstraintViolations
-
-
-
-
Method Detail
-
display
void display(P proxy)
Start driving the Editor and its sub-editors with data for display-only mode.- Parameters:
proxy- a Proxy of type P
-
edit
void edit(P proxy, RequestContext request)
Start driving the Editor and its sub-editors with data. ARequestContextis required to provide context for the changes to the proxy (seeRequestContext.edit(T). Note that this driver will not fire the request.- Parameters:
proxy- the proxy to be editedrequest- the request context that will accumulate edits and is returned formflush()
-
flush
RequestContext flush()
Update the object being edited with the current state of the Editor.- Specified by:
flushin interfaceEditorDriver<P>- Returns:
- the RequestContext passed into
edit(Object, RequestContext) - Throws:
java.lang.IllegalStateException- ifedit(Object, RequestContext)has not been called
-
getPaths
java.lang.String[] getPaths()
Returns a new array containing the request paths.- Returns:
- an array of Strings
-
initialize
void initialize(E editor)
Initializes a driver that will not be able to support subscriptions. Calls toEditorDelegate.subscribe()will do nothing.- Parameters:
editor- anEditorof type E
-
initialize
void initialize(EventBus eventBus, RequestFactory requestFactory, E editor)
Overload ofinitialize(RequestFactory, Editor)to allow a modifiedEventBusto be monitored for subscription services.- Parameters:
eventBus- theEventBusrequestFactory- aRequestFactoryinstanceeditor- anEditorof type E- See Also:
EditorDelegate.subscribe(),ResettableEventBus
-
initialize
void initialize(RequestFactory requestFactory, E editor)
Initializes a driver with the editor it will run, and a RequestFactory to use for subscription services.- Parameters:
requestFactory- aRequestFactoryinstanceeditor- anEditorof type E- See Also:
EditorDelegate.subscribe()
-
setViolations
@Deprecated boolean setViolations(java.lang.Iterable<Violation> violations)
Deprecated.Users should switch toEditorDriver.setConstraintViolations(Iterable)Show Violations returned from an attempt to submit a request. The violations will be converted intoEditorErrorobjects whosegetUserData()method can be used to access the original Violation object.- Parameters:
violations- an Iterable overViolationinstances- Returns:
trueif there were any unconsumed EditorErrors which can be retrieved fromEditorDriver.getErrors()
-
-