summaryrefslogtreecommitdiffstats
path: root/shared/src/com/vaadin
diff options
context:
space:
mode:
authorJohn Ahlroos <john@vaadin.com>2012-08-31 16:13:40 +0300
committerJohn Ahlroos <john@vaadin.com>2012-08-31 16:13:40 +0300
commit5abe444f28b89cc6c06cc178912a8fa3e03107c9 (patch)
tree15c67af25779901648e8440302dd75b1f76a2ebd /shared/src/com/vaadin
parent4e7104a68bafa96455518f006ad1ee310e185cd8 (diff)
downloadvaadin-framework-5abe444f28b89cc6c06cc178912a8fa3e03107c9.tar.gz
vaadin-framework-5abe444f28b89cc6c06cc178912a8fa3e03107c9.zip
Add helper methods for checking state
Diffstat (limited to 'shared/src/com/vaadin')
-rw-r--r--shared/src/com/vaadin/shared/ui/ComponentStateUtil.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/shared/src/com/vaadin/shared/ui/ComponentStateUtil.java b/shared/src/com/vaadin/shared/ui/ComponentStateUtil.java
index 556c46518f..dd2611f04b 100644
--- a/shared/src/com/vaadin/shared/ui/ComponentStateUtil.java
+++ b/shared/src/com/vaadin/shared/ui/ComponentStateUtil.java
@@ -18,6 +18,14 @@ public final class ComponentStateUtil {
return state.height == null || "".equals(state.height);
}
+ public static final boolean hasDescription(ComponentState state) {
+ return state.description != null && !"".equals(state.description);
+ }
+
+ public static final boolean hasStyles(ComponentState state) {
+ return state.styles != null && !state.styles.isEmpty();
+ }
+
/**
* Removes an event listener id.
*