Class SearchField

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<T>,T>
com.vaadin.flow.component.customfield.CustomField<String>
io.jmix.searchflowui.component.SearchField
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.customfield.CustomField<String>>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<com.vaadin.flow.component.customfield.CustomField<String>>, com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.customfield.CustomField<String>>, 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.HasValidation, com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<String>,String>,String>, com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<String>,String>,String>, com.vaadin.flow.component.InputNotifier, com.vaadin.flow.component.KeyNotifier, com.vaadin.flow.component.shared.HasSuffix, com.vaadin.flow.component.shared.HasThemeVariant<com.vaadin.flow.component.textfield.TextFieldVariant>, com.vaadin.flow.component.shared.HasTooltip, com.vaadin.flow.component.shared.HasValidationProperties, com.vaadin.flow.component.shared.InputField<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<String>,String>,String>, HasAutofocus, HasTitle, Serializable, org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware

public class SearchField extends com.vaadin.flow.component.customfield.CustomField<String> implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean, com.vaadin.flow.component.HasHelper, com.vaadin.flow.component.HasLabel, com.vaadin.flow.component.shared.HasSuffix, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.shared.HasTooltip, com.vaadin.flow.component.shared.HasThemeVariant<com.vaadin.flow.component.textfield.TextFieldVariant>, HasTitle, com.vaadin.flow.component.InputNotifier, com.vaadin.flow.component.KeyNotifier, com.vaadin.flow.component.HasAriaLabel, HasAutofocus, com.vaadin.flow.component.HasPlaceholder
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField

    com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V extends Object>

    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>

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue

    com.vaadin.flow.component.HasValue.ValueChangeEvent<V extends Object>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.springframework.context.ApplicationContext
     
    protected DialogWindows
     
    protected List<String>
     
    protected EntitySearcher
     
    protected Messages
     
    protected Notifications
     
    protected OpenMode
     
     
    static final String
     
    protected com.vaadin.flow.component.icon.Icon
     
     
    allows to bind custom results handler to replace standart dialog/view opening behaviour
    protected int
     
    protected String
     
    protected UiComponents
     
    protected ViewNavigators
     

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

    AUTOFOCUS_PROPERTY_NAME
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected void
     
    protected void
     
     
    protected void
     
    protected String
     
     
     
     
    int
     
     
     
    protected void
     
    protected void
     
    protected void
     
    void
     
    void
    setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
     
    void
    setEntities(List<String> entities)
     
    void
     
    void
    setPlaceholder(String placeholder)
     
    protected void
    setPresentationValue(String newPresentationValue)
     
    void
     
    void
    setSearchSize(int searchSize)
     
    void
    setSearchStrategy(String searchStrategy)
     

    Methods inherited from class com.vaadin.flow.component.customfield.CustomField

    add, addThemeVariants, getLabel, onAttach, remove, removeThemeVariants, setLabel, updateValue

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

    addValueChangeListener, getEmptyValue, isEmpty, setModelValue, setValue, valueEquals

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

    addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, 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.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 com.vaadin.flow.component.HasPlaceholder

    getPlaceholder

    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.HasValidation

    setManualValidation

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

    getErrorMessage, isInvalid, setErrorMessage, setInvalid

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

    addValueChangeListener, clear, getEmptyValue, getOptionalValue, isEmpty, setValue

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

    isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisible

    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

    • SEARCH_FIELD_STYLENAME

      public static final String SEARCH_FIELD_STYLENAME
      See Also:
    • applicationContext

      protected org.springframework.context.ApplicationContext applicationContext
    • uiComponents

      protected UiComponents uiComponents
    • notifications

      protected Notifications notifications
    • messages

      protected Messages messages
    • searchProperties

      protected SearchProperties searchProperties
    • viewNavigators

      protected ViewNavigators viewNavigators
    • dialogWindows

      protected DialogWindows dialogWindows
    • root

      protected TypedTextField<String> root
    • searchIcon

      protected com.vaadin.flow.component.icon.Icon searchIcon
    • searchStrategy

      protected String searchStrategy
    • entities

      protected List<String> entities
    • openMode

      protected OpenMode openMode
    • searchSize

      protected int searchSize
    • searchResultHandler

      protected Consumer<SearchField.SearchCompletedEvent> searchResultHandler
      allows to bind custom results handler to replace standart dialog/view opening behaviour
    • entitySearcher

      protected EntitySearcher entitySearcher
  • Constructor Details

    • SearchField

      public SearchField()
  • Method Details

    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • autowireDependencies

      protected void autowireDependencies()
    • initComponent

      protected void initComponent()
    • generateModelValue

      protected String generateModelValue()
      Specified by:
      generateModelValue in class com.vaadin.flow.component.customfield.CustomField<String>
    • setPlaceholder

      public void setPlaceholder(@Nullable String placeholder)
      Specified by:
      setPlaceholder in interface com.vaadin.flow.component.HasPlaceholder
    • setPresentationValue

      protected void setPresentationValue(String newPresentationValue)
      Specified by:
      setPresentationValue in class com.vaadin.flow.component.customfield.CustomField<String>
    • checkValueComponentState

      protected void checkValueComponentState()
    • createRootComponent

      protected TypedTextField<String> createRootComponent()
    • initRootComponent

      protected void initRootComponent(TypedTextField<String> root)
    • createSearchIcon

      protected void createSearchIcon()
    • openSearchResultsWindow

      protected void openSearchResultsWindow(String searchText)
    • performSearch

      public void performSearch()
    • setSearchCompletedHandler

      public void setSearchCompletedHandler(Consumer<SearchField.SearchCompletedEvent> handler)
    • getSearchCompletedHandler

      public Consumer<SearchField.SearchCompletedEvent> getSearchCompletedHandler()
    • getValue

      public String getValue()
      Specified by:
      getValue in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<String>,String>,String>
      Overrides:
      getValue in class com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<String>,String>
    • getEntities

      public List<String> getEntities()
    • setEntities

      public void setEntities(List<String> entities)
    • getOpenMode

      public OpenMode getOpenMode()
    • setOpenMode

      public void setOpenMode(OpenMode openMode)
    • getSearchStrategy

      public String getSearchStrategy()
    • setSearchStrategy

      public void setSearchStrategy(String searchStrategy)
    • getSearchSize

      public int getSearchSize()
    • setSearchSize

      public void setSearchSize(int searchSize)