public class DatasourceValueSource<E extends Entity,V> extends java.lang.Object implements EntityValueSource<E,V>, BeanLocatorAware
EntityValueSource.InstanceChangeEvent<E extends Entity>
ValueSource.ValueChangeEvent<V>
DataUnit.StateChangeEvent
Modifier and Type | Field and Description |
---|---|
protected boolean |
dataModelSecurityEnabled |
protected Datasource<E> |
datasource |
protected com.haulmont.bali.events.EventHub |
events |
protected com.haulmont.chile.core.model.MetaPropertyPath |
metaPropertyPath |
protected java.lang.String |
property |
protected BindingState |
state |
Constructor and Description |
---|
DatasourceValueSource(Datasource<E> datasource,
java.lang.String property) |
Modifier and Type | Method and Description |
---|---|
com.haulmont.bali.events.Subscription |
addInstanceChangeListener(java.util.function.Consumer<EntityValueSource.InstanceChangeEvent<E>> listener) |
com.haulmont.bali.events.Subscription |
addStateChangeListener(java.util.function.Consumer<DataUnit.StateChangeEvent> listener)
Registers a new state change listener.
|
com.haulmont.bali.events.Subscription |
addValueChangeListener(java.util.function.Consumer<ValueSource.ValueChangeEvent<V>> listener)
Registers a new value change listener.
|
protected void |
datasourceItemChanged(Datasource.ItemChangeEvent e) |
protected void |
datasourceItemPropertyChanged(Datasource.ItemPropertyChangeEvent e) |
protected void |
datasourceStateChanged(Datasource.StateChangeEvent<E> e) |
Datasource |
getDatasource() |
com.haulmont.chile.core.model.MetaClass |
getEntityMetaClass() |
E |
getItem() |
com.haulmont.chile.core.model.MetaPropertyPath |
getMetaPropertyPath() |
BindingState |
getState() |
java.lang.Class<V> |
getType() |
V |
getValue() |
boolean |
isDataModelSecurityEnabled() |
boolean |
isModified() |
boolean |
isReadOnly() |
void |
setBeanLocator(BeanLocator beanLocator) |
void |
setDataModelSecurityEnabled(boolean enabled)
Sets data model security enabled for data binding.
|
void |
setModified(boolean modified) |
void |
setState(BindingState state) |
void |
setValue(java.lang.Object value) |
protected final Datasource<E extends Entity> datasource
protected com.haulmont.chile.core.model.MetaPropertyPath metaPropertyPath
protected java.lang.String property
protected BindingState state
protected com.haulmont.bali.events.EventHub events
protected boolean dataModelSecurityEnabled
public DatasourceValueSource(Datasource<E> datasource, java.lang.String property)
public void setDataModelSecurityEnabled(boolean enabled)
enabled
- enabled flagpublic void setBeanLocator(BeanLocator beanLocator)
setBeanLocator
in interface BeanLocatorAware
public void setState(BindingState state)
public Datasource getDatasource()
public com.haulmont.chile.core.model.MetaClass getEntityMetaClass()
getEntityMetaClass
in interface EntityDataUnit
MetaClass
of an entity contained in the sourcepublic com.haulmont.chile.core.model.MetaPropertyPath getMetaPropertyPath()
getMetaPropertyPath
in interface EntityValueSource<E extends Entity,V>
public E getItem()
getItem
in interface EntityValueSource<E extends Entity,V>
public boolean isDataModelSecurityEnabled()
isDataModelSecurityEnabled
in interface EntityValueSource<E extends Entity,V>
public V getValue()
getValue
in interface ValueSource<V>
public void setValue(java.lang.Object 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 boolean isModified()
public void setModified(boolean modified)
public com.haulmont.bali.events.Subscription addInstanceChangeListener(java.util.function.Consumer<EntityValueSource.InstanceChangeEvent<E>> listener)
addInstanceChangeListener
in interface EntityValueSource<E extends Entity,V>
public com.haulmont.bali.events.Subscription addStateChangeListener(java.util.function.Consumer<DataUnit.StateChangeEvent> listener)
DataUnit
addStateChangeListener
in interface DataUnit
listener
- the listener to be addedpublic com.haulmont.bali.events.Subscription addValueChangeListener(java.util.function.Consumer<ValueSource.ValueChangeEvent<V>> listener)
ValueSource
addValueChangeListener
in interface ValueSource<V>
listener
- the listener to be addedprotected void datasourceItemChanged(Datasource.ItemChangeEvent e)
protected void datasourceStateChanged(Datasource.StateChangeEvent<E> e)
protected void datasourceItemPropertyChanged(Datasource.ItemPropertyChangeEvent e)