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 Classes
    Modifier and Type
    Class
    Description
    static enum 
    Filter mode variants
    protected static class 
     

    Nested 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

    Fields
    Modifier and Type
    Field
    Description
    protected static final String
     
     
     
    protected MenuItemProvider<?>
     

    Fields inherited from interface io.jmix.flowui.kit.component.HasAutofocus

    AUTOFOCUS_PROPERTY_NAME

    Fields inherited from interface io.jmix.flowui.kit.component.HasPlaceholder

    PLACEHOLDER_PROPERTY_NAME

    Fields inherited from interface com.vaadin.flow.data.value.HasValueChangeMode

    DEFAULT_CHANGE_TIMEOUT
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    @Nullable MenuItemProvider<?>
     
    @Nullable String
     
    com.vaadin.flow.data.value.ValueChangeMode
     
    int
     
    protected com.vaadin.flow.component.textfield.TextField
     
    boolean
     
    boolean
     
    protected void
    onValueChange(com.vaadin.flow.component.HasValue.ValueChangeEvent<String> event)
     
    void
    setAutoselect(boolean autoselect)
    Set to true to always have the field value automatically selected when the field gains focus, false otherwise.
    void
    Sets filter mode.
    <T extends MenuItem>
    void
    setMenuItemProvider(@Nullable MenuItemProvider<T> menuItemProvider)
    Sets menu item provider which will be used to filter menu items
    void
    setReadOnly(boolean readOnly)
    Sets read-only mode of the field
    void
    setValue(@Nullable String value)
    Sets new filter string value.
    void
    setValueChangeMode(com.vaadin.flow.data.value.ValueChangeMode valueChangeMode)
     
    void
    setValueChangeTimeout(int valueChangeTimeout)
     

    Methods inherited from class com.vaadin.flow.component.Composite

    getChildren, getContent, getElement

    Methods 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, setVisible

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.BlurNotifier

    addBlurListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.Focusable

    addFocusShortcut, blur, focus, getTabIndex, setTabIndex

    Methods inherited from interface com.vaadin.flow.component.FocusNotifier

    addFocusListener

    Methods inherited from interface com.vaadin.flow.component.HasAriaLabel

    getAriaLabel, getAriaLabelledBy, setAriaLabel, setAriaLabelledBy

    Methods inherited from interface io.jmix.flowui.kit.component.HasAutofocus

    isAutofocus, setAutofocus

    Methods inherited from interface com.vaadin.flow.component.shared.HasClearButton

    isClearButtonVisible, setClearButtonVisible

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasEnabled

    isEnabled, setEnabled

    Methods inherited from interface com.vaadin.flow.component.HasHelper

    getHelperComponent, getHelperText, setHelperComponent, setHelperText

    Methods inherited from interface com.vaadin.flow.component.HasLabel

    getLabel, setLabel

    Methods inherited from interface io.jmix.flowui.kit.component.HasPlaceholder

    getPlaceholder, setPlaceholder

    Methods inherited from interface com.vaadin.flow.component.shared.HasPrefix

    getPrefixComponent, setPrefixComponent

    Methods 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, setWidthFull

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName

    Methods inherited from interface com.vaadin.flow.component.shared.HasSuffix

    getSuffixComponent, setSuffixComponent

    Methods inherited from interface com.vaadin.flow.component.HasTheme

    addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName

    Methods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant

    addThemeVariants, removeThemeVariants

    Methods inherited from interface io.jmix.flowui.kit.component.HasTitle

    getTitle, setTitle

    Methods inherited from interface com.vaadin.flow.component.shared.HasTooltip

    getTooltip, setTooltipText

    Methods inherited from interface com.vaadin.flow.component.InputNotifier

    addInputListener

    Methods inherited from interface com.vaadin.flow.component.KeyNotifier

    addKeyDownListener, addKeyDownListener, addKeyPressListener, addKeyPressListener, addKeyUpListener, addKeyUpListener
  • Field Details

  • Constructor Details

    • MenuFilterField

      public MenuFilterField()
  • Method Details

    • initContent

      protected com.vaadin.flow.component.textfield.TextField initContent()
      Overrides:
      initContent in class com.vaadin.flow.component.Composite<com.vaadin.flow.component.textfield.TextField>
    • onValueChange

      protected void onValueChange(com.vaadin.flow.component.HasValue.ValueChangeEvent<String> event)
    • getMenuItemProvider

      public @Nullable MenuItemProvider<?> getMenuItemProvider()
      Returns:
      menu item provider used to filter menu items
    • setMenuItemProvider

      public <T extends MenuItem> void setMenuItemProvider(@Nullable MenuItemProvider<T> menuItemProvider)
      Sets menu item provider which will be used to filter menu items
      Type Parameters:
      T - menu item type
      Parameters:
      menuItemProvider - menu item provider to set
    • getValueChangeMode

      public com.vaadin.flow.data.value.ValueChangeMode getValueChangeMode()
      Specified by:
      getValueChangeMode in interface com.vaadin.flow.data.value.HasValueChangeMode
    • setValueChangeMode

      public void setValueChangeMode(com.vaadin.flow.data.value.ValueChangeMode valueChangeMode)
      Specified by:
      setValueChangeMode in interface com.vaadin.flow.data.value.HasValueChangeMode
    • setValueChangeTimeout

      public void setValueChangeTimeout(int valueChangeTimeout)
      Specified by:
      setValueChangeTimeout in interface com.vaadin.flow.data.value.HasValueChangeMode
    • getValueChangeTimeout

      public int getValueChangeTimeout()
      Specified by:
      getValueChangeTimeout in interface com.vaadin.flow.data.value.HasValueChangeMode
    • setValue

      public void setValue(@Nullable String value)
      Sets new filter string value.
      Parameters:
      value - string to filter by
    • getValue

      public @Nullable String 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

      public MenuFilterField.FilterMode getFilterMode()
      Returns:
      field filter mode
      See Also:
    • setFilterMode

      public void setFilterMode(MenuFilterField.FilterMode filterMode)
      Sets filter mode.
      Parameters:
      filterMode - filter mode to set
      See Also: