aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2011-12-22 10:15:17 +0200
committerHenri Sara <hesara@vaadin.com>2011-12-22 10:15:17 +0200
commit23f1fbcfab82d7f0bf60ea0b71e085f9b36397cb (patch)
tree73f16c83d8a13d655e493925093bc0f67835b47c
parent12dab0adac3c05dc477522b1024108faf490453b (diff)
downloadvaadin-framework-23f1fbcfab82d7f0bf60ea0b71e085f9b36397cb.tar.gz
vaadin-framework-23f1fbcfab82d7f0bf60ea0b71e085f9b36397cb.zip
Rename CustomField.createContent() to initContent() (#3718).
-rw-r--r--src/com/vaadin/ui/CustomField.java15
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/AddressField.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/BooleanField.java2
3 files changed, 11 insertions, 8 deletions
diff --git a/src/com/vaadin/ui/CustomField.java b/src/com/vaadin/ui/CustomField.java
index ca075a6a6a..bb5f154f22 100644
--- a/src/com/vaadin/ui/CustomField.java
+++ b/src/com/vaadin/ui/CustomField.java
@@ -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) {
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/AddressField.java b/tests/testbench/com/vaadin/tests/components/customfield/AddressField.java
index 68f7baf5e9..654b4920ad 100644
--- a/tests/testbench/com/vaadin/tests/components/customfield/AddressField.java
+++ b/tests/testbench/com/vaadin/tests/components/customfield/AddressField.java
@@ -27,7 +27,7 @@ public class AddressField extends CustomField<Address> {
}
@Override
- protected Component createContent() {
+ protected Component initContent() {
if (parentForm != null) {
addressForm = new EmbeddedForm(parentForm);
} else {
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/BooleanField.java b/tests/testbench/com/vaadin/tests/components/customfield/BooleanField.java
index 196a04eb5e..94d25eb10e 100644
--- a/tests/testbench/com/vaadin/tests/components/customfield/BooleanField.java
+++ b/tests/testbench/com/vaadin/tests/components/customfield/BooleanField.java
@@ -16,7 +16,7 @@ import com.vaadin.ui.VerticalLayout;
public class BooleanField extends CustomField {
@Override
- protected Component createContent() {
+ protected Component initContent() {
VerticalLayout layout = new VerticalLayout();
layout.addComponent(new Label("Please click the button"));