aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/src/com/vaadin/ui/declarative/Design.java46
-rw-r--r--server/src/com/vaadin/ui/declarative/DesignAttributeHandler.java6
-rw-r--r--server/src/com/vaadin/ui/declarative/FieldBinder.java15
3 files changed, 39 insertions, 28 deletions
diff --git a/server/src/com/vaadin/ui/declarative/Design.java b/server/src/com/vaadin/ui/declarative/Design.java
index 9122e82721..cd9a21bc15 100644
--- a/server/src/com/vaadin/ui/declarative/Design.java
+++ b/server/src/com/vaadin/ui/declarative/Design.java
@@ -40,10 +40,18 @@ import com.vaadin.ui.declarative.DesignContext.ComponentCreationListener;
/**
* Design is used for reading a component hierarchy from an html string or input
* stream and, conversely, for writing an html representation corresponding to a
- * given component hierarchy. The component hierarchy must contain one root
- * component. An empty component hierarchy can be represented using null as the
- * root node.
+ * given component hierarchy.
*
+ * <p>
+ * In html form a valid nonempty component hierarchy contains a single root
+ * element located under the &lt;body&gt; tag. A hierarchy of components is
+ * achieved by nesting other elements under the root element. An empty component
+ * hierarchy is represented as no elements under the &lt;body&gt; tag.
+ *
+ * <p>
+ * For writing a component hierarchy the root element is specified as a
+ * Component parameter or as a DesignContext object containing the root
+ * Component. An empty hierarchy can be written by giving a null root Component.
*
* @since 7.4
* @author Vaadin Ltd
@@ -70,12 +78,12 @@ public class Design implements Serializable {
/**
* Constructs a component hierarchy from the design specified as an html
* document. The hierarchy must contain at most one top-level component,
- * which should be located under <body>. Also invalid html containing the
- * hierarchy without <html>, <head> and <body> tags is accepted. You can
- * optionally pass instance for the root component with some uninitialized
- * instance fields. The fields will be automatically populated when parsing
- * the design based on the component ids, local ids, and captions of the
- * components in the design.
+ * which should be located under &lt;body&gt;. Also invalid html containing
+ * the hierarchy without &lt;html&gt;, &lt;head&gt; and &lt;body&gt; tags is
+ * accepted. You can optionally pass an instance for the root component with
+ * some uninitialized instance fields. The fields will be automatically
+ * populated when parsing the design based on the component ids, local ids,
+ * and captions of the components in the design.
*
* @param html
* the html document describing the component design
@@ -96,12 +104,13 @@ public class Design implements Serializable {
/**
* Constructs a component hierarchy from the design specified as an html
* document given as a string. The hierarchy must contain at most one
- * top-level component, which should be located under <body>. Also invalid
- * html containing the hierarchy without <html>, <head> and <body> tags is
- * accepted. You can optionally pass instance for the root component with
- * some uninitialized instance fields. The fields will be automatically
- * populated when parsing the design based on the component ids, local ids,
- * and captions of the components in the design.
+ * top-level component, which should be located under &lt;body&gt;. Also
+ * invalid html containing the hierarchy without &lt;html&gt;, &lt;head&gt;
+ * and &lt;body&gt; tags is accepted. You can optionally pass an instance
+ * for the root component with some uninitialized instance fields. The
+ * fields will be automatically populated when parsing the design based on
+ * the component ids, local ids, and captions of the components in the
+ * design.
*
* @param html
* the html document describing the component design
@@ -123,6 +132,7 @@ public class Design implements Serializable {
* Constructs a component hierarchy from the design specified as an html
* tree.
*
+ * <p>
* If a component root is given, the component instances created during
* reading the design are assigned to its member fields based on their id,
* local id, and caption
@@ -150,6 +160,7 @@ public class Design implements Serializable {
* Constructs a component hierarchy from the design specified as an html
* tree.
*
+ * <p>
* If a component root is given, the component instances created during
* reading the design are assigned to its member fields based on their id,
* local id, and caption
@@ -220,7 +231,8 @@ public class Design implements Serializable {
/**
* Generates an html tree representation of the component hierarchy having
* the root designContext.getRootComponent(). The hierarchy is stored under
- * <body> in the tree. The generated tree represents a valid html document.
+ * &lt;body&gt; in the tree. The generated tree represents a valid html
+ * document.
*
*
* @param designContext
@@ -466,4 +478,4 @@ public class Design implements Serializable {
outputStream.write(doc.html().getBytes());
}
-} \ No newline at end of file
+}
diff --git a/server/src/com/vaadin/ui/declarative/DesignAttributeHandler.java b/server/src/com/vaadin/ui/declarative/DesignAttributeHandler.java
index 7c106cec44..fbfe024c00 100644
--- a/server/src/com/vaadin/ui/declarative/DesignAttributeHandler.java
+++ b/server/src/com/vaadin/ui/declarative/DesignAttributeHandler.java
@@ -232,7 +232,7 @@ public class DesignAttributeHandler implements Serializable {
}
/**
- * Reads the given attribute from attributes.
+ * Reads the given attribute from a set of attributes.
*
* @param attribute
* the attribute key
@@ -264,8 +264,8 @@ public class DesignAttributeHandler implements Serializable {
}
/**
- * Writes the given attribute value to attributes if it differs from the
- * default attribute value.
+ * Writes the given attribute value to a set of attributes if it differs
+ * from the default attribute value.
*
* @param attribute
* the attribute key
diff --git a/server/src/com/vaadin/ui/declarative/FieldBinder.java b/server/src/com/vaadin/ui/declarative/FieldBinder.java
index fcc78db414..bd906682fa 100644
--- a/server/src/com/vaadin/ui/declarative/FieldBinder.java
+++ b/server/src/com/vaadin/ui/declarative/FieldBinder.java
@@ -107,7 +107,7 @@ public class FieldBinder implements Serializable {
* Resolves the fields of the design class instance.
*/
private void resolveFields(Class<?> classWithFields) {
- for (Field memberField : getFieldsInDeclareOrder(classWithFields)) {
+ for (Field memberField : getFields(classWithFields)) {
if (Component.class.isAssignableFrom(memberField.getType())) {
fieldMap.put(memberField.getName().toLowerCase(Locale.ENGLISH),
memberField);
@@ -240,23 +240,22 @@ public class FieldBinder implements Serializable {
/**
* Returns a list containing Field objects reflecting all the fields of the
- * class or interface represented by this Class object. The elements in the
- * returned list are sorted in declare order. The fields in superclasses are
- * excluded.
+ * class or interface represented by this Class object. The fields in
+ * superclasses are excluded.
*
* @param searchClass
* the class to be scanned for fields
* @return the list of fields in this class
*/
- protected static List<java.lang.reflect.Field> getFieldsInDeclareOrder(
+ protected static List<java.lang.reflect.Field> getFields(
Class<?> searchClass) {
- ArrayList<java.lang.reflect.Field> memberFieldsInOrder = new ArrayList<java.lang.reflect.Field>();
+ ArrayList<java.lang.reflect.Field> memberFields = new ArrayList<java.lang.reflect.Field>();
for (java.lang.reflect.Field memberField : searchClass
.getDeclaredFields()) {
- memberFieldsInOrder.add(memberField);
+ memberFields.add(memberField);
}
- return memberFieldsInOrder;
+ return memberFields;
}
private static Logger getLogger() {