public interface

RequestFactoryEditorDriver

com.google.gwt.requestfactory.client.RequestFactoryEditorDriver<P, E extends com.google.gwt.editor.client.Editor<? super P>>
Known Indirect Subclasses

Class Overview

The interface that links RequestFactory and the Editor framework together. Used for configuration and lifecycle control. Expected that this will be 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 com.google.gwt.requestfactory.client.testing.MockRequestFactoryEditorDriver

Summary

Public Methods
abstract void display(P proxy)
Start driving the Editor and its sub-editors with data for display-only mode.
abstract void edit(P proxy, RequestContext request)
Start driving the Editor and its sub-editors with data.
abstract RequestContext flush()
Ensures that the Editor passed into initialize(E) and its sub-editors, if any, have synced their UI state by invoking flushing them in a depth-first manner.
abstract List<EditorError> getErrors()
Returns any unconsumed EditorErrors from the last call to flush().
abstract String[] getPaths()
Returns a new array containing the request paths.
abstract boolean hasErrors()
Indicates if the last call to flush() resulted in any errors.
abstract void initialize(E editor)
Initializes a driver that will not be able to support subscriptions.
abstract void initialize(EventBus eventBus, RequestFactory requestFactory, E editor)
Overload of initialize(RequestFactory, Editor) to allow a modified EventBus to be monitored for subscription services.
abstract void initialize(RequestFactory requestFactory, E editor)
Initializes a driver with the editor it will run, and a RequestFactory to use for subscription services.
abstract boolean setViolations(Iterable<Violation> errors)
Show Violations returned from an attempt to submit a request.

Public Methods

public abstract 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

public abstract void edit (P proxy, RequestContext request)

Start driving the Editor and its sub-editors with data. A RequestContext is required to provide context for the changes to the proxy (see edit(T). Note that this driver will not fire the request.

Parameters
proxy the proxy to be edited
request the request context that will accumulate edits and is returned form flush()

public abstract RequestContext flush ()

Ensures that the Editor passed into initialize(E) and its sub-editors, if any, have synced their UI state by invoking flushing them in a depth-first manner.

Returns
Throws
IllegalStateException if edit(Object, RequestContext) has not been called with a non-null RequestContext

public abstract List<EditorError> getErrors ()

Returns any unconsumed EditorErrors from the last call to flush().

Returns

public abstract String[] getPaths ()

Returns a new array containing the request paths.

Returns
  • an array of Strings

public abstract boolean hasErrors ()

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

Returns
  • true if errors are present

public abstract void initialize (E editor)

Initializes a driver that will not be able to support subscriptions. Calls to subscribe() will do nothing.

Parameters
editor an Editor of type E

public abstract void initialize (EventBus eventBus, RequestFactory requestFactory, E editor)

Overload of initialize(RequestFactory, Editor) to allow a modified EventBus to be monitored for subscription services.

Parameters
eventBus the EventBus
requestFactory a RequestFactory instance
editor an Editor of type E

public abstract 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 a RequestFactory instance
editor an Editor of type E
See Also

public abstract boolean setViolations (Iterable<Violation> errors)

Show Violations returned from an attempt to submit a request. The violations will be converted into EditorError objects whose getUserData() method can be used to access the original Violation object.

Parameters
errors a Iterable over Violation instances
Returns
  • true if there were any unconsumed EditorErrors which can be retrieved from getErrors()