public class PropertyDatasourceImpl<T extends Entity> extends AbstractDatasource<T> implements Datasource<T>, DatasourceImplementation<T>, PropertyDatasource<T>
AbstractDatasource.ItemListener
Datasource.CommitMode, Datasource.ItemChangeEvent<T extends Entity>, Datasource.ItemChangeListener<T extends Entity>, Datasource.ItemPropertyChangeEvent<T extends Entity>, Datasource.ItemPropertyChangeListener<T extends Entity>, Datasource.State, Datasource.StateChangeEvent<T extends Entity>, Datasource.StateChangeListener<T extends Entity>
Modifier and Type | Field and Description |
---|---|
protected Datasource |
masterDs |
protected com.haulmont.chile.core.model.MetaClass |
metaClass |
protected com.haulmont.chile.core.model.MetaProperty |
metaProperty |
protected View |
view |
allowCommit, backgroundWorker, commitMode, id, itemsToCreate, itemsToDelete, itemsToUpdate, listener, listenersEnabled, loadDynamicAttributes, metadata, modified, parentDs
Constructor and Description |
---|
PropertyDatasourceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
commit()
Performs commit
|
void |
committed(java.util.Set<Entity> entities)
Invoked after commit.
|
DataSupplier |
getDataSupplier() |
DsContext |
getDsContext() |
T |
getItem() |
protected T |
getItem(com.haulmont.chile.core.model.Instance item) |
T |
getItemIfValid() |
Datasource |
getMaster() |
com.haulmont.chile.core.model.MetaClass |
getMetaClass() |
com.haulmont.chile.core.model.MetaProperty |
getProperty() |
Datasource.State |
getState() |
View |
getView() |
void |
initialized()
Moves the datasource to
State#INVALID . |
protected void |
initParentDsListeners() |
void |
invalidate()
Clears internal data and sets the datasource in
Datasource.State.INVALID state. |
void |
modified(T item)
Invoked when the given instance is modified.
|
protected void |
reattachListeners(Entity prevItem,
Entity item) |
void |
refresh()
Refreshes the datasource moving it to the
Datasource.State.VALID state |
void |
setItem(T item)
Set current entity in the datasource.
|
void |
setup(java.lang.String id,
Datasource masterDs,
java.lang.String property)
Setup the datasource right after creation.
|
void |
valid()
Moves the datasource to
State#VALID . |
addItemChangeListener, addItemPropertyChangeListener, addParentsToNested, addStateChangeListener, attachListener, clearCommitLists, deleted, detachListener, enableListeners, fireItemChanged, fireStateChanged, getCommitMode, getEventRouter, getId, getItemsToCreate, getItemsToDelete, getItemsToUpdate, getLoadDynamicAttributes, getParent, isAllowCommit, isModified, removeItemChangeListener, removeItemPropertyChangeListener, removeStateChangeListener, setAllowCommit, setCommitMode, setLoadDynamicAttributes, setModified, setParent, setup, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
clearCommitLists, deleted, enableListeners, getItemsToCreate, getItemsToDelete, getItemsToUpdate, getParent, setCommitMode, setModified, setParent
addItemChangeListener, addItemPropertyChangeListener, addStateChangeListener, getCommitMode, getId, getLoadDynamicAttributes, isAllowCommit, isModified, removeItemChangeListener, removeItemPropertyChangeListener, removeStateChangeListener, setAllowCommit, setLoadDynamicAttributes, setup
protected Datasource masterDs
protected com.haulmont.chile.core.model.MetaProperty metaProperty
protected com.haulmont.chile.core.model.MetaClass metaClass
protected View view
public void setup(java.lang.String id, Datasource masterDs, java.lang.String property)
NestedDatasource
setup
in interface NestedDatasource<T extends Entity>
id
- datasource IDmasterDs
- master datasourceproperty
- property of the master datasource to bound this datasource toprotected void initParentDsListeners()
public Datasource.State getState()
getState
in interface Datasource<T extends Entity>
public T getItem()
getItem
in interface Datasource<T extends Entity>
@Nullable public T getItemIfValid()
getItemIfValid
in interface Datasource<T extends Entity>
protected T getItem(com.haulmont.chile.core.model.Instance item)
public com.haulmont.chile.core.model.MetaClass getMetaClass()
getMetaClass
in interface Datasource<T extends Entity>
public View getView()
getView
in interface Datasource<T extends Entity>
public DsContext getDsContext()
getDsContext
in interface Datasource<T extends Entity>
public DataSupplier getDataSupplier()
getDataSupplier
in interface Datasource<T extends Entity>
public void commit()
Datasource
commit
in interface Datasource<T extends Entity>
public void refresh()
Datasource
Datasource.State.VALID
staterefresh
in interface Datasource<T extends Entity>
public void setItem(T item)
Datasource
setItem
in interface Datasource<T extends Entity>
item
- entity instancepublic void invalidate()
Datasource
Datasource.State.INVALID
state.
In Datasource.State.NOT_INITIALIZED
does nothing.invalidate
in interface Datasource<T extends Entity>
public void modified(T item)
DatasourceImplementation
modified
in interface DatasourceImplementation<T extends Entity>
modified
in class AbstractDatasource<T extends Entity>
public void initialized()
DatasourceImplementation
State#INVALID
.initialized
in interface DatasourceImplementation<T extends Entity>
public void valid()
DatasourceImplementation
State#VALID
.valid
in interface DatasourceImplementation<T extends Entity>
public void committed(java.util.Set<Entity> entities)
DatasourceImplementation
committed
in interface DatasourceImplementation<T extends Entity>
entities
- committed entities returned from middlewarepublic Datasource getMaster()
getMaster
in interface NestedDatasource<T extends Entity>
public com.haulmont.chile.core.model.MetaProperty getProperty()
getProperty
in interface NestedDatasource<T extends Entity>