Class MenuFilterField
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.textfield.TextField>
io.jmix.flowui.component.menufilterfield.MenuFilterField
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.BlurNotifier<MenuFilterField>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.Focusable<MenuFilterField>,com.vaadin.flow.component.FocusNotifier<MenuFilterField>,com.vaadin.flow.component.HasAriaLabel,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasHelper,com.vaadin.flow.component.HasLabel,com.vaadin.flow.component.HasPlaceholder,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasTheme,com.vaadin.flow.component.InputNotifier,com.vaadin.flow.component.KeyNotifier,com.vaadin.flow.component.shared.HasClearButton,com.vaadin.flow.component.shared.HasPrefix,com.vaadin.flow.component.shared.HasSuffix,com.vaadin.flow.component.shared.HasThemeVariant<MenuFilterFieldVariant>,com.vaadin.flow.component.shared.HasTooltip,com.vaadin.flow.data.value.HasValueChangeMode,HasAutofocus,HasPlaceholder,HasTitle,Serializable
public class MenuFilterField
extends com.vaadin.flow.component.Composite<com.vaadin.flow.component.textfield.TextField>
implements com.vaadin.flow.component.HasHelper, com.vaadin.flow.component.shared.HasPrefix, com.vaadin.flow.component.shared.HasSuffix, com.vaadin.flow.data.value.HasValueChangeMode, com.vaadin.flow.component.shared.HasThemeVariant<MenuFilterFieldVariant>, HasTitle, com.vaadin.flow.component.shared.HasClearButton, HasAutofocus, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasLabel, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.shared.HasTooltip, com.vaadin.flow.component.InputNotifier, com.vaadin.flow.component.KeyNotifier, com.vaadin.flow.component.HasAriaLabel, com.vaadin.flow.component.Focusable<MenuFilterField>, HasPlaceholder
A component which allows to filter items of a menu (for example,
ListMenu)
by their text labels using entered value- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumFilter mode variantsprotected static classNested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected MenuFilterField.FilterModeprotected MenuFilterField.MenuItemsTransformer<?>protected MenuItemProvider<?>Fields inherited from interface io.jmix.flowui.kit.component.HasAutofocus
AUTOFOCUS_PROPERTY_NAMEFields inherited from interface io.jmix.flowui.kit.component.HasPlaceholder
PLACEHOLDER_PROPERTY_NAMEFields inherited from interface com.vaadin.flow.data.value.HasValueChangeMode
DEFAULT_CHANGE_TIMEOUT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable MenuItemProvider<?>@Nullable StringgetValue()com.vaadin.flow.data.value.ValueChangeModeintprotected com.vaadin.flow.component.textfield.TextFieldbooleanbooleanprotected voidonValueChange(com.vaadin.flow.component.HasValue.ValueChangeEvent<String> event) voidsetAutoselect(boolean autoselect) Set to true to always have the field value automatically selected when the field gains focus, false otherwise.voidsetFilterMode(MenuFilterField.FilterMode filterMode) Sets filter mode.<T extends MenuItem>
voidsetMenuItemProvider(@Nullable MenuItemProvider<T> menuItemProvider) Sets menu item provider which will be used to filter menu itemsvoidsetReadOnly(boolean readOnly) Sets read-only mode of the fieldvoidSets new filter string value.voidsetValueChangeMode(com.vaadin.flow.data.value.ValueChangeMode valueChangeMode) voidsetValueChangeTimeout(int valueChangeTimeout) Methods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElementMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, getTabIndex, setTabIndexMethods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListenerMethods inherited from interface com.vaadin.flow.component.HasAriaLabel
getAriaLabel, getAriaLabelledBy, setAriaLabel, setAriaLabelledByMethods inherited from interface io.jmix.flowui.kit.component.HasAutofocus
isAutofocus, setAutofocusMethods inherited from interface com.vaadin.flow.component.shared.HasClearButton
isClearButtonVisible, setClearButtonVisibleMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasHelper
getHelperComponent, getHelperText, setHelperComponent, setHelperTextMethods inherited from interface com.vaadin.flow.component.HasLabel
getLabel, setLabelMethods inherited from interface io.jmix.flowui.kit.component.HasPlaceholder
getPlaceholder, setPlaceholderMethods inherited from interface com.vaadin.flow.component.shared.HasPrefix
getPrefixComponent, setPrefixComponentMethods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.shared.HasSuffix
getSuffixComponent, setSuffixComponentMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, removeThemeVariantsMethods inherited from interface com.vaadin.flow.component.shared.HasTooltip
getTooltip, setTooltipTextMethods inherited from interface com.vaadin.flow.component.InputNotifier
addInputListenerMethods inherited from interface com.vaadin.flow.component.KeyNotifier
addKeyDownListener, addKeyDownListener, addKeyPressListener, addKeyPressListener, addKeyUpListener, addKeyUpListener
-
Field Details
-
FILTER_FIELD_STYLE_NAME
- See Also:
-
itemsTransformer
-
filterMode
-
-
Constructor Details
-
MenuFilterField
public MenuFilterField()
-
-
Method Details
-
initContent
protected com.vaadin.flow.component.textfield.TextField initContent()- Overrides:
initContentin classcom.vaadin.flow.component.Composite<com.vaadin.flow.component.textfield.TextField>
-
onValueChange
-
getMenuItemProvider
- Returns:
- menu item provider used to filter menu items
-
getValueChangeMode
public com.vaadin.flow.data.value.ValueChangeMode getValueChangeMode()- Specified by:
getValueChangeModein interfacecom.vaadin.flow.data.value.HasValueChangeMode
-
setValueChangeMode
public void setValueChangeMode(com.vaadin.flow.data.value.ValueChangeMode valueChangeMode) - Specified by:
setValueChangeModein interfacecom.vaadin.flow.data.value.HasValueChangeMode
-
setValueChangeTimeout
public void setValueChangeTimeout(int valueChangeTimeout) - Specified by:
setValueChangeTimeoutin interfacecom.vaadin.flow.data.value.HasValueChangeMode
-
getValueChangeTimeout
public int getValueChangeTimeout()- Specified by:
getValueChangeTimeoutin interfacecom.vaadin.flow.data.value.HasValueChangeMode
-
setValue
Sets new filter string value.- Parameters:
value- string to filter by
-
getValue
- Returns:
- current filter string value
-
setReadOnly
public void setReadOnly(boolean readOnly) Sets read-only mode of the field- Parameters:
readOnly- true if read-only mode should be enabled, false otherwise
-
isReadOnly
public boolean isReadOnly()- Returns:
- true if the field is in read-only mode, false otherwise
-
isAutoselect
public boolean isAutoselect()- Returns:
- true/false if auto select is active/inactive
-
setAutoselect
public void setAutoselect(boolean autoselect) Set to true to always have the field value automatically selected when the field gains focus, false otherwise.- Parameters:
autoselect- true/false to set auto select on/off
-
getFilterMode
- Returns:
- field filter mode
- See Also:
-