]> source.dussan.org Git - vaadin-framework.git/commitdiff
Javadocced set-method deprecation; Fixes #2023.
authorMarc Englund <marc.englund@itmill.com>
Mon, 8 Sep 2008 08:07:08 +0000 (08:07 +0000)
committerMarc Englund <marc.englund@itmill.com>
Mon, 8 Sep 2008 08:07:08 +0000 (08:07 +0000)
svn changeset:5366/svn branch:trunk

src/com/itmill/toolkit/terminal/Sizeable.java
src/com/itmill/toolkit/ui/AbstractComponent.java

index cabb2a65aba60b0b9f46ec9464d456249d0e960a..d11b041e839fc24a4588a6ff3c822c19621f2b6b 100644 (file)
@@ -174,6 +174,9 @@ public interface Sizeable {
      * String presentation is similar to what is used in Cascading Style Sheets.
      * Size can be length or percentage of available size.
      * 
+     * The empty string ("") or null will unset the height and set the units to
+     * pixels.
+     * 
      * See <a
      * href="http://www.w3.org/TR/REC-CSS2/syndata.html#value-def-length">CSS
      * specification</a> for more details.
@@ -189,12 +192,16 @@ public interface Sizeable {
      * String presentation is similar to what is used in Cascading Style Sheets.
      * Size can be length or percentage of available size.
      * 
+     * The empty string ("") or null will unset the width and set the units to
+     * pixels.
+     * 
      * See <a
      * href="http://www.w3.org/TR/REC-CSS2/syndata.html#value-def-length">CSS
      * specification</a> for more details.
      * 
      * @param width
-     *            in CSS style string representation
+     *            in CSS style string representation, null or empty string to
+     *            reset
      */
     public void setWidth(String width);
 
index d39cf17ab2e0c34f8be4ec3f6e9723d700cc3629..f298472a206756f82f930fe7ff6c9db8422fc72f 100644 (file)
@@ -21,6 +21,7 @@ import com.itmill.toolkit.terminal.ErrorMessage;
 import com.itmill.toolkit.terminal.PaintException;
 import com.itmill.toolkit.terminal.PaintTarget;
 import com.itmill.toolkit.terminal.Resource;
+import com.itmill.toolkit.terminal.Sizeable;
 import com.itmill.toolkit.terminal.Terminal;
 
 /**
@@ -1059,11 +1060,16 @@ public abstract class AbstractComponent implements Component, MethodEventSource
         return widthUnit;
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * Sets the height without setting the height unit.
      * 
-     * @see com.itmill.toolkit.terminal.Sizeable#setHeight(int)
+     * @see link {@link Sizeable#setHeight(int)}
+     * @see link {@link Sizeable#setHeight(String)}
+     * @see link {@link Sizeable#setHeightUnits(int)}
+     * @deprecated Error-prone; consider using {link {@link #setHeight(String)}
+     *             or {link {@link #setHeight(int, int)} instead.
      */
+
     public void setHeight(int height) {
         this.height = height;
         requestRepaint();
@@ -1110,10 +1116,14 @@ public abstract class AbstractComponent implements Component, MethodEventSource
         requestRepaint();
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * Sets the width without setting the width unit.
      * 
-     * @see com.itmill.toolkit.terminal.Sizeable#setWidth(int)
+     * @see link {@link Sizeable#setWidth(int)}
+     * @see link {@link Sizeable#setWidth(String)}
+     * @see link {@link Sizeable#setWidthUnits(int)}
+     * @deprecated Error-prone; consider using {link {@link #setWidth(String)}
+     *             or {link {@link #setWidth(int, int)} instead.
      */
     public void setWidth(int width) {
         this.width = width;
@@ -1149,10 +1159,10 @@ public abstract class AbstractComponent implements Component, MethodEventSource
 
     /*
      * Returns array with size in index 0 unit in index 1. Null or empty string
-     * will produce {-1,-1}
+     * will produce {-1,UNITS_PIXELS}
      */
     private static int[] parseStringSize(String s) {
-        int[] values = { -1, -1 };
+        int[] values = { -1, UNITS_PIXELS };
         if (s == null) {
             return values;
         }