diff options
author | Pekka Hyvönen <pekka@vaadin.com> | 2017-01-05 18:09:32 +0200 |
---|---|---|
committer | Ilia Motornyi <elmot@vaadin.com> | 2017-01-05 18:09:32 +0200 |
commit | 4130f1d87d6ab387a363a4e44e8746eddc049d13 (patch) | |
tree | 0a6cb8b997f95c710dbac269bfba3615eb74df6a /uitest | |
parent | 11f10b827e92ed7c07d6584a181f7f1374e8109b (diff) | |
download | vaadin-framework-4130f1d87d6ab387a363a4e44e8746eddc049d13.tar.gz vaadin-framework-4130f1d87d6ab387a363a4e44e8746eddc049d13.zip |
Update component docs for 8 except Grid
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/components/customfield/BooleanField.java | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/customfield/BooleanField.java b/uitest/src/main/java/com/vaadin/tests/components/customfield/BooleanField.java index 355ba50143..44c780bdd3 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/customfield/BooleanField.java +++ b/uitest/src/main/java/com/vaadin/tests/components/customfield/BooleanField.java @@ -12,24 +12,20 @@ import com.vaadin.ui.VerticalLayout; * structures. Here, the commit etc. logic is not overridden. */ public class BooleanField extends CustomField<Boolean> { - + private final Button button = new Button("Off"); private boolean value; @Override protected Component initContent() { - VerticalLayout layout = new VerticalLayout(); - - layout.addComponent(new Label("Please click the button")); - - final Button button = new Button("Click me"); button.addClickListener(event -> { setValue(!getValue()); button.setCaption(getValue() ? "On" : "Off"); }); - layout.addComponent(button); + VerticalLayout layout = new VerticalLayout(); + layout.addComponent(new Label("Please click the button")); + layout.addComponent(button); return layout; - } @Override @@ -40,5 +36,6 @@ public class BooleanField extends CustomField<Boolean> { @Override protected void doSetValue(Boolean value) { this.value = value; + button.setCaption(value ? "On" : "Off"); } } |