public class CollectionSuggestionProvider extends Object implements AutocompleteSuggestionProvider
AutocompleteSuggestionProvider
backed by a
Collection
AutocompleteSuggestionProvider
,
Serialized FormConstructor and Description |
---|
CollectionSuggestionProvider() |
CollectionSuggestionProvider(Collection<String> values) |
CollectionSuggestionProvider(Collection<String> values,
MatchMode matchMode) |
CollectionSuggestionProvider(Collection<String> values,
MatchMode matchMode,
boolean ignoreCase) |
CollectionSuggestionProvider(Collection<String> values,
MatchMode matchMode,
boolean ignoreCase,
Locale locale) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Locale |
getLocale()
Gets the
Locale of this provider. |
MatchMode |
getMatchMode()
Gets the
MatchMode of this provider. |
Collection<String> |
getValues()
Returns an unmodifiable
Collection containing the values used by
this provider. |
int |
hashCode() |
boolean |
isIgnoreCase()
Gets whether this provider is case insensitive.
|
Collection<AutocompleteSuggestion> |
querySuggestions(AutocompleteQuery query)
Finds
AutocompleteSuggestion s for the given
AutocompleteQuery . |
void |
setIgnoreCase(boolean ignoreCase)
Sets whether this provider is case insensitive.
|
void |
setLocale(Locale locale)
Sets the
Locale of this provider. |
void |
setMatchMode(MatchMode matchMode)
Sets the
MatchMode of this provider. |
void |
setValues(Collection<String> values)
Sets the values used by this provider.
|
CollectionSuggestionProvider |
withIgnoreCase(boolean ignoreCase)
Sets whether this provider is case insensitive.
|
CollectionSuggestionProvider |
withLocale(Locale locale)
Sets the
Locale of this provider. |
CollectionSuggestionProvider |
withMatchMode(MatchMode matchMode)
Sets the
MatchMode of this provider. |
CollectionSuggestionProvider |
withValues(Collection<String> values)
Sets the values used by this provider.
|
public CollectionSuggestionProvider()
public CollectionSuggestionProvider(Collection<String> values)
public CollectionSuggestionProvider(Collection<String> values, MatchMode matchMode)
public CollectionSuggestionProvider(Collection<String> values, MatchMode matchMode, boolean ignoreCase)
public CollectionSuggestionProvider(Collection<String> values, MatchMode matchMode, boolean ignoreCase, Locale locale)
public Collection<AutocompleteSuggestion> querySuggestions(AutocompleteQuery query)
AutocompleteSuggestionProvider
AutocompleteSuggestion
s for the given
AutocompleteQuery
.
The implementation should check if
AutocompleteQuery.hasLimit()
is true
and limit its
suggestions according to the limit provided by
AutocompleteQuery.getLimit()
Excess suggestions will be ignored by the
AutocompleteTextFieldExtension
!
querySuggestions
in interface AutocompleteSuggestionProvider
query
- The AutocompleteQuery
generated by a
AutocompleteTextFieldExtension
.Collection
of AutocompleteSuggestion
s for the
given AutocompleteQuery
AutocompleteQuery.hasLimit()
,
AutocompleteQuery.getLimit()
public Collection<String> getValues()
Collection
containing the values used by
this provider.Collection
public void setValues(Collection<String> values)
values
- The values used by this provider.public CollectionSuggestionProvider withValues(Collection<String> values)
values
- The values used by this provider.setValues(java.util.Collection)
public MatchMode getMatchMode()
MatchMode
of this provider.MatchMode
of this provider.public void setMatchMode(MatchMode matchMode)
MatchMode
of this provider.matchMode
- The MatchMode
of this provider.public CollectionSuggestionProvider withMatchMode(MatchMode matchMode)
MatchMode
of this provider.matchMode
- The MatchMode
of this provider.setMatchMode(eu.maxschuster.vaadin.autocompletetextfield.provider.MatchMode)
public boolean isIgnoreCase()
public void setIgnoreCase(boolean ignoreCase)
ignoreCase
- This provider is case insensitive.public CollectionSuggestionProvider withIgnoreCase(boolean ignoreCase)
ignoreCase
- This provider is case insensitive.setIgnoreCase(boolean)
public Locale getLocale()
Locale
of this provider.Locale
of this provider.public void setLocale(Locale locale)
Locale
of this provider.locale
- The Locale
of this provider.public CollectionSuggestionProvider withLocale(Locale locale)
Locale
of this provider.locale
- The Locale
of this provider.setLocale(java.util.Locale)
Copyright © 2017 Max Schuster. All Rights Reserved.