Class JmixValuePicker<V>

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<C,V>
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<ValuePicker<V>>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<ValuePicker<V>>, com.vaadin.flow.component.FocusNotifier<ValuePicker<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<ValuePicker<V>,V>,V>, com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ValuePicker<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, HasRequired, PickerComponent<V>, SupportsStatusChangeHandler<JmixValuePicker<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 JmixValuePicker<V> extends ValuePicker<V> implements PickerComponent<V>, SupportsValidation<V>, HasRequired, SupportsStatusChangeHandler<JmixValuePicker<V>>, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
See Also:
  • Field Details

    • applicationContext

      protected org.springframework.context.ApplicationContext applicationContext
    • fieldDelegate

      protected FieldDelegate<JmixValuePicker<V>,V,V> fieldDelegate
  • Constructor Details

    • JmixValuePicker

      public JmixValuePicker()
  • 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
    • applyDefaultValueFormat

      protected String applyDefaultValueFormat(@Nullable V value)
      Overrides:
      applyDefaultValueFormat in class ValuePickerBase<ValuePicker<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
    • setRequiredIndicatorVisible

      public void setRequiredIndicatorVisible(boolean requiredIndicatorVisible)
      Specified by:
      setRequiredIndicatorVisible in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ValuePicker<V>,V>,V>
      Specified by:
      setRequiredIndicatorVisible in interface com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<ValuePicker<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<ValuePicker<V>,V>
    • 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<JmixValuePicker<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
    • 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>
    • addAction

      public void addAction(Action action, int index)
      Specified by:
      addAction in interface HasActions
      Overrides:
      addAction in class ValuePickerBase<ValuePicker<V>,V>
    • createFieldDelegate

      protected FieldDelegate<JmixValuePicker<V>,V,V> createFieldDelegate()
    • createActionsSupport

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