Package io.jmix.ui.model
Interface InstanceContainer<E>
- All Known Subinterfaces:
CollectionContainer<E>
,CollectionPropertyContainer<E>
,InstancePropertyContainer<E>
,KeyValueCollectionContainer
,KeyValueContainer
- All Known Implementing Classes:
CollectionContainerImpl
,CollectionPropertyContainerImpl
,InstanceContainerImpl
,InstancePropertyContainerImpl
,KeyValueCollectionContainerImpl
,KeyValueContainerImpl
public interface InstanceContainer<E>
The root interface in the data containers hierarchy. Data containers represent a thin layer between
visual components and entity instances and collections.
InstanceContainer
holds a single entity instance.
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Event sent when the entity instance selected in the container is replaced with another instance or null.static class
Event sent on changing a property value of the contained entity instance. -
Method Summary
Modifier and TypeMethodDescriptionAdds listener toInstanceContainer.ItemChangeEvent
s.Adds listener toInstanceContainer.ItemPropertyChangeEvent
s.Returns the meta-class of entities that can be stored in the container.Returns the view which was set by previous call tosetFetchPlan(FetchPlan)
.getItem()
Returns the contained entity instance.Returns the contained entity instance or null if there is no entity in the container.default FetchPlan
getView()
Deprecated.void
mute()
Disables all event listeners on container data change.void
setFetchPlan
(FetchPlan fetchPlan) Sets a view to be used when loading entities for this container.void
Sets the given entity instance to the container.default void
Deprecated.replaced bysetFetchPlan(FetchPlan)
void
unmute()
Enables all event listeners.
-
Method Details
-
getItem
E getItem()Returns the contained entity instance.- Throws:
IllegalStateException
- if there is no entity in the container
-
setItem
Sets the given entity instance to the container. -
getItemOrNull
Returns the contained entity instance or null if there is no entity in the container. -
getEntityMetaClass
MetaClass getEntityMetaClass()Returns the meta-class of entities that can be stored in the container. -
getView
Deprecated.replaced bygetFetchPlan()
-
getFetchPlan
Returns the view which was set by previous call tosetFetchPlan(FetchPlan)
. The view is normally used when loading entities for this container. -
setView
Deprecated.replaced bysetFetchPlan(FetchPlan)
-
setFetchPlan
Sets a view to be used when loading entities for this container. -
addItemPropertyChangeListener
Subscription addItemPropertyChangeListener(Consumer<InstanceContainer.ItemPropertyChangeEvent<E>> listener) Adds listener toInstanceContainer.ItemPropertyChangeEvent
s. -
addItemChangeListener
Adds listener toInstanceContainer.ItemChangeEvent
s. -
mute
void mute()Disables all event listeners on container data change.
Can be used withunmute()
for bulk data modification as a perfomance optimization. -
unmute
void unmute()Enables all event listeners. No events are fired on this call.
-
getFetchPlan()