From 0f5284bb827b5f04c6c064c851b851604293665a Mon Sep 17 00:00:00 2001 From: Pekka Hyvönen Date: Mon, 10 Sep 2012 22:12:47 +0300 Subject: Constants -> enums (#9072) Patch from Pekka with minor changes (ButtonCode -> MouseButton, FilteringMode -> ComboBox) --- server/src/com/vaadin/ui/AbstractSelect.java | 45 ++++++++++++++-------------- 1 file changed, 22 insertions(+), 23 deletions(-) (limited to 'server/src/com/vaadin/ui/AbstractSelect.java') diff --git a/server/src/com/vaadin/ui/AbstractSelect.java b/server/src/com/vaadin/ui/AbstractSelect.java index 4de3f90d15..45df42a9be 100644 --- a/server/src/com/vaadin/ui/AbstractSelect.java +++ b/server/src/com/vaadin/ui/AbstractSelect.java @@ -45,6 +45,7 @@ import com.vaadin.server.LegacyComponent; import com.vaadin.server.PaintException; import com.vaadin.server.PaintTarget; import com.vaadin.server.Resource; +import com.vaadin.shared.ui.combobox.FilteringMode; import com.vaadin.shared.ui.dd.VerticalDropLocation; /** @@ -154,15 +155,28 @@ public abstract class AbstractSelect extends AbstractField implements /** * Interface for option filtering, used to filter options based on user * entered value. The value is matched to the item caption. - * FILTERINGMODE_OFF (0) turns the filtering off. - * FILTERINGMODE_STARTSWITH (1) matches from the start of the - * caption. FILTERINGMODE_CONTAINS (1) matches anywhere in the + * FilteringMode.OFF (0) turns the filtering off. + * FilteringMode.STARTSWITH (1) matches from the start of the + * caption. FilteringMode.CONTAINS (1) matches anywhere in the * caption. */ public interface Filtering extends Serializable { - public static final int FILTERINGMODE_OFF = 0; - public static final int FILTERINGMODE_STARTSWITH = 1; - public static final int FILTERINGMODE_CONTAINS = 2; + + /** + * @deprecated from 7.0, use {@link FilteringMode#OFF} instead + */ + @Deprecated + public static final FilteringMode FILTERINGMODE_OFF = FilteringMode.OFF; + /** + * @deprecated from 7.0, use {@link FilteringMode#STARTSWITH} instead + */ + @Deprecated + public static final FilteringMode FILTERINGMODE_STARTSWITH = FilteringMode.STARTSWITH; + /** + * @deprecated from 7.0, use {@link FilteringMode#CONTAINS} instead + */ + @Deprecated + public static final FilteringMode FILTERINGMODE_CONTAINS = FilteringMode.CONTAINS; /** * Sets the option filtering mode. @@ -170,30 +184,15 @@ public abstract class AbstractSelect extends AbstractField implements * @param filteringMode * the filtering mode to use */ - public void setFilteringMode(int filteringMode); + public void setFilteringMode(FilteringMode filteringMode); /** * Gets the current filtering mode. * * @return the filtering mode in use */ - public int getFilteringMode(); - - } - - /** - * Multi select modes that controls how multi select behaves. - */ - public enum MultiSelectMode { - /** - * The default behavior of the multi select mode - */ - DEFAULT, + public FilteringMode getFilteringMode(); - /** - * The previous more simple behavior of the multselect - */ - SIMPLE } /** -- cgit v1.2.3