public class ContainerValueSource<E,V> extends java.lang.Object implements EntityValueSource<E,V>, org.springframework.context.ApplicationContextAware
EntityValueSource.InstanceChangeEvent<E>
ValueSource.ValueChangeEvent<V>
DataUnit.StateChangeEvent
Modifier and Type | Field and Description |
---|---|
protected InstanceContainer<E> |
container |
protected boolean |
dataModelSecurityEnabled |
protected io.jmix.core.common.event.EventHub |
events |
protected io.jmix.core.metamodel.model.MetaPropertyPath |
metaPropertyPath |
protected java.lang.String |
property |
protected BindingState |
state |
Constructor and Description |
---|
ContainerValueSource(InstanceContainer<E> container,
java.lang.String property) |
Modifier and Type | Method and Description |
---|---|
io.jmix.core.common.event.Subscription |
addInstanceChangeListener(java.util.function.Consumer<EntityValueSource.InstanceChangeEvent<E>> listener) |
io.jmix.core.common.event.Subscription |
addStateChangeListener(java.util.function.Consumer<DataUnit.StateChangeEvent> listener)
Registers a new state change listener.
|
io.jmix.core.common.event.Subscription |
addValueChangeListener(java.util.function.Consumer<ValueSource.ValueChangeEvent<V>> listener)
Registers a new value change listener.
|
protected boolean |
canUpdateMasterRefs() |
protected void |
containerItemChanged(InstanceContainer.ItemChangeEvent e) |
protected void |
containerItemPropertyChanged(InstanceContainer.ItemPropertyChangeEvent e) |
protected java.util.Collection<? extends V> |
copyPropertyCollection(java.util.Collection<? extends V> propertyValue) |
InstanceContainer<E> |
getContainer() |
protected DataContext |
getDataContext() |
io.jmix.core.metamodel.model.MetaClass |
getEntityMetaClass() |
protected io.jmix.core.metamodel.model.MetaProperty |
getInverseProperty() |
E |
getItem() |
io.jmix.core.metamodel.model.MetaPropertyPath |
getMetaPropertyPath() |
BindingState |
getState() |
java.lang.Class<V> |
getType() |
V |
getValue() |
boolean |
isDataModelSecurityEnabled() |
boolean |
isReadOnly() |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setDataModelSecurityEnabled(boolean enabled)
Sets data model security enabled for data binding.
|
protected void |
setState(BindingState state) |
void |
setValue(V value) |
protected void |
updateMasterRefs(V value) |
protected final InstanceContainer<E> container
protected io.jmix.core.metamodel.model.MetaPropertyPath metaPropertyPath
protected java.lang.String property
protected BindingState state
protected io.jmix.core.common.event.EventHub events
protected boolean dataModelSecurityEnabled
public ContainerValueSource(InstanceContainer<E> container, java.lang.String property)
public void setDataModelSecurityEnabled(boolean enabled)
enabled
- enabled flagpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
@Nullable public io.jmix.core.metamodel.model.MetaClass getEntityMetaClass()
getEntityMetaClass
in interface EntityDataUnit
MetaClass
of an entity contained in the sourcepublic io.jmix.core.metamodel.model.MetaPropertyPath getMetaPropertyPath()
getMetaPropertyPath
in interface EntityValueSource<E,V>
@Nullable public E getItem()
getItem
in interface EntityValueSource<E,V>
public boolean isDataModelSecurityEnabled()
isDataModelSecurityEnabled
in interface EntityValueSource<E,V>
@Nullable public V getValue()
getValue
in interface ValueSource<V>
public void setValue(@Nullable V value)
setValue
in interface ValueSource<V>
public boolean isReadOnly()
isReadOnly
in interface ValueSource<V>
public java.lang.Class<V> getType()
getType
in interface ValueSource<V>
public BindingState getState()
public io.jmix.core.common.event.Subscription addInstanceChangeListener(java.util.function.Consumer<EntityValueSource.InstanceChangeEvent<E>> listener)
addInstanceChangeListener
in interface EntityValueSource<E,V>
public io.jmix.core.common.event.Subscription addStateChangeListener(java.util.function.Consumer<DataUnit.StateChangeEvent> listener)
DataUnit
addStateChangeListener
in interface DataUnit
listener
- the listener to be addedpublic io.jmix.core.common.event.Subscription addValueChangeListener(java.util.function.Consumer<ValueSource.ValueChangeEvent<V>> listener)
ValueSource
addValueChangeListener
in interface ValueSource<V>
listener
- the listener to be addedprotected void setState(BindingState state)
protected void containerItemChanged(InstanceContainer.ItemChangeEvent e)
protected void containerItemPropertyChanged(InstanceContainer.ItemPropertyChangeEvent e)
protected boolean canUpdateMasterRefs()
protected void updateMasterRefs(@Nullable V value)
@Nullable protected java.util.Collection<? extends V> copyPropertyCollection(@Nullable java.util.Collection<? extends V> propertyValue)
@Nullable protected DataContext getDataContext()
@Nullable protected io.jmix.core.metamodel.model.MetaProperty getInverseProperty()
public InstanceContainer<E> getContainer()