Revision: 9066
Author: [email protected]
Date: Thu Oct 14 09:50:44 2010
Log: Add missing javadoc for Editor framework
Review at http://gwt-code-reviews.appspot.com/1002801
Review by: [email protected]
http://code.google.com/p/google-web-toolkit/source/detail?r=9066
Added:
/trunk/user/src/com/google/gwt/editor/client/adapters/package.html
/trunk/user/src/com/google/gwt/editor/client/package.html
/trunk/user/src/com/google/gwt/editor/ui/client/adapters/package.html
/trunk/user/src/com/google/gwt/editor/ui/client/package.html
Modified:
/trunk/user/src/com/google/gwt/editor/client/AutoBean.java
/trunk/user/src/com/google/gwt/editor/client/AutoBeanFactory.java
/trunk/user/src/com/google/gwt/editor/client/AutoBeanUtils.java
/trunk/user/src/com/google/gwt/editor/client/AutoBeanVisitor.java
/trunk/user/src/com/google/gwt/editor/client/CompositeEditor.java
/trunk/user/src/com/google/gwt/editor/client/EditorDelegate.java
/trunk/user/src/com/google/gwt/editor/client/EditorError.java
/trunk/user/src/com/google/gwt/editor/client/HasEditorDelegate.java
/trunk/user/src/com/google/gwt/editor/client/IsEditor.java
/trunk/user/src/com/google/gwt/editor/client/SimpleBeanEditorDriver.java
/trunk/user/src/com/google/gwt/editor/client/ValueAwareEditor.java
/trunk/user/src/com/google/gwt/editor/client/adapters/EditorSource.java
/trunk/user/src/com/google/gwt/editor/client/adapters/ListEditor.java
/trunk/user/src/com/google/gwt/editor/client/adapters/OptionalFieldEditor.java
/trunk/user/src/com/google/gwt/editor/client/adapters/SimpleEditor.java
/trunk/user/src/com/google/gwt/editor/client/adapters/TakesValueEditor.java
/trunk/user/src/com/google/gwt/editor/ui/client/ValueBoxEditorDecorator.java
/trunk/user/src/com/google/gwt/editor/ui/client/adapters/HasTextEditor.java
/trunk/user/src/com/google/gwt/editor/ui/client/adapters/ValueBoxEditor.java
/trunk/user/src/com/google/gwt/user/client/TakesValue.java
=======================================
--- /dev/null
+++ /trunk/user/src/com/google/gwt/editor/client/adapters/package.html Thu
Oct 14 09:50:44 2010
@@ -0,0 +1,7 @@
+<html>
+<body>
+<p>Adapters for the bean editor framework.</p>
+
+...@since GWT 2.1
+</body>
+</html>
=======================================
--- /dev/null
+++ /trunk/user/src/com/google/gwt/editor/client/package.html Thu Oct 14
09:50:44 2010
@@ -0,0 +1,7 @@
+<html>
+<body>
+<p>A framework for editing bean-like objects.</p>
+
+...@since GWT 2.1
+</body>
+</html>
=======================================
--- /dev/null
+++ /trunk/user/src/com/google/gwt/editor/ui/client/adapters/package.html
Thu Oct 14 09:50:44 2010
@@ -0,0 +1,7 @@
+<html>
+<body>
+<p>User interface adapters for the bean editor framework.</p>
+
+...@since GWT 2.1
+</body>
+</html>
=======================================
--- /dev/null
+++ /trunk/user/src/com/google/gwt/editor/ui/client/package.html Thu Oct 14
09:50:44 2010
@@ -0,0 +1,7 @@
+<html>
+<body>
+<p>User interface components for the bean editor framework.</p>
+
+...@since GWT 2.1
+</body>
+</html>
=======================================
--- /trunk/user/src/com/google/gwt/editor/client/AutoBean.java Tue Oct 5
11:03:13 2010
+++ /trunk/user/src/com/google/gwt/editor/client/AutoBean.java Thu Oct 14
09:50:44 2010
@@ -23,12 +23,16 @@
public interface AutoBean<T> {
/**
* Accept an AutoBeanVisitor.
+ *
+ * @param visitor an {...@link AutoBeanVisitor}
*/
void accept(AutoBeanVisitor visitor);
/**
* Returns a proxy implementation of the <code>T</code> interface which
will
* delegate to the underlying wrapped object, if any.
+ *
+ * @return a proxy that delegates to the wrapped object
*/
T as();
@@ -40,6 +44,7 @@
* of the value of <code>deep</code>.
*
* @param deep indicates if all referenced AutoBeans should be cloned
+ * @return a copy of this {...@link AutoBean}
* @throws IllegalStateException if the AutoBean is a wrapper type
*/
AutoBean<T> clone(boolean deep);
@@ -47,36 +52,52 @@
/**
* Retrieve a tag value that was previously provided to
* {...@link #setTag(String, Object)}.
+ *
+ * @param tagName the tag name
+ * @return the tag value
+ * @see #setTag(String, Object)
*/
<Q> Q getTag(String tagName);
/**
- * Returns the value most recently passed to {...@link #setFrozen}, or false
- * if it has never been called.
+ * Returns the value most recently passed to {...@link #setFrozen}, or
{...@code
+ * false} if it has never been called.
+ *
+ * @return {...@code true} if this instance is frozen
*/
boolean isFrozen();
/**
- * Returns <code>true</code> if the AutoBean was provided with an
external
+ * Returns {...@code true} if the AutoBean was provided with an external
* object.
+ *
+ * @return {...@code true} if this instance is a wrapper
*/
boolean isWrapper();
/**
* Disallows any method calls other than getters. All setter and call
* operations will throw an {...@link UnsupportedOperationException}.
+ *
+ * @param frozen if {...@code true}, freeze this instance
*/
void setFrozen(boolean frozen);
/**
* A tag is an arbitrary piece of external metadata to be associated
with the
* wrapped value.
+ *
+ * @param tagName the tag name
+ * @param value the wrapped value
+ * @see #getTag(String)
*/
void setTag(String tagName, Object value);
/**
* If the AutoBean wraps an object, return the underlying object.
- *
+ * The AutoBean will no longer function once unwrapped.
+ *
+ * @return the previously-wrapped object
* @throws IllegalStateException if the AutoBean is not a wrapper
*/
T unwrap();
=======================================
--- /trunk/user/src/com/google/gwt/editor/client/AutoBeanFactory.java Fri
Oct 1 18:15:55 2010
+++ /trunk/user/src/com/google/gwt/editor/client/AutoBeanFactory.java Thu
Oct 14 09:50:44 2010
@@ -93,12 +93,24 @@
/**
* Allows dynamic creation of AutoBean instances based on declared
* parameterizations.
+ *
+ * @param <T> the parameterization of the created {...@link AutoBean}
+ * @param clazz the Class of type T of the new instance
+ * @return an {...@link AutoBean} of type T or {...@code null} if the
interface type
+ * is unknown to the factory
*/
<T> AutoBean<T> create(Class<T> clazz);
/**
* Allows dynamic creation of wrapped AutoBean instances based on
declared
* parameterizations.
+ *
+ * @param <T> the parameterization of the created {...@link AutoBean}
+ * @param <U> the delegate's type, a subtype of T
+ * @param clazz the Class of type T of the new instance
+ * @param delegate a delegate that extends type T
+ * @return an {...@link AutoBean} of type T or {...@code null} if the
interface type
+ * is unknown to the factory
*/
<T, U extends T> AutoBean<T> create(Class<T> clazz, U delegate);
}
=======================================
--- /trunk/user/src/com/google/gwt/editor/client/AutoBeanUtils.java Fri
Oct 1 18:15:55 2010
+++ /trunk/user/src/com/google/gwt/editor/client/AutoBeanUtils.java Thu Oct
14 09:50:44 2010
@@ -35,6 +35,10 @@
* although the diff produced is likely meaningless.
* <p>
* This will work for both simple and wrapper AutoBeans.
+ *
+ * @param a an {...@link AutoBean}
+ * @param b an {...@link AutoBean}
+ * @return a {...@link Map} of differing properties
*/
public static Map<String, Object> diff(AutoBean<?> a, AutoBean<?> b) {
// Fast check for comparing an object to itself
@@ -93,6 +97,9 @@
* Returns a map that is a copy of the properties contained in an
AutoBean.
* The returned map is mutable, but editing it will not have any effect
on the
* bean that produced it.
+ *
+ * @param bean an {...@link AutoBean}
+ * @return a {...@link Map} of the bean's properties
*/
public static Map<String, Object> getAllProperties(AutoBean<?> bean) {
final Map<String, Object> toReturn = new LinkedHashMap<String,
Object>();
@@ -118,8 +125,11 @@
/**
* Return the single AutoBean wrapper that is observing the delegate
object or
- * <code>null</code> if the parameter is <code>null</code> or not
wrapped by
+ * {...@code null} if the parameter is {...@code null}or not wrapped by
* an AutoBean.
+ *
+ * @param delegate a delegate object, or {...@code null}
+ * @return the {...@link AutoBean} wrapper for the delegate, or {...@code
null}
*/
@SuppressWarnings("unchecked")
public static <T, U extends T> AutoBean<T> getAutoBean(U delegate) {
=======================================
--- /trunk/user/src/com/google/gwt/editor/client/AutoBeanVisitor.java Tue
Oct 5 11:03:13 2010
+++ /trunk/user/src/com/google/gwt/editor/client/AutoBeanVisitor.java Thu
Oct 14 09:50:44 2010
@@ -31,37 +31,49 @@
public interface PropertyContext {
/**
* Indicates if the {...@link #set} method will succeed.
+ *
+ * @return {...@code true} if the property can be set
*/
boolean canSet();
/**
* If the reference property is a collection, returns the collection's
* element type.
+ *
+ * @return a Class object representing the element type or {...@code
null} if
+ * the property is not a collection type
*/
Class<?> getElementType();
/**
* Returns the expected type of the property.
+ *
+ * @return a Class object representing the property type
*/
Class<?> getType();
+ /**
+ * Sets a property value.
+ *
+ * @param value the new value
+ */
void set(Object value);
}
/**
- * TODO: document.
+ * Called after visiting an {...@link AutoBean}.
*
- * @param bean
+ * @param bean an {...@link AutoBean}
* @param ctx a Context
*/
public void endVisit(AutoBean<?> bean, Context ctx) {
}
/**
- * TODO: document.
+ * Called after visiting a reference property.
*
- * @param propertyName
- * @param value
+ * @param propertyName the property name, as a String
+ * @param value the property value
* @param ctx a PropertyContext
*/
public void endVisitReferenceProperty(String propertyName, AutoBean<?>
value,
@@ -69,10 +81,10 @@
}
/**
- * TODO: document.
+ * Called after visiting a value property.
*
- * @param propertyName
- * @param value
+ * @param propertyName the property name, as a String
+ * @param value the property value
* @param ctx a PropertyContext
*/
public void endVisitValueProperty(String propertyName, Object value,
@@ -80,9 +92,9 @@
}
/**
- * TODO: document.
+ * Called when visiting an {...@link AutoBean}.
*
- * @param bean
+ * @param bean an {...@link AutoBean}
* @param ctx a Context
*/
public boolean visit(AutoBean<?> bean, Context ctx) {
@@ -93,8 +105,8 @@
* Called every time, but {...@link #visit(AutoBean, Context)} will be
called for
* the value only the first time it is encountered.
*
- * @param propertyName
- * @param value
+ * @param propertyName the property name, as a String
+ * @param value the property value
* @param ctx a PropertyContext
*/
public boolean visitReferenceProperty(String propertyName, AutoBean<?>
value,
@@ -105,8 +117,8 @@
/**
* TODO: document.
*
- * @param propertyName
- * @param value
+ * @param propertyName the property name, as a String
+ * @param value the property value
* @param ctx a PropertyContext
*/
public boolean visitValueProperty(String propertyName, Object value,
=======================================
--- /trunk/user/src/com/google/gwt/editor/client/CompositeEditor.java Wed
Oct 6 10:46:19 2010
+++ /trunk/user/src/com/google/gwt/editor/client/CompositeEditor.java Thu
Oct 14 09:50:44 2010
@@ -84,13 +84,25 @@
/**
* Returns an canonical sub-editor instance that will be used by the
driver
* for computing all edited paths.
+ *
+ * @return an instance of the Editor type
*/
E createEditorForTraversal();
/**
- * Used to implement {...@link EditorDelegate#getPath()}.
+ * Used to implement {...@link EditorDelegate#getPath()} for the component
+ * Editors.
+ *
+ * @param subEditor an instance of the Editor type previously passed into
+ * {...@link EditorChain#attach}
+ * @return the path element as a String
*/
String getPathElement(E subEditor);
+ /**
+ * Called by the Editor framework to provide the {...@link EditorChain}.
+ *
+ * @param chain an {...@link EditorChain} instance
+ */
void setEditorChain(EditorChain<C, E> chain);
}
=======================================
--- /trunk/user/src/com/google/gwt/editor/client/EditorDelegate.java Tue
Oct 12 10:53:11 2010
+++ /trunk/user/src/com/google/gwt/editor/client/EditorDelegate.java Thu
Oct 14 09:50:44 2010
@@ -29,6 +29,8 @@
public interface EditorDelegate<T> {
/**
* Returns the Editor's path, relative to the root object.
+ *
+ * @return the path as a String
*/
String getPath();
=======================================
--- /trunk/user/src/com/google/gwt/editor/client/EditorError.java Tue Oct
5 11:03:13 2010
+++ /trunk/user/src/com/google/gwt/editor/client/EditorError.java Thu Oct
14 09:50:44 2010
@@ -26,16 +26,22 @@
/**
* Returns the absolute path location of the error, relative to the
object
* that was passed into the EditorDriver.
+ *
+ * @return the absolute path as a String
*/
String getAbsolutePath();
/**
* Returns the Editor that holds the invalid value.
+ *
+ * @return the Editor instance
*/
Editor<?> getEditor();
/**
* Returns a message associated with the error.
+ *
+ * @return the error message as a String
*/
String getMessage();
@@ -43,28 +49,40 @@
* Returns the path of the error relative to the Editor receiving the
error.
* If the error concerns the Editor that is receiving the error, this
method
* will return an empty string.
+ *
+ * @return the error path as a String
*/
String getPath();
/**
* Returns the object passed into {...@link EditorDelegate#recordError}.
+ *
+ * @return the user data Object
*/
Object getUserData();
/**
* Returns the value that triggered the error.
+ *
+ * @return the error value Object
*/
Object getValue();
/**
* Indicates whether or not the EditorError will be propagated to the
* enclosing Editor.
+ *
+ * @return {...@code true} if the error will not be propagated
+ * @see #setConsumed(boolean)
*/
boolean isConsumed();
/**
* Indicates whether or not the EditorError will be propagated to the
* enclosing Editor.
+ *
+ * @param consumed {...@code true} if the error will not be propagated
+ * @see #isConsumed()
*/
void setConsumed(boolean consumed);
}
=======================================
--- /trunk/user/src/com/google/gwt/editor/client/HasEditorDelegate.java Mon
Sep 13 09:30:34 2010
+++ /trunk/user/src/com/google/gwt/editor/client/HasEditorDelegate.java Thu
Oct 14 09:50:44 2010
@@ -25,6 +25,8 @@
/**
* Called by the EditorDriver to provide access to the EditorDelegate the
* Editor is peered with.
+ *
+ * @param delegate an {...@link EditorDelegate} of type T
*/
void setDelegate(EditorDelegate<T> delegate);
=======================================
--- /trunk/user/src/com/google/gwt/editor/client/IsEditor.java Thu Oct 14
08:15:26 2010
+++ /trunk/user/src/com/google/gwt/editor/client/IsEditor.java Thu Oct 14
09:50:44 2010
@@ -50,6 +50,8 @@
public interface IsEditor<E extends Editor<?>> {
/**
* Returns the Editor encapsulated by the view object.
+ *
+ * @return an {...@link Editor} of type E
*/
E asEditor();
}
=======================================
---
/trunk/user/src/com/google/gwt/editor/client/SimpleBeanEditorDriver.java
Tue Oct 12 10:53:11 2010
+++
/trunk/user/src/com/google/gwt/editor/client/SimpleBeanEditorDriver.java
Thu Oct 14 09:50:44 2010
@@ -59,11 +59,15 @@
/**
* Returns any unconsumed EditorErrors from the last call to {...@link
#flush()}.
+ *
+ * @return a List of {...@link EditorError} instances
*/
List<EditorError> getErrors();
/**
* Indicates if the last call to {...@link #flush()} resulted in any errors.
+ *
+ * @return {...@code true} if errors are present
*/
boolean hasErrors();
=======================================
--- /trunk/user/src/com/google/gwt/editor/client/ValueAwareEditor.java Fri
Sep 24 12:10:50 2010
+++ /trunk/user/src/com/google/gwt/editor/client/ValueAwareEditor.java Thu
Oct 14 09:50:44 2010
@@ -32,6 +32,8 @@
/**
* Notifies the Editor that one or more value properties have changed.
Not all
* backing services support property-based notifications.
+ *
+ * @param paths a list of String paths
*/
void onPropertyChange(String... paths);
@@ -40,6 +42,8 @@
* <p>
* ValueAwareEditors should preferentially use sub-editors to alter the
* properties of the object being edited.
+ *
+ * @param value a value of type T
*/
void setValue(T value);
}
=======================================
--- /trunk/user/src/com/google/gwt/editor/client/adapters/EditorSource.java
Wed Sep 29 11:01:14 2010
+++ /trunk/user/src/com/google/gwt/editor/client/adapters/EditorSource.java
Thu Oct 14 09:50:44 2010
@@ -32,6 +32,7 @@
* Create a new Editor.
*
* @param index the position at which the new Editor should be displayed
+ * @return an {...@link Editor} of type E
*/
public abstract E create(int index);
@@ -41,6 +42,7 @@
*
* @param count the number of Editors desired
* @param index the position at which the new Editors should be displayed
+ * @return a List of {...@link Editor}s of type E
*/
public List<E> create(int count, int index) {
List<E> toReturn = new ArrayList<E>(count);
@@ -54,7 +56,7 @@
* Called when an Editor no longer requires a sub-Editor. The default
* implementation is a no-op.
*
- * @param subEditor
+ * @param subEditor an {...@link Editor} of type E
*/
public void dispose(E subEditor) {
}
@@ -62,8 +64,8 @@
/**
* Re-order a sub-Editor. The default implementation is a no-op.
*
- * @param editor
- * @param index
+ * @param editor an {...@link Editor} of type E
+ * @param index the index of the Editor
*/
public void setIndex(E editor, int index) {
}
=======================================
--- /trunk/user/src/com/google/gwt/editor/client/adapters/ListEditor.java
Wed Oct 6 10:46:19 2010
+++ /trunk/user/src/com/google/gwt/editor/client/adapters/ListEditor.java
Thu Oct 14 09:50:44 2010
@@ -48,10 +48,20 @@
private EditorSource<E> editorSource;
private ListEditorWrapper<T, E> list;
+ /**
+ * Create a ListEditor backed by an EditorSource.
+ *
+ * @param source the EditorSource which will create sub-Editors
+ */
protected ListEditor(EditorSource<E> source) {
this.editorSource = source;
}
+ /**
+ * Creates a temporary sub-Editor to use for traversal.
+ *
+ * @return an {...@link Editor} of type E
+ */
public E createEditorForTraversal() {
E toReturn = editorSource.create(0);
editorSource.dispose(toReturn);
@@ -65,6 +75,8 @@
/**
* Returns an unmodifiable, live view of the Editors managed by the
* ListEditor.
+ *
+ * @return a List of {...@link Editor Editors} of type E
*/
public List<E> getEditors() {
if (list == null) {
@@ -85,6 +97,8 @@
* listEditor.getList().set(1, new Foo());
* listEditor.getEditors().get(1).getFooFieldEditor().setValue(....);
* </pre>
+ *
+ * @return a live view of the ListEditor's backing data
*/
public List<T> getList() {
return list;
@@ -104,6 +118,11 @@
this.chain = chain;
}
+ /**
+ * Sets the ListEditor's backing data.
+ *
+ * @param value a List of data objects of type T
+ */
public void setValue(List<T> value) {
if (list != null) {
// Having entire value reset, so dump the wrapper gracefully
=======================================
---
/trunk/user/src/com/google/gwt/editor/client/adapters/OptionalFieldEditor.java
Wed Oct 6 10:46:19 2010
+++
/trunk/user/src/com/google/gwt/editor/client/adapters/OptionalFieldEditor.java
Thu Oct 14 09:50:44 2010
@@ -59,10 +59,22 @@
private T currentValue;
private final E subEditor;
+ /**
+ * Construct an OptionalFieldEditor backed by the given sub-Editor.
+ *
+ * @param subEditor the sub-Editor that will be attached to the Editor
+ * hierarchy
+ */
protected OptionalFieldEditor(E subEditor) {
this.subEditor = subEditor;
}
+ /**
+ * Returns the sub-Editor that the OptionalFieldEditor was constructed
+ * with.
+ *
+ * @return an {...@link Editor} of type E
+ */
public E createEditorForTraversal() {
return subEditor;
}
=======================================
--- /trunk/user/src/com/google/gwt/editor/client/adapters/SimpleEditor.java
Thu Sep 9 11:46:06 2010
+++ /trunk/user/src/com/google/gwt/editor/client/adapters/SimpleEditor.java
Thu Oct 14 09:50:44 2010
@@ -25,7 +25,9 @@
*/
public class SimpleEditor<T> implements LeafValueEditor<T> {
/**
- * Returns a new ValueEditor that holds a <code>null</code> value.
+ * Returns a new ValueEditor that holds a {...@code null} value.
+ *
+ * @return a SimpleEditor instance holding a {...@code null} value
*/
public static <T> SimpleEditor<T> of() {
return new SimpleEditor<T>(null);
@@ -33,6 +35,9 @@
/**
* Returns a new ValueEditor that holds the given value.
+ *
+ * @param value a data object of type T
+ * @return a SimpleEditor instance holding the given value
*/
public static <T> SimpleEditor<T> of(T value) {
return new SimpleEditor<T>(value);
@@ -40,6 +45,11 @@
private T value;
+ /**
+ * Constructs a new SimpleEditor that holds the given value.
+ *
+ * @param value a data object of type T
+ */
protected SimpleEditor(T value) {
this.value = value;
}
=======================================
---
/trunk/user/src/com/google/gwt/editor/client/adapters/TakesValueEditor.java
Fri Sep 24 12:10:50 2010
+++
/trunk/user/src/com/google/gwt/editor/client/adapters/TakesValueEditor.java
Thu Oct 14 09:50:44 2010
@@ -24,13 +24,25 @@
* @param <T> the type of value to be edited
*/
public class TakesValueEditor<T> implements LeafValueEditor<T> {
-
+ /**
+ * Returns a new ValueEditor that modifies the given {...@link TakesValue}
peer
+ * instance.
+ *
+ * @param peer a {...@link TakesValue} instance
+ * @return a TakesValueEditor instance of the same type as its peer
+ */
public static <T> TakesValueEditor<T> of(TakesValue<T> peer) {
return new TakesValueEditor<T>(peer);
}
private final TakesValue<T> peer;
+ /**
+ * Returns a new ValueEditor that modifies the given {...@link TakesValue}
peer
+ * instance.
+ *
+ * @param peer a {...@link TakesValue} instance
+ */
protected TakesValueEditor(TakesValue<T> peer) {
this.peer = peer;
}
=======================================
---
/trunk/user/src/com/google/gwt/editor/ui/client/ValueBoxEditorDecorator.java
Tue Oct 5 17:59:14 2010
+++
/trunk/user/src/com/google/gwt/editor/ui/client/ValueBoxEditorDecorator.java
Thu Oct 14 09:50:44 2010
@@ -44,7 +44,7 @@
* For example:
* <pre>
* @UiField
- * ValueBoxEditorDecorator<String> name;
+ * ValueBoxEditorDecorator<String> name;
* </pre>
* <pre>
* <e:ValueBoxEditorDecorator ui:field='name'>
@@ -70,11 +70,21 @@
private ValueBoxEditor<T> editor;
+ /**
+ * Constructs a ValueBoxEditorDecorator.
+ */
@UiConstructor
public ValueBoxEditorDecorator() {
initWidget(Binder.BINDER.createAndBindUi(this));
}
+ /**
+ * Constructs a ValueBoxEditorDecorator using a {...@link ValueBoxBase}
+ * widget and a {...@link ValueBoxEditor} editor.
+ *
+ * @param widget the widget
+ * @param editor the editor
+ */
public ValueBoxEditorDecorator(ValueBoxBase<T> widget,
ValueBoxEditor<T> editor) {
this();
@@ -82,10 +92,22 @@
this.editor = editor;
}
+ /**
+ * Returns the associated {...@link ValueBoxEditor}.
+ *
+ * @return a {...@link ValueBoxEditor} instance
+ * @see #setEditor(ValueBoxEditor)
+ */
public ValueBoxEditor<T> asEditor() {
return editor;
}
+ /**
+ * Sets the associated {...@link ValueBoxEditor}.
+ *
+ * @param editor a {...@link ValueBoxEditor} instance
+ * @see #asEditor()
+ */
public void setEditor(ValueBoxEditor<T> editor) {
this.editor = editor;
}
@@ -93,6 +115,8 @@
/**
* Set the widget that the EditorPanel will display. This method will
* automatically call {...@link #setEditor}.
+ *
+ * @param widget a {...@link ValueBoxBase} widget
*/
@UiChild(limit = 1, tagname = "valuebox")
public void setValueBox(ValueBoxBase<T> widget) {
@@ -104,6 +128,8 @@
* The default implementation will display, but not consume, received
errors
* whose {...@link EditorError#getEditor() getEditor()} method returns the
Editor
* passed into {...@link #setEditor}.
+ *
+ * @param errors a List of {...@link EditorError} instances
*/
public void showErrors(List<EditorError> errors) {
StringBuilder sb = new StringBuilder();
=======================================
---
/trunk/user/src/com/google/gwt/editor/ui/client/adapters/HasTextEditor.java
Tue Oct 5 17:59:14 2010
+++
/trunk/user/src/com/google/gwt/editor/ui/client/adapters/HasTextEditor.java
Thu Oct 14 09:50:44 2010
@@ -22,12 +22,25 @@
* Adapts the HasText interface to the Editor framework.
*/
public class HasTextEditor implements LeafValueEditor<String> {
+ /**
+ * Returns a new ValueEditor that that modifies the given {...@link
HasText} peer
+ * instance.
+ *
+ * @param peer a {...@link HasText} instance
+ * @return a HasTextEditor instance
+ */
public static HasTextEditor of(HasText peer) {
return new HasTextEditor(peer);
}
private HasText peer;
+ /**
+ * Constructs a new HasTextEditor that that modifies the given {...@link
HasText}
+ * peer instance.
+ *
+ * @param peer a {...@link HasText} instance
+ */
protected HasTextEditor(HasText peer) {
this.peer = peer;
}
=======================================
---
/trunk/user/src/com/google/gwt/editor/ui/client/adapters/ValueBoxEditor.java
Tue Oct 5 17:59:14 2010
+++
/trunk/user/src/com/google/gwt/editor/ui/client/adapters/ValueBoxEditor.java
Thu Oct 14 09:50:44 2010
@@ -32,6 +32,14 @@
public class ValueBoxEditor<T> extends TakesValueEditor<T> implements
HasEditorDelegate<T> {
+ /**
+ * Returns a new TakesValueEditor that adapts a {...@link ValueBoxBase}
+ * instance.
+ *
+ * @param valueBox a {...@link ValueBoxBase} instance to adapt
+ * @return a ValueBoxEditor instance of the same type as the
+ * adapted {...@link ValueBoxBase} instance
+ */
public static <T> ValueBoxEditor<T> of(ValueBoxBase<T> valueBox) {
return new ValueBoxEditor<T>(valueBox);
}
@@ -40,11 +48,23 @@
private final ValueBoxBase<T> peer;
private T value;
+ /**
+ * Constructs a new ValueBoxEditor that adapts a {...@link ValueBoxBase}
peer
+ * instance.
+ *
+ * @param peer a {...@link ValueBoxBase} instance of type T
+ */
protected ValueBoxEditor(ValueBoxBase<T> peer) {
super(peer);
this.peer = peer;
}
+ /**
+ * Returns the {...@link EditorDelegate} for this instance.
+ *
+ * @return an {...@link EditorDelegate}, or {...@code null}
+ * @see #setDelegate(EditorDelegate)
+ */
public EditorDelegate<T> getDelegate() {
return delegate;
}
@@ -54,6 +74,9 @@
* is thrown, it will be available through
* {...@link com.google.gwt.editor.client.EditorError#getUserData()
* EditorError.getUserData()}.
+ *
+ * @return a value of type T
+ * @see #setValue(Object)
*/
@Override
public T getValue() {
@@ -67,6 +90,13 @@
return value;
}
+ /**
+ * Sets the {...@link EditorDelegate} for this instance. This method is only
+ * called by the driver.
+ *
+ * @param delegate an {...@link EditorDelegate}, or {...@code null}
+ * @see #getDelegate()
+ */
public void setDelegate(EditorDelegate<T> delegate) {
this.delegate = delegate;
}
=======================================
--- /trunk/user/src/com/google/gwt/user/client/TakesValue.java Wed Sep 1
14:06:53 2010
+++ /trunk/user/src/com/google/gwt/user/client/TakesValue.java Thu Oct 14
09:50:44 2010
@@ -23,11 +23,17 @@
public interface TakesValue<V> {
/**
* Sets the value.
+ *
+ * @param value a value object of type V
+ * @see #getValue()
*/
void setValue(V value);
/**
* Returns the current value.
+ *
+ * @return the value as an object of type V
+ * @see #setValue
*/
V getValue();
}
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors