Class AbstractValueBinding<V>

java.lang.Object
io.jmix.flowui.data.binding.impl.AbstractValueBinding<V>
Type Parameters:
V - the type of value managed by this binding
All Implemented Interfaces:
JmixBinding, SuspendableBinding, ValueBinding<V>
Direct Known Subclasses:
CheckboxValueBinding, FieldValueBinding

public abstract class AbstractValueBinding<V> extends Object implements ValueBinding<V>, SuspendableBinding
Abstract implementation of ValueBinding. Provides basic mechanisms to bind a UI component to a ValueSource and manage their interactions, such as value changes and state changes.
  • Field Details

    • applicationContext

      protected org.springframework.context.ApplicationContext applicationContext
    • messageTools

      protected MessageTools messageTools
    • metadataTools

      protected MetadataTools metadataTools
    • validator

      protected jakarta.validation.Validator validator
    • accessManager

      protected AccessManager accessManager
    • valueSource

      protected ValueSource<V> valueSource
    • component

      protected com.vaadin.flow.component.HasValue<?,V> component
    • componentValueChangeRegistration

      protected com.vaadin.flow.shared.Registration componentValueChangeRegistration
    • valueSourceValueChangeRegistration

      protected com.vaadin.flow.shared.Registration valueSourceValueChangeRegistration
    • valueSourceStateChangeRegistration

      protected com.vaadin.flow.shared.Registration valueSourceStateChangeRegistration
    • valueSourceInstanceChangeRegistration

      protected com.vaadin.flow.shared.Registration valueSourceInstanceChangeRegistration
    • suspended

      protected boolean suspended
  • Constructor Details

    • AbstractValueBinding

      public AbstractValueBinding(ValueSource<V> valueSource, com.vaadin.flow.component.HasValue<?,V> component)
  • Method Details

    • setApplicationContext

      @Autowired public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
    • setMessageTools

      @Autowired public void setMessageTools(MessageTools messageTools)
    • setMetadataTools

      @Autowired public void setMetadataTools(MetadataTools metadataTools)
    • setValidator

      @Autowired public void setValidator(jakarta.validation.Validator validator)
    • setAccessManager

      @Autowired public void setAccessManager(AccessManager accessManager)
    • getValueSource

      public ValueSource<V> getValueSource()
      Description copied from interface: ValueBinding
      Returns the ValueSource associated with this binding.
      Specified by:
      getValueSource in interface ValueBinding<V>
      Returns:
      the value source used for this binding
    • getComponent

      public com.vaadin.flow.component.HasValue<?,V> getComponent()
      Description copied from interface: ValueBinding
      Returns the component associated with this binding.
      Specified by:
      getComponent in interface ValueBinding<V>
      Returns:
      the component associated with this binding
    • bind

      public void bind()
      Description copied from interface: JmixBinding
      Processes the binding operation.
      Specified by:
      bind in interface JmixBinding
    • onValueSourceInstanceChanged

      protected void onValueSourceInstanceChanged(EntityValueSource.InstanceChangeEvent<?> event)
    • onValueSourceStateChanged

      protected void onValueSourceStateChanged(DataUnit.StateChangeEvent event)
    • onValueSourceValueChange

      protected void onValueSourceValueChange(ValueSource.ValueChangeEvent<V> event)
    • onComponentValueChange

      protected void onComponentValueChange()
    • unbind

      public void unbind()
      Description copied from interface: JmixBinding
      Processes the unbinding operation.
      Specified by:
      unbind in interface JmixBinding
    • activate

      public void activate()
      Description copied from interface: ValueBinding
      Activates binding between a UI component and a ValueSource.
      Specified by:
      activate in interface ValueBinding<V>
    • suspend

      public void suspend()
      Description copied from interface: SuspendableBinding
      Suspends the current binding, temporarily pausing its operation.
      Specified by:
      suspend in interface SuspendableBinding
    • resume

      public void resume()
      Description copied from interface: SuspendableBinding
      Resumes the operation of the binding mechanism, restoring it to its active state after being previously suspended.
      Specified by:
      resume in interface SuspendableBinding
    • suspended

      public boolean suspended()
      Description copied from interface: SuspendableBinding
      Indicates whether the current binding is in a suspended state.
      Specified by:
      suspended in interface SuspendableBinding
      Returns:
      true if the binding is currently suspended, false otherwise
    • setValueToSource

      protected void setValueToSource(@Nullable V value)
    • initRequired

      protected void initRequired(com.vaadin.flow.component.HasValue<?,V> component, MetaPropertyPath metaPropertyPath)
    • resetRequiredIfAttributeFiltered

      protected void resetRequiredIfAttributeFiltered(com.vaadin.flow.component.HasValue<?,V> field, EntityValueSource<?,V> valueSource, MetaPropertyPath metaPropertyPath)
      Set field's "required" flag to false if the value has been filtered by Row Level Security. This is necessary to allow user to submit form with filtered attribute even if attribute is required.
    • initBeanValidator

      protected void initBeanValidator(SupportsValidation<V> component, MetaPropertyPath mpp)
    • getComponentValue

      @Nullable protected abstract V getComponentValue()
    • setComponentValue

      protected abstract void setComponentValue(@Nullable V value)
    • addComponentValueChangeListener

      protected com.vaadin.flow.shared.Registration addComponentValueChangeListener(Runnable listener)