diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2012-11-22 13:20:25 +0000 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2012-11-22 13:20:26 +0000 |
commit | f12124964300995e3cb7b953dafb6e80f08e6912 (patch) | |
tree | 21f879399803bdf10b8e0dce56d236987108cdaa /server/src/com | |
parent | a071e06d1e9d4db6e73390f2e2de897744632d61 (diff) | |
parent | a50b5143598423724fda02788369b7eb0fb9fb30 (diff) | |
download | vaadin-framework-f12124964300995e3cb7b953dafb6e80f08e6912.tar.gz vaadin-framework-f12124964300995e3cb7b953dafb6e80f08e6912.zip |
Merge "Deprecated setColumns in selects (#5814)"
Diffstat (limited to 'server/src/com')
-rw-r--r-- | server/src/com/vaadin/ui/ListSelect.java | 24 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/NativeSelect.java | 24 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/TwinColSelect.java | 26 |
3 files changed, 62 insertions, 12 deletions
diff --git a/server/src/com/vaadin/ui/ListSelect.java b/server/src/com/vaadin/ui/ListSelect.java index 90e1c16a4d..4ef013846c 100644 --- a/server/src/com/vaadin/ui/ListSelect.java +++ b/server/src/com/vaadin/ui/ListSelect.java @@ -49,13 +49,21 @@ public class ListSelect extends AbstractSelect { } /** - * Sets the number of columns in the editor. If the number of columns is set - * 0, the actual number of displayed columns is determined implicitly by the - * adapter. + * Sets the width of the component so that it can display approximately the + * given number of letters. + * <p> + * Calling {@code setColumns(10);} is equivalent to calling + * {@code setWidth("10em");} + * </p> * + * @deprecated As of 7.0. "Columns" does not reflect the exact number of + * characters that will be displayed. It is better to use + * setWidth together with "em" to control the width of the + * field. * @param columns * the number of columns to set. */ + @Deprecated public void setColumns(int columns) { if (columns < 0) { columns = 0; @@ -66,6 +74,16 @@ public class ListSelect extends AbstractSelect { } } + /** + * Gets the number of columns for the component. + * + * @see #setColumns(int) + * @deprecated As of 7.0. "Columns" does not reflect the exact number of + * characters that will be displayed. It is better to use + * setWidth together with "em" to control the width of the + * field. + */ + @Deprecated public int getColumns() { return columns; } diff --git a/server/src/com/vaadin/ui/NativeSelect.java b/server/src/com/vaadin/ui/NativeSelect.java index 8006813276..7b7bbb73b1 100644 --- a/server/src/com/vaadin/ui/NativeSelect.java +++ b/server/src/com/vaadin/ui/NativeSelect.java @@ -51,13 +51,21 @@ public class NativeSelect extends AbstractSelect { } /** - * Sets the number of columns in the editor. If the number of columns is set - * 0, the actual number of displayed columns is determined implicitly by the - * adapter. + * Sets the width of the component so that it can display approximately the + * given number of letters. + * <p> + * Calling {@code setColumns(10);} is equivalent to calling + * {@code setWidth("10em");} + * </p> * + * @deprecated As of 7.0. "Columns" does not reflect the exact number of + * characters that will be displayed. It is better to use + * setWidth together with "em" to control the width of the + * field. * @param columns * the number of columns to set. */ + @Deprecated public void setColumns(int columns) { if (columns < 0) { columns = 0; @@ -68,6 +76,16 @@ public class NativeSelect extends AbstractSelect { } } + /** + * Gets the number of columns for the component. + * + * @see #setColumns(int) + * @deprecated As of 7.0. "Columns" does not reflect the exact number of + * characters that will be displayed. It is better to use + * setWidth together with "em" to control the width of the + * field. + */ + @Deprecated public int getColumns() { return columns; } diff --git a/server/src/com/vaadin/ui/TwinColSelect.java b/server/src/com/vaadin/ui/TwinColSelect.java index 76f1e1e8c7..5e0204bdce 100644 --- a/server/src/com/vaadin/ui/TwinColSelect.java +++ b/server/src/com/vaadin/ui/TwinColSelect.java @@ -62,17 +62,21 @@ public class TwinColSelect extends AbstractSelect { } /** - * Sets the number of columns in the editor. If the number of columns is set - * 0, the actual number of displayed columns is determined implicitly by the - * adapter. + * Sets the width of the component so that it displays approximately the + * given number of letters in each of the two selects. * <p> - * The number of columns overrides the value set by setWidth. Only if - * columns are set to 0 (default) the width set using - * {@link #setWidth(float, int)} or {@link #setWidth(String)} is used. + * Calling {@code setColumns(10);} is roughly equivalent to calling + * {@code setWidth((10*2+4)+"10em");} + * </p> * + * @deprecated As of 7.0. "Columns" does not reflect the exact number of + * characters that will be displayed. It is better to use + * setWidth together with "em" to control the width of the + * field. * @param columns * the number of columns to set. */ + @Deprecated public void setColumns(int columns) { if (columns < 0) { columns = 0; @@ -83,6 +87,16 @@ public class TwinColSelect extends AbstractSelect { } } + /** + * Gets the number of columns for the component. + * + * @see #setColumns(int) + * @deprecated As of 7.0. "Columns" does not reflect the exact number of + * characters that will be displayed. It is better to use + * setWidth together with "em" to control the width of the + * field. + */ + @Deprecated public int getColumns() { return columns; } |