From a50b5143598423724fda02788369b7eb0fb9fb30 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 22 Nov 2012 12:19:05 +0200 Subject: Deprecated setColumns in selects (#5814) Change-Id: Iada489b12b904d1a52d2e4633e4360d61b88a4af --- server/src/com/vaadin/ui/ListSelect.java | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'server/src/com/vaadin/ui/ListSelect.java') 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. + *

+ * Calling {@code setColumns(10);} is equivalent to calling + * {@code setWidth("10em");} + *

* + * @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; } -- cgit v1.2.3