Revision: 9017
Author: [email protected]
Date: Mon Oct 11 11:53:09 2010
Log: Edited wiki page Editors through web user interface.
http://code.google.com/p/google-web-toolkit/source/detail?r=9017

Modified:
 /wiki/Editors.wiki

=======================================
--- /wiki/Editors.wiki  Mon Oct 11 11:44:16 2010
+++ /wiki/Editors.wiki  Mon Oct 11 11:53:09 2010
@@ -4,6 +4,8 @@

The GWT Editor framework allows data stored in an object graph to be mapped onto a graph of Editors. The typical scenario is wiring objects returned from an RPC mechanism into a UI.

+<wiki:toc />
+
 == Quickstart ==

 {{{
@@ -126,21 +128,30 @@

In addition to the `Editor` interface, the Editor framework looks for these specific interfaces to provide basic building blocks for more complicated Editor behaviors. This section will document these interfaces and provide examples of how the Editor framework will interact with the API at runtime. All of these core Editor sub-interface can be mixed at will.

- * `LeafValueEditor` is used for non-object, immutable, or any type that the Editor framework should not descend into.
+=== !LeafValueEditor ===
+`LeafValueEditor` is used for non-object, immutable, or any type that the Editor framework should not descend into. 1 `setValue()` is called with the value that should be edited (e.g. `fooEditor.setValue(bean.getFoo());`). 1 `getValue()` is called when the Driver is flushing the state of the Editors into the bean. The value returned from this method will be assigned to the bean being edited (e.g. `bean.setFoo(fooEditor.getValue());`).
-  * `HasEditorDelegate` provides an Editor with its peer `EditorDelegate`.
+
+=== !HasEditorDelegate ===
+`HasEditorDelegate` provides an Editor with its peer `EditorDelegate`.
1 `setEditorDelegate()` is called before any value initialization takes place. - * `ValueAwareEditor` may be used if an Editor's behavior depends on the value that it is editing, or if the Editor requires explicit flush notification.
+
+=== !ValueAwareEditor ===
+`ValueAwareEditor` may be used if an Editor's behavior depends on the value that it is editing, or if the Editor requires explicit flush notification. 1 `setEditorDelegate()` is called, per `HasEditorDelegate` super-interface. 1 `setValue()` is called with the value that the Editor is responsible for editing. If the value will affect with sub-editors are or are not provided to the framework, they should be initialized or nullified at this time. 1 If `EditorDelegate.subscribe()` has been called, the Editor may receive subsequent calls to `onPropertyChange()` or `setValue()` at any point in time. 1 `flush()` is called in a depth-first manner by the driver, so Editors generally do not flush their sub-Editors. - * `CompositeEditor` allows an unknown number of homogenous sub-Editors to be added to the Editor hierarchy at runtime. In addition to the behavior described for `ValueAwareEditor`, `CompositeEditor` has the following additional APIs:
+
+=== !CompositeEditor ===
+`CompositeEditor` allows an unknown number of homogenous sub-Editors to be added to the Editor hierarchy at runtime. In addition to the behavior described for `ValueAwareEditor`, `CompositeEditor` has the following additional APIs: 1 `createEditorForTraversal()` should return a canonical sub-editor instance that will be used by the driver for computing all edited paths. If the composite editor is editing a Collection, this method solves the problem of having no sub-Editors available to examine for an empty Collection. 1 `setEditorChain()` provides the `CompositeEditor` with access to the `EditorChain`, which allows the component sub-Editors to be attached and detached from the Editor hierarchy. 1 `getPathElement()` is called by the Editor framework for each attached component sub-Editor in order to compute the return value for `EditorDelegate.getPath()`. A `CompositeEditor` that is editing an indexable datastructure, such as a `List`, might return `[index]` for this method. - * `HasEditorErrors` indicates that the Editor wishes to receive any unconsumed errors reported by sub-Editors through `EditorDelegate.recordError()`. The Editor may mark an `EditorError` as consumed by calling `EditorError.setConsumed()`.
+
+=== !HasEditorErrors ===
+`HasEditorErrors` indicates that the Editor wishes to receive any unconsumed errors reported by sub-Editors through `EditorDelegate.recordError()`. The Editor may mark an `EditorError` as consumed by calling `EditorError.setConsumed()`.

 == Provided Adapters ==

@@ -162,13 +173,15 @@
 == Driver types ==

 The GWT Editor framework provides the following top-level drivers:
- * `SimpleBeanEditorDriver` can be used with any bean-like object. It does not provide support for update subscriptions.
+  * `SimpleBeanEditorDriver` can be used with any bean-like object.
+    * It does not provide support for update subscriptions.
* `RequestFactoryEditorDriver` is designed to integrate with `RequestFactory` and edit `EntityProxy` subtypes. * This driver type requires a `RequestContext` in order to automatically call `RequestContext.edit()` on any `EntityProxy` instances that are encountered. + * Subscriptions are supported by listening for `EntityProxyChange` events on the `RequestFactory`'s `EventBus`.

 == FAQ ==

-=== Editor or IsEditor ==
+=== Editor vs. !IsEditor ==

 *Q:* Should my `Widget` implement an `Editor` interface or `IsEditor`?

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to