diff options
author | John Ahlroos <john@vaadin.com> | 2014-04-04 09:48:37 +0300 |
---|---|---|
committer | Jonatan Kronqvist <jonatan@vaadin.com> | 2014-05-21 06:29:44 +0000 |
commit | b179103e8fd82d8b67d87799290e2d5f6aa62ff1 (patch) | |
tree | a42c1d1ce0744fcc63a9eec4f66d38d92d87add6 /server/src/com | |
parent | cc5c5af189c0eb16257cdbe0374374c159b67560 (diff) | |
download | vaadin-framework-b179103e8fd82d8b67d87799290e2d5f6aa62ff1.tar.gz vaadin-framework-b179103e8fd82d8b67d87799290e2d5f6aa62ff1.zip |
Adds methods for setting only width or height undefined #13546
Change-Id: Ieebe48c75370c0744a2a2619e1ed81dbd090a544
Diffstat (limited to 'server/src/com')
-rw-r--r-- | server/src/com/vaadin/server/Sizeable.java | 20 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/AbstractComponent.java | 20 |
2 files changed, 40 insertions, 0 deletions
diff --git a/server/src/com/vaadin/server/Sizeable.java b/server/src/com/vaadin/server/Sizeable.java index 5a4704ba2a..ede5e6ab3b 100644 --- a/server/src/com/vaadin/server/Sizeable.java +++ b/server/src/com/vaadin/server/Sizeable.java @@ -81,6 +81,12 @@ public interface Sizeable extends Serializable { @Deprecated public static final Unit UNITS_PERCENTAGE = Unit.PERCENTAGE; + /** + * @deprecated As of 7.3, use instead {@link #setSizeUndefined()}, + * {@link #setHeightUndefined()} and + * {@link #setWidthUndefined()} + */ + @Deprecated public static final float SIZE_UNDEFINED = -1; public enum Unit { @@ -253,4 +259,18 @@ public interface Sizeable extends Serializable { */ public void setSizeUndefined(); + /** + * Clears any defined width + * + * @since 7.3 + */ + public void setWidthUndefined(); + + /** + * Clears any defined height + * + * @since 7.3 + */ + public void setHeightUndefined(); + } diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java index d0406c3eb7..d980c27916 100644 --- a/server/src/com/vaadin/ui/AbstractComponent.java +++ b/server/src/com/vaadin/ui/AbstractComponent.java @@ -825,7 +825,27 @@ public abstract class AbstractComponent extends AbstractClientConnector */ @Override public void setSizeUndefined() { + setWidthUndefined(); + setHeightUndefined(); + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.server.Sizeable#setWidthUndefined() + */ + @Override + public void setWidthUndefined() { setWidth(-1, Unit.PIXELS); + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.server.Sizeable#setHeightUndefined() + */ + @Override + public void setHeightUndefined() { setHeight(-1, Unit.PIXELS); } |