diff options
author | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2018-03-19 18:50:17 +0200 |
---|---|---|
committer | Ilia Motornyi <elmot@vaadin.com> | 2018-03-19 18:50:17 +0200 |
commit | 81f81fa3c41f1fc97a14b7f8d91cf6ea29af572b (patch) | |
tree | 5347a180628cf419250e32530a966f5366dddd8e /uitest/src/main/java/com | |
parent | 649f2f3eeae246e8f57e433c5fd3dcc8fe488d6c (diff) | |
download | vaadin-framework-81f81fa3c41f1fc97a14b7f8d91cf6ea29af572b.tar.gz vaadin-framework-81f81fa3c41f1fc97a14b7f8d91cf6ea29af572b.zip |
Fix initially disabled items in RadioButtonGroup (#10719)
Diffstat (limited to 'uitest/src/main/java/com')
2 files changed, 42 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/checkboxgroup/CheckBoxGroupItemDisabled.java b/uitest/src/main/java/com/vaadin/tests/components/checkboxgroup/CheckBoxGroupItemDisabled.java new file mode 100644 index 0000000000..d929b438ad --- /dev/null +++ b/uitest/src/main/java/com/vaadin/tests/components/checkboxgroup/CheckBoxGroupItemDisabled.java @@ -0,0 +1,21 @@ +package com.vaadin.tests.components.checkboxgroup; + +import com.vaadin.annotations.Widgetset; +import com.vaadin.server.SerializablePredicate; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.CheckBoxGroup; + +@Widgetset("com.vaadin.DefaultWidgetSet") +public class CheckBoxGroupItemDisabled extends AbstractTestUI { + + public static final SerializablePredicate<Integer> ENABLED_PROVIDER = i -> i != 3; + + @Override + protected void setup(VaadinRequest request) { + CheckBoxGroup<Integer> cbg = new CheckBoxGroup<>(); + cbg.setItems(1, 2, 3, 4); + cbg.setItemEnabledProvider(ENABLED_PROVIDER); + addComponent(cbg); + } +} diff --git a/uitest/src/main/java/com/vaadin/tests/components/radiobuttongroup/RadioButtonGroupItemDisabled.java b/uitest/src/main/java/com/vaadin/tests/components/radiobuttongroup/RadioButtonGroupItemDisabled.java new file mode 100644 index 0000000000..5a3a4674e4 --- /dev/null +++ b/uitest/src/main/java/com/vaadin/tests/components/radiobuttongroup/RadioButtonGroupItemDisabled.java @@ -0,0 +1,21 @@ +package com.vaadin.tests.components.radiobuttongroup; + +import com.vaadin.annotations.Widgetset; +import com.vaadin.server.SerializablePredicate; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.RadioButtonGroup; + +@Widgetset("com.vaadin.DefaultWidgetSet") +public class RadioButtonGroupItemDisabled extends AbstractTestUI { + + public static final SerializablePredicate<Integer> ENABLED_PROVIDER = i -> i != 3; + + @Override + protected void setup(VaadinRequest request) { + RadioButtonGroup<Integer> rbg = new RadioButtonGroup<>(); + rbg.setItems(1, 2, 3, 4); + rbg.setItemEnabledProvider(ENABLED_PROVIDER); + addComponent(rbg); + } +}
\ No newline at end of file |