]> source.dussan.org Git - vaadin-framework.git/commitdiff
Adds methods for setting only width or height undefined #13546
authorJohn Ahlroos <john@vaadin.com>
Fri, 4 Apr 2014 06:48:37 +0000 (09:48 +0300)
committerJonatan Kronqvist <jonatan@vaadin.com>
Wed, 21 May 2014 06:29:44 +0000 (06:29 +0000)
Change-Id: Ieebe48c75370c0744a2a2619e1ed81dbd090a544

server/src/com/vaadin/server/Sizeable.java
server/src/com/vaadin/ui/AbstractComponent.java

index 5a4704ba2a45bfd5174e6bcd963d849b59abcff4..ede5e6ab3bc1dc2b44d2f3c87ba4b02c20a23455 100644 (file)
@@ -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();
+
 }
index d0406c3eb7b79ea2c4b8ef6a7dcbf18aaa63effc..d980c2791676991c1e88a97c995d8b3003b74a2c 100644 (file)
@@ -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);
     }