From: John Ahlroos Date: Fri, 4 Apr 2014 06:48:37 +0000 (+0300) Subject: Adds methods for setting only width or height undefined #13546 X-Git-Tag: 7.4.0.alpha2~10^2~18 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b179103e8fd82d8b67d87799290e2d5f6aa62ff1;p=vaadin-framework.git Adds methods for setting only width or height undefined #13546 Change-Id: Ieebe48c75370c0744a2a2619e1ed81dbd090a544 --- 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); }