From eef6af3029923b6ad9076e264394bfa8b9b4b789 Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Thu, 13 Sep 2012 11:02:13 +0300 Subject: Ensures negative height is not returned in HorizontalLayout height calculations #9596 --- 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 a7b3d5a281..5e6700b425 100644 --- a/shared/src/com/vaadin/shared/ui/ComponentStateUtil.java +++ b/shared/src/com/vaadin/shared/ui/ComponentStateUtil.java @@ -26,6 +26,14 @@ public final class ComponentStateUtil { return state.styles != null && !state.styles.isEmpty(); } + public static final boolean isRelativeWidth(ComponentState state) { + return state.width != null && state.width.endsWith("%"); + } + + public static final boolean isRelativeHeight(ComponentState state) { + return state.height != null && state.height.endsWith("%"); + } + /** * Removes an event listener id. * -- cgit v1.2.3