public class RuntimePropsDatasourceImpl extends AbstractDatasource<DynamicAttributesEntity> implements RuntimePropsDatasource<DynamicAttributesEntity>
AbstractDatasource.ItemListenerDatasource.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 java.util.Collection<CategoryAttribute> |
attributes |
protected MetaClass |
categorizedEntityClass |
protected Category |
category |
protected boolean |
categoryChanged |
protected DataSupplier |
dataSupplier |
protected DsContext |
dsContext |
protected DynamicAttributesGuiTools |
dynamicAttributesGuiTools |
protected boolean |
initializedBefore |
protected DynamicAttributesEntity |
item |
protected Datasource |
mainDs |
protected DynamicAttributesMetaClass |
metaClass |
protected Datasource.State |
state |
protected View |
view |
allowCommit, backgroundWorker, commitMode, id, itemsToCreate, itemsToDelete, itemsToUpdate, listener, listenersEnabled, loadDynamicAttributes, metadata, modified, parentDs| Constructor and Description |
|---|
RuntimePropsDatasourceImpl(DsContext dsContext,
DataSupplier dataSupplier,
java.lang.String id,
java.lang.String mainDsId,
MetaClass categorizedEntityClass) |
| Modifier and Type | Method and Description |
|---|---|
void |
commit()
Performs commit
|
void |
committed(java.util.Set<Entity> entities)
Invoked after commit.
|
DataSupplier |
getDataSupplier() |
Category |
getDefaultCategory() |
DsContext |
getDsContext() |
DynamicAttributesEntity |
getItem() |
DynamicAttributesEntity |
getItemIfValid() |
Datasource |
getMainDs() |
MetaClass |
getMetaClass() |
java.util.Collection<DynamicAttributesMetaProperty> |
getPropertiesFilteredByCategory() |
Datasource.State |
getState() |
View |
getView() |
void |
initialized()
Moves the datasource to
State#INVALID. |
protected void |
initMetaClass(Entity entity) |
void |
invalidate()
Clears internal data and sets the datasource in
Datasource.State.INVALID state. |
void |
refresh()
Refreshes the datasource moving it to the
Datasource.State.VALID state |
MetaClass |
resolveCategorizedEntityClass() |
void |
setItem(DynamicAttributesEntity item)
Set current entity in the datasource.
|
protected void |
setMainDs(java.lang.String name) |
void |
setup(DsContext dsContext,
DataSupplier dataSupplier,
java.lang.String id,
MetaClass metaClass,
View view)
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, modified, removeItemChangeListener, removeItemPropertyChangeListener, removeStateChangeListener, setAllowCommit, setCommitMode, setLoadDynamicAttributes, setModified, setParent, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddItemChangeListener, addItemPropertyChangeListener, addStateChangeListener, getCommitMode, getId, getLoadDynamicAttributes, isAllowCommit, isModified, removeItemChangeListener, removeItemPropertyChangeListener, removeStateChangeListener, setAllowCommit, setLoadDynamicAttributesprotected DsContext dsContext
protected DataSupplier dataSupplier
protected DynamicAttributesGuiTools dynamicAttributesGuiTools
protected DynamicAttributesMetaClass metaClass
protected View view
protected Datasource mainDs
protected MetaClass categorizedEntityClass
protected boolean initializedBefore
protected boolean categoryChanged
protected Datasource.State state
protected DynamicAttributesEntity item
protected Category category
protected final java.util.Collection<CategoryAttribute> attributes
public RuntimePropsDatasourceImpl(DsContext dsContext, DataSupplier dataSupplier, java.lang.String id, java.lang.String mainDsId, @Nullable MetaClass categorizedEntityClass)
public void setup(DsContext dsContext, DataSupplier dataSupplier, java.lang.String id, MetaClass metaClass, @Nullable View view) throws java.lang.UnsupportedOperationException
Datasourcesetup in interface Datasource<DynamicAttributesEntity>setup in class AbstractDatasource<DynamicAttributesEntity>dsContext - DsContext instancedataSupplier - DataSupplier instanceid - datasource IDmetaClass - MetaClass of an entity that will be stored in this datasourceview - a view that will be used to load entities form DB, can be nulljava.lang.UnsupportedOperationException - if an implementation doesn't support this method. This is the case
for example for NestedDatasource implementors, that have their own setup method.public MetaClass resolveCategorizedEntityClass()
resolveCategorizedEntityClass in interface RuntimePropsDatasource<DynamicAttributesEntity>public DsContext getDsContext()
getDsContext in interface Datasource<DynamicAttributesEntity>public DataSupplier getDataSupplier()
getDataSupplier in interface Datasource<DynamicAttributesEntity>public void commit()
Datasourcecommit in interface Datasource<DynamicAttributesEntity>public Datasource.State getState()
getState in interface Datasource<DynamicAttributesEntity>public DynamicAttributesEntity getItem()
getItem in interface Datasource<DynamicAttributesEntity>@Nullable public DynamicAttributesEntity getItemIfValid()
getItemIfValid in interface Datasource<DynamicAttributesEntity>public void setItem(DynamicAttributesEntity item)
DatasourcesetItem in interface Datasource<DynamicAttributesEntity>item - entity instancepublic void invalidate()
DatasourceDatasource.State.INVALID state.
In Datasource.State.NOT_INITIALIZED does nothing.invalidate in interface Datasource<DynamicAttributesEntity>public void refresh()
DatasourceDatasource.State.VALID staterefresh in interface Datasource<DynamicAttributesEntity>public MetaClass getMetaClass()
getMetaClass in interface Datasource<DynamicAttributesEntity>public View getView()
getView in interface Datasource<DynamicAttributesEntity>public void initialized()
DatasourceImplementationState#INVALID.initialized in interface DatasourceImplementation<DynamicAttributesEntity>public void valid()
DatasourceImplementationState#VALID.valid in interface DatasourceImplementation<DynamicAttributesEntity>public void committed(java.util.Set<Entity> entities)
DatasourceImplementationcommitted in interface DatasourceImplementation<DynamicAttributesEntity>entities - committed entities returned from middlewarepublic Datasource getMainDs()
getMainDs in interface RuntimePropsDatasource<DynamicAttributesEntity>public java.util.Collection<DynamicAttributesMetaProperty> getPropertiesFilteredByCategory()
getPropertiesFilteredByCategory in interface RuntimePropsDatasource<DynamicAttributesEntity>@Nullable public Category getDefaultCategory()
protected void setMainDs(java.lang.String name)
protected void initMetaClass(Entity entity)