Class ContainerValueSource<E,V>

java.lang.Object
io.jmix.flowui.data.value.ContainerValueSource<E,V>
All Implemented Interfaces:
DataUnit, EntityDataUnit, EntityValueSource<E,V>, HasType<V>, ValueSource<V>, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

public class ContainerValueSource<E,V> extends Object implements EntityValueSource<E,V>, org.springframework.context.ApplicationContextAware
  • Field Details

    • container

      protected final InstanceContainer<E> container
    • metaPropertyPath

      protected MetaPropertyPath metaPropertyPath
    • property

      protected String property
    • state

      protected BindingState state
    • events

      protected EventBus events
    • dataModelSecurityEnabled

      protected boolean dataModelSecurityEnabled
  • Constructor Details

  • Method Details

    • setDataModelSecurityEnabled

      public void setDataModelSecurityEnabled(boolean enabled)
      Sets data model security enabled for data binding.
      Caller may set false in order to disable built-in security check on data binding.
      Parameters:
      enabled - enabled flag
    • setApplicationContext

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

      public MetaClass getEntityMetaClass()
      Specified by:
      getEntityMetaClass in interface EntityDataUnit
      Returns:
      MetaClass of an entity contained in the source
    • getMetaPropertyPath

      public MetaPropertyPath getMetaPropertyPath()
      Specified by:
      getMetaPropertyPath in interface EntityValueSource<E,V>
      Returns:
      property path
    • getItem

      @Nullable public E getItem()
      Specified by:
      getItem in interface EntityValueSource<E,V>
      Returns:
      entity
    • isDataModelSecurityEnabled

      public boolean isDataModelSecurityEnabled()
      Specified by:
      isDataModelSecurityEnabled in interface EntityValueSource<E,V>
      Returns:
      true if data model security check is required on data binding
    • getValue

      @Nullable public V getValue()
      Specified by:
      getValue in interface ValueSource<E>
    • setValue

      public void setValue(@Nullable V value)
      Specified by:
      setValue in interface ValueSource<E>
    • isReadOnly

      public boolean isReadOnly()
      Specified by:
      isReadOnly in interface ValueSource<E>
    • getType

      public Class<V> getType()
      Specified by:
      getType in interface HasType<E>
      Returns:
      type of value
    • getState

      public BindingState getState()
      Specified by:
      getState in interface DataUnit
      Returns:
      a state of this source
    • addInstanceChangeListener

      public com.vaadin.flow.shared.Registration addInstanceChangeListener(Consumer<EntityValueSource.InstanceChangeEvent<E>> listener)
      Specified by:
      addInstanceChangeListener in interface EntityValueSource<E,V>
    • addStateChangeListener

      public com.vaadin.flow.shared.Registration addStateChangeListener(Consumer<DataUnit.StateChangeEvent> listener)
      Description copied from interface: DataUnit
      Registers a new state change listener.
      Specified by:
      addStateChangeListener in interface DataUnit
      Parameters:
      listener - the listener to be added
      Returns:
      a registration object for removing an event listener added to a source
    • addValueChangeListener

      public com.vaadin.flow.shared.Registration addValueChangeListener(Consumer<ValueSource.ValueChangeEvent<V>> listener)
      Description copied from interface: ValueSource
      Registers a new value change listener.
      Specified by:
      addValueChangeListener in interface ValueSource<E>
      Parameters:
      listener - the listener to be added
      Returns:
      a registration object for removing an event listener added to a source
    • setState

      protected void setState(BindingState state)
    • containerItemChanged

      protected void containerItemChanged(InstanceContainer.ItemChangeEvent e)
    • containerItemPropertyChanged

      protected void containerItemPropertyChanged(InstanceContainer.ItemPropertyChangeEvent e)
    • canUpdateMasterRefs

      protected boolean canUpdateMasterRefs()
    • updateMasterRefs

      protected void updateMasterRefs(@Nullable V value)
    • copyPropertyCollection

      @Nullable protected Collection<? extends V> copyPropertyCollection(@Nullable Collection<? extends V> propertyValue)
    • getDataContext

      @Nullable protected DataContext getDataContext()
    • getInverseProperty

      @Nullable protected MetaProperty getInverseProperty()
    • getContainer

      public InstanceContainer<E> getContainer()
    • isCollectionPropertyType

      protected boolean isCollectionPropertyType()
    • isEqualCollectionValue

      protected boolean isEqualCollectionValue(@Nullable V a)