Class EntityPicker<V>

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<C,V>
io.jmix.flowui.kit.component.valuepicker.ValuePickerBase<EntityPicker<V>,V>
io.jmix.flowui.component.valuepicker.EntityPicker<V>
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<EntityPicker<V>>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<EntityPicker<V>>, com.vaadin.flow.component.FocusNotifier<EntityPicker<V>>, 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<EntityPicker<V>,V>,V>, com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EntityPicker<V>,V>,V>, com.vaadin.flow.component.shared.HasPrefix, com.vaadin.flow.component.shared.HasSuffix, com.vaadin.flow.component.shared.HasTooltip, com.vaadin.flow.component.shared.HasValidationProperties, EntityPickerComponent<V>, HasRequired, LookupComponent<V>, PickerComponent<V>, SupportsMetaClass, SupportsStatusChangeHandler<EntityPicker<V>>, SupportsValidation<V>, SupportsValueSource<V>, HasActions, HasAutofocus, HasPlaceholder, HasTitle, SupportsFormatter<V>, SupportsUserAction<V>, Serializable, org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware

public class EntityPicker<V> extends ValuePickerBase<EntityPicker<V>,V> implements EntityPickerComponent<V>, LookupComponent<V>, SupportsValidation<V>, SupportsStatusChangeHandler<EntityPicker<V>>, HasRequired, com.vaadin.flow.component.shared.HasPrefix, com.vaadin.flow.component.shared.HasSuffix, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
See Also:
  • Field Details

    • applicationContext

      protected org.springframework.context.ApplicationContext applicationContext
    • fieldDelegate

      protected EntityFieldDelegate<EntityPicker<V>,V,V> fieldDelegate
  • Constructor Details

    • EntityPicker

      public EntityPicker()
  • Method Details

    • setApplicationContext

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

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

      public void setValue(@Nullable V value)
      Specified by:
      setValue in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EntityPicker<V>,V>,V>
      Overrides:
      setValue in class ValuePickerBase<EntityPicker<V>,V>
    • setValueFromClient

      public void setValueFromClient(@Nullable V value)
      Description copied from interface: SupportsUserAction
      Sets the value of this component as if the user had set it. The user originated attribute is only used for the HasValue.ValueChangeEvent.
      Specified by:
      setValueFromClient in interface SupportsUserAction<V>
      Overrides:
      setValueFromClient in class ValuePickerBase<EntityPicker<V>,V>
      Parameters:
      value - the new value
    • valueEquals

      protected boolean valueEquals(V value1, V value2)
      Overrides:
      valueEquals in class com.vaadin.flow.component.AbstractField<EntityPicker<V>,V>
    • applyDefaultValueFormat

      protected String applyDefaultValueFormat(@Nullable V value)
      Overrides:
      applyDefaultValueFormat in class ValuePickerBase<EntityPicker<V>,V>
    • isInvalid

      public boolean isInvalid()
      Specified by:
      isInvalid in interface com.vaadin.flow.component.HasValidation
      Specified by:
      isInvalid in interface com.vaadin.flow.component.shared.HasValidationProperties
    • setInvalid

      public void setInvalid(boolean invalid)
      Description copied from interface: SupportsValidation
      Sets invalid state to the field considering result of field validation.
      • Invalid - false and validation passed - false = field is invalid
      • Invalid - false and validation passed - true = field is valid
      • Invalid - true and validation passed - false = field is invalid
      • Invalid - true and validation passed - true = field is invalid
      Specified by:
      setInvalid in interface com.vaadin.flow.component.HasValidation
      Specified by:
      setInvalid in interface com.vaadin.flow.component.shared.HasValidationProperties
      Specified by:
      setInvalid in interface SupportsValidation<V>
      Parameters:
      invalid - whether field should be invalid
    • getErrorMessage

      @Nullable public String getErrorMessage()
      Specified by:
      getErrorMessage in interface com.vaadin.flow.component.HasValidation
      Specified by:
      getErrorMessage in interface com.vaadin.flow.component.shared.HasValidationProperties
      Specified by:
      getErrorMessage in interface SupportsValidation<V>
    • setErrorMessage

      public void setErrorMessage(@Nullable String errorMessage)
      Specified by:
      setErrorMessage in interface com.vaadin.flow.component.HasValidation
      Specified by:
      setErrorMessage in interface com.vaadin.flow.component.shared.HasValidationProperties
      Specified by:
      setErrorMessage in interface SupportsValidation<V>
    • setStatusChangeHandler

      public void setStatusChangeHandler(@Nullable Consumer<SupportsStatusChangeHandler.StatusContext<EntityPicker<V>>> handler)
      Description copied from interface: SupportsStatusChangeHandler
      Sets a callback to be used to handle component status changes, e.g. validation messages set by HasValidation.setErrorMessage(String).
      Specified by:
      setStatusChangeHandler in interface SupportsStatusChangeHandler<V>
      Parameters:
      handler - a handler to set
    • setRequiredIndicatorVisible

      public void setRequiredIndicatorVisible(boolean requiredIndicatorVisible)
      Specified by:
      setRequiredIndicatorVisible in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EntityPicker<V>,V>,V>
      Specified by:
      setRequiredIndicatorVisible in interface com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EntityPicker<V>,V>,V>
    • setRequired

      public void setRequired(boolean required)
      Specified by:
      setRequired in interface HasRequired
    • getRequiredMessage

      @Nullable public String getRequiredMessage()
      Specified by:
      getRequiredMessage in interface HasRequired
    • setRequiredMessage

      public void setRequiredMessage(@Nullable String requiredMessage)
      Specified by:
      setRequiredMessage in interface HasRequired
    • addValidator

      public com.vaadin.flow.shared.Registration addValidator(Validator<? super V> validator)
      Specified by:
      addValidator in interface SupportsValidation<V>
    • executeValidators

      public void executeValidators() throws ValidationException
      Specified by:
      executeValidators in interface SupportsValidation<V>
      Throws:
      ValidationException
    • validate

      protected void validate()
      Overrides:
      validate in class ValuePickerBase<EntityPicker<V>,V>
    • getValueSource

      @Nullable public ValueSource<V> getValueSource()
      Specified by:
      getValueSource in interface SupportsValueSource<V>
    • setValueSource

      public void setValueSource(@Nullable ValueSource<V> valueSource)
      Specified by:
      setValueSource in interface SupportsValueSource<V>
    • getMetaClass

      @Nullable public MetaClass getMetaClass()
      Specified by:
      getMetaClass in interface SupportsMetaClass
    • setMetaClass

      public void setMetaClass(@Nullable MetaClass metaClass)
      Specified by:
      setMetaClass in interface SupportsMetaClass
    • isAllowCustomValue

      public boolean isAllowCustomValue()
    • setAllowCustomValue

      public void setAllowCustomValue(boolean allowCustomValue)
      Overrides:
      setAllowCustomValue in class ValuePickerBase<EntityPicker<V>,V>
    • addCustomValueSetListener

      public com.vaadin.flow.shared.Registration addCustomValueSetListener(com.vaadin.flow.component.ComponentEventListener<CustomValueSetEvent<EntityPicker<V>,V>> listener)
      Overrides:
      addCustomValueSetListener in class ValuePickerBase<EntityPicker<V>,V>
    • getSelectedItems

      public Set<V> getSelectedItems()
      Specified by:
      getSelectedItems in interface LookupComponent<V>
      Returns:
      items selected in this lookup component
    • createFieldDelegate

      protected EntityFieldDelegate<EntityPicker<V>,V,V> createFieldDelegate()
    • createActionsSupport

      protected ValuePickerActionSupport createActionsSupport()
      Overrides:
      createActionsSupport in class ValuePickerBase<EntityPicker<V>,V>