V
- value type - collection or notI
- item typepublic interface SuggestionFieldComponent<V,I> extends Field<V>, Component.Focusable, HasInputPrompt, HasOptionStyleProvider<I>, HasFormatter<I>, HasEnterPressHandler
Modifier and Type | Interface and Description |
---|---|
static class |
SuggestionFieldComponent.ArrowDownEvent
Event is fired when user pressed ARROW_DOWN key without search action.
|
static interface |
SuggestionFieldComponent.ParametrizedSearchExecutor<E>
Extended version of
SuggestionField.SearchExecutor that allows to pass parameters. |
static interface |
SuggestionFieldComponent.SearchExecutor<E>
Custom suggestions search action interface.
|
HasValue.ValueChangeEvent<V>
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper
HasContextHelp.ContextHelpIconClickEvent
HasEnterPressHandler.EnterPressEvent
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
POPUP_AUTO_WIDTH |
static java.lang.String |
POPUP_PARENT_WIDTH |
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
Modifier and Type | Method and Description |
---|---|
java.util.function.Consumer<SuggestionFieldComponent.ArrowDownEvent> |
getArrowDownHandler() |
int |
getAsyncSearchDelayMs() |
int |
getMinSearchStringLength() |
java.lang.String |
getPopupWidth() |
SuggestionFieldComponent.SearchExecutor<I> |
getSearchExecutor() |
int |
getSuggestionsLimit() |
void |
setArrowDownHandler(java.util.function.Consumer<SuggestionFieldComponent.ArrowDownEvent> handler)
Sets an ARROW_DOWN press handler.
|
void |
setAsyncSearchDelayMs(int asyncSearchDelayMs)
Sets delay between the last key press action and async search.
|
void |
setMinSearchStringLength(int minSearchStringLength)
Sets min string length which is required to perform suggestions search.
|
void |
setPopupWidth(java.lang.String width)
Sets the given
width to the component popup. |
void |
setSearchExecutor(SuggestionFieldComponent.SearchExecutor<I> searchExecutor)
Sets
SuggestionFieldComponent.SearchExecutor which performs search. |
void |
setSuggestionsLimit(int suggestionsLimit)
Sets limit of suggestions which will be shown.
|
void |
showSuggestions(java.util.List<I> suggestions)
Show passed suggestions in popup.
|
getValueSource, setValueSource
addValueChangeListener, clear, getEmptyValue, getValue, isEmpty, setValue
isEditable, isEditableWithParent, setEditable
getFrame, setFrame
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
isValid, isValidateOnCommit, validate
getIcon, setIcon, setIconFromSet
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled
isCaptionAsHtml, setCaptionAsHtml
getCaption, setCaption
getDescription, setDescription
isDescriptionAsHtml, setDescriptionAsHtml
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
addValidator, addValidators, getValidators, removeValidator
getRequiredMessage, isRequired, setRequired, setRequiredMessage
focus, getTabIndex, isFocusable, setFocusable, setTabIndex
getInputPrompt, setInputPrompt
getOptionStyleProvider, setOptionStyleProvider
getFormatter, setFormatter
getEnterPressHandler, setEnterPressHandler
static final java.lang.String POPUP_AUTO_WIDTH
static final java.lang.String POPUP_PARENT_WIDTH
int getAsyncSearchDelayMs()
@StudioProperty(defaultValue="300") void setAsyncSearchDelayMs(int asyncSearchDelayMs)
asyncSearchDelayMs
- delay in ms@Nullable SuggestionFieldComponent.SearchExecutor<I> getSearchExecutor()
SuggestionFieldComponent.SearchExecutor
which performs searchvoid setSearchExecutor(@Nullable SuggestionFieldComponent.SearchExecutor<I> searchExecutor)
SuggestionFieldComponent.SearchExecutor
which performs search.searchExecutor
- SearchExecutor instance@Nullable java.util.function.Consumer<SuggestionFieldComponent.ArrowDownEvent> getArrowDownHandler()
void setArrowDownHandler(@Nullable java.util.function.Consumer<SuggestionFieldComponent.ArrowDownEvent> handler)
handler
- an ARROW_DOWN press handler to setint getMinSearchStringLength()
@StudioProperty(defaultValue="0") void setMinSearchStringLength(int minSearchStringLength)
minSearchStringLength
- required string length to perform searchint getSuggestionsLimit()
@StudioProperty(defaultValue="10") void setSuggestionsLimit(int suggestionsLimit)
suggestionsLimit
- integer limit valuevoid showSuggestions(java.util.List<I> suggestions)
suggestions
- suggestions to show@StudioProperty(name="popupWidth", defaultValue="auto", type=STRING, options={"auto","parent"}) void setPopupWidth(java.lang.String width)
width
to the component popup. There are two predefined settings available:
POPUP_AUTO_WIDTH
and POPUP_PARENT_WIDTH
.width
- width of the component popupjava.lang.String getPopupWidth()