diff options
author | Knoobie <Knoobie@gmx.de> | 2018-12-18 14:29:59 +0100 |
---|---|---|
committer | Sun Zhe <31067185+ZheSun88@users.noreply.github.com> | 2018-12-18 15:29:59 +0200 |
commit | 353ba29cfdefddb032122cbeae5f02f6d9de76ba (patch) | |
tree | 05ee1da595faaab05976e9ab339472799648135b /shared/src/main/java/com | |
parent | 9c9c962549eb04adac87b0cfe26d24b17843fb6a (diff) | |
download | vaadin-framework-353ba29cfdefddb032122cbeae5f02f6d9de76ba.tar.gz vaadin-framework-353ba29cfdefddb032122cbeae5f02f6d9de76ba.zip |
Checkbox allow customizing of input and label classNames. (#11372)
* add client side integration for custom styles for checkbox.label and checkbox.input
* add server side integration for checkbox element styling
* add server side tests
* add client side test
Diffstat (limited to 'shared/src/main/java/com')
-rw-r--r-- | shared/src/main/java/com/vaadin/shared/ui/ComponentStateUtil.java | 7 | ||||
-rw-r--r-- | shared/src/main/java/com/vaadin/shared/ui/checkbox/CheckBoxState.java | 4 |
2 files changed, 10 insertions, 1 deletions
diff --git a/shared/src/main/java/com/vaadin/shared/ui/ComponentStateUtil.java b/shared/src/main/java/com/vaadin/shared/ui/ComponentStateUtil.java index 494af9151d..3daa91d436 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/ComponentStateUtil.java +++ b/shared/src/main/java/com/vaadin/shared/ui/ComponentStateUtil.java @@ -17,6 +17,7 @@ package com.vaadin.shared.ui; import java.io.Serializable; import java.util.HashSet; +import java.util.List; import com.vaadin.shared.AbstractComponentState; import com.vaadin.shared.Registration; @@ -42,7 +43,11 @@ public final class ComponentStateUtil implements Serializable { } public static final boolean hasStyles(AbstractComponentState state) { - return state.styles != null && !state.styles.isEmpty(); + return hasStyles(state.styles); + } + + public static final boolean hasStyles(List<String> styles) { + return styles != null && !styles.isEmpty(); } public static final boolean isRelativeWidth(AbstractComponentState state) { diff --git a/shared/src/main/java/com/vaadin/shared/ui/checkbox/CheckBoxState.java b/shared/src/main/java/com/vaadin/shared/ui/checkbox/CheckBoxState.java index c3e4c29c83..2a35a23726 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/checkbox/CheckBoxState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/checkbox/CheckBoxState.java @@ -17,10 +17,14 @@ package com.vaadin.shared.ui.checkbox; import com.vaadin.shared.AbstractFieldState; +import java.util.List; + public class CheckBoxState extends AbstractFieldState { { primaryStyleName = "v-checkbox"; } public boolean checked = false; + public List<String> inputStyles = null; + public List<String> labelStyles = null; } |