public interface InstanceContainer<E>
InstanceContainer
holds a single entity instance.
CollectionContainer
Modifier and Type | Interface and Description |
---|---|
static class |
InstanceContainer.ItemChangeEvent<T>
Event sent when the entity instance selected in the container is replaced with another instance or null.
|
static class |
InstanceContainer.ItemPropertyChangeEvent<T>
Event sent on changing a property value of the contained entity instance.
|
Modifier and Type | Method and Description |
---|---|
io.jmix.core.common.event.Subscription |
addItemChangeListener(java.util.function.Consumer<InstanceContainer.ItemChangeEvent<E>> listener)
Adds listener to
InstanceContainer.ItemChangeEvent s. |
io.jmix.core.common.event.Subscription |
addItemPropertyChangeListener(java.util.function.Consumer<InstanceContainer.ItemPropertyChangeEvent<E>> listener)
Adds listener to
InstanceContainer.ItemPropertyChangeEvent s. |
io.jmix.core.metamodel.model.MetaClass |
getEntityMetaClass()
Returns the meta-class of entities that can be stored in the container.
|
io.jmix.core.FetchPlan |
getFetchPlan()
Returns the view which was set by previous call to
setFetchPlan(FetchPlan) . |
E |
getItem()
Returns the contained entity instance.
|
E |
getItemOrNull()
Returns the contained entity instance or null if there is no entity in the container.
|
default io.jmix.core.FetchPlan |
getView()
Deprecated.
replaced by
getFetchPlan() |
void |
mute()
Disables all event listeners on container data change.
|
void |
setFetchPlan(io.jmix.core.FetchPlan fetchPlan)
Sets a view to be used when loading entities for this container.
|
void |
setItem(E entity)
Sets the given entity instance to the container.
|
default void |
setView(io.jmix.core.FetchPlan view)
Deprecated.
replaced by
setFetchPlan(FetchPlan) |
void |
unmute()
Enables all event listeners.
|
E getItem()
java.lang.IllegalStateException
- if there is no entity in the containervoid setItem(@Nullable E entity)
@Nullable E getItemOrNull()
io.jmix.core.metamodel.model.MetaClass getEntityMetaClass()
@Nullable @Deprecated default io.jmix.core.FetchPlan getView()
getFetchPlan()
@Nullable io.jmix.core.FetchPlan getFetchPlan()
setFetchPlan(FetchPlan)
.
The view is normally used when loading entities for this container.@Deprecated default void setView(io.jmix.core.FetchPlan view)
setFetchPlan(FetchPlan)
void setFetchPlan(io.jmix.core.FetchPlan fetchPlan)
io.jmix.core.common.event.Subscription addItemPropertyChangeListener(java.util.function.Consumer<InstanceContainer.ItemPropertyChangeEvent<E>> listener)
InstanceContainer.ItemPropertyChangeEvent
s.io.jmix.core.common.event.Subscription addItemChangeListener(java.util.function.Consumer<InstanceContainer.ItemChangeEvent<E>> listener)
InstanceContainer.ItemChangeEvent
s.void mute()
unmute()
for bulk data modification as a perfomance optimization.void unmute()