]> source.dussan.org Git - vaadin-framework.git/commitdiff
Rename CustomField.createContent() to initContent() (#3718).
authorHenri Sara <hesara@vaadin.com>
Thu, 22 Dec 2011 08:15:17 +0000 (10:15 +0200)
committerHenri Sara <hesara@vaadin.com>
Thu, 22 Dec 2011 08:15:17 +0000 (10:15 +0200)
src/com/vaadin/ui/CustomField.java
tests/testbench/com/vaadin/tests/components/customfield/AddressField.java
tests/testbench/com/vaadin/tests/components/customfield/BooleanField.java

index ca075a6a6af29270a200fc3d1c6d0564e5bb80fa..bb5f154f22e7bcdbdb03abce2bede35c13ae85f7 100644 (file)
@@ -18,7 +18,7 @@ import com.vaadin.terminal.gwt.client.ui.VCustomComponent;
  * creation of e.g. form fields by composing Vaadin components. Customization of
  * both the visual presentation and the logic of the field is possible.
  * 
- * Subclasses must implement {@link #getType()} and {@link #createContent()}.
+ * Subclasses must implement {@link #getType()} and {@link #initContent()}.
  * 
  * Most custom fields can simply compose a user interface that calls the methods
  * {@link #setInternalValue(Object)} and {@link #getInternalValue()} when
@@ -30,6 +30,9 @@ import com.vaadin.terminal.gwt.client.ui.VCustomComponent;
  * of the field. Methods overriding {@link #setInternalValue(Object)} should
  * also call the corresponding superclass method.
  * 
+ * @param <T>
+ *            field value type
+ * 
  * @since 7.0
  */
 @ClientWidget(VCustomComponent.class)
@@ -95,13 +98,13 @@ public abstract class CustomField<T> extends AbstractField<T> implements
     }
 
     /**
-     * Returns the content of the
+     * Returns the content (UI) of the custom component.
      * 
-     * @return
+     * @return Component
      */
     protected Component getContent() {
         if (null == root) {
-            root = createContent();
+            root = initContent();
         }
         return root;
     }
@@ -114,9 +117,9 @@ public abstract class CustomField<T> extends AbstractField<T> implements
      * layout or when {@link #getContent()} is called explicitly for the first
      * time. It is only called once for a {@link CustomField}.
      * 
-     * @return
+     * @return {@link Component} representing the UI of the CustomField
      */
-    protected abstract Component createContent();
+    protected abstract Component initContent();
 
     private void requestContentRepaint() {
         if (getParent() == null) {
index 68f7baf5e92e171353f4012f157767101bf69853..654b4920ada1683de35842c8a124893741664d9f 100644 (file)
@@ -27,7 +27,7 @@ public class AddressField extends CustomField<Address> {
     }\r
 \r
     @Override\r
-    protected Component createContent() {\r
+    protected Component initContent() {\r
         if (parentForm != null) {\r
             addressForm = new EmbeddedForm(parentForm);\r
         } else {\r
index 196a04eb5e1aa300e9c6b28430315e6d7a60915f..94d25eb10edd2f72e9857cfcdee1faffef4233de 100644 (file)
@@ -16,7 +16,7 @@ import com.vaadin.ui.VerticalLayout;
 public class BooleanField extends CustomField {\r
 \r
     @Override\r
-    protected Component createContent() {\r
+    protected Component initContent() {\r
         VerticalLayout layout = new VerticalLayout();\r
 \r
         layout.addComponent(new Label("Please click the button"));\r