From 5abe444f28b89cc6c06cc178912a8fa3e03107c9 Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Fri, 31 Aug 2012 16:13:40 +0300 Subject: Add helper methods for checking state --- shared/src/com/vaadin/shared/ui/ComponentStateUtil.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'shared') 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. * -- cgit v1.2.3