From: Henri Sara Date: Thu, 22 Dec 2011 08:15:17 +0000 (+0200) Subject: Rename CustomField.createContent() to initContent() (#3718). X-Git-Tag: 7.0.0.alpha1~37 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=23f1fbcfab82d7f0bf60ea0b71e085f9b36397cb;p=vaadin-framework.git Rename CustomField.createContent() to initContent() (#3718). --- 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 + * field value type + * * @since 7.0 */ @ClientWidget(VCustomComponent.class) @@ -95,13 +98,13 @@ public abstract class CustomField extends AbstractField 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 extends AbstractField 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
{ } @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"));