diff options
Diffstat (limited to 'src/com/vaadin/shared/ComponentState.java')
-rw-r--r-- | src/com/vaadin/shared/ComponentState.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/com/vaadin/shared/ComponentState.java b/src/com/vaadin/shared/ComponentState.java index a3d22e55bc..c4269de676 100644 --- a/src/com/vaadin/shared/ComponentState.java +++ b/src/com/vaadin/shared/ComponentState.java @@ -81,6 +81,16 @@ public class ComponentState extends SharedState { } /** + * Returns true if the component height is relative to the parent, i.e. + * percentage, false if it is fixed/auto. + * + * @return true if component height is relative (percentage) + */ + public boolean isRelativeHeight() { + return getHeight().endsWith("%"); + } + + /** * Returns the component width as set by the server. * * Can be relative (containing the percent sign) or absolute, or empty @@ -119,6 +129,16 @@ public class ComponentState extends SharedState { } /** + * Returns true if the component width is relative to the parent, i.e. + * percentage, false if it is fixed/auto. + * + * @return true if component width is relative (percentage) + */ + public boolean isRelativeWidth() { + return getWidth().endsWith("%"); + } + + /** * Returns true if the component is in read-only mode. * * @see com.vaadin.ui.Component#isReadOnly() |