Package io.jmix.flowui.model.impl
Class InstanceContainerImpl<E>
java.lang.Object
io.jmix.flowui.model.impl.InstanceContainerImpl<E>
- All Implemented Interfaces:
HasLoader,ItemPropertyChangeNotifier,InstanceContainer<E>
- Direct Known Subclasses:
CollectionContainerImpl,InstancePropertyContainerImpl,KeyValueContainerImpl
public class InstanceContainerImpl<E>
extends Object
implements InstanceContainer<E>, HasLoader, ItemPropertyChangeNotifier
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.flowui.model.InstanceContainer
InstanceContainer.ItemChangeEvent<T>, InstanceContainer.ItemPropertyChangeEvent<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected MetaClassprotected EventHubprotected FetchPlanprotected Eprotected EntityPropertyChangeListenerprotected booleanprotected DataLoaderprotected Metadata -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds listener toInstanceContainer.ItemChangeEvents.Adds listener toInstanceContainer.ItemPropertyChangeEvents.protected voidattachListener(Object entity) protected voiddetachListener(Object entity) protected voidfireItemChanged(E prevItem) Returns the meta-class of entities that can be stored in the container.Returns the view which was set by previous call toInstanceContainer.setFetchPlan(FetchPlan).getItem()Returns the contained entity instance.Returns the contained entity instance or null if there is no entity in the container.Returns the loader of this container.voidvoidmute()Disables all event listeners on container data change.voidsetFetchPlan(FetchPlan fetchPlan) Sets a view to be used when loading entities for this container.voidSets the given entity instance to the container.voidsetLoader(DataLoader loader) Sets the loader for this container.voidsetMetadata(Metadata metadata) toString()voidunmute()Enables all event listeners.
-
Field Details
-
metadata
-
item
-
entityMetaClass
-
fetchPlan
-
events
-
listener
-
loader
-
listenersEnabled
protected boolean listenersEnabled
-
-
Constructor Details
-
InstanceContainerImpl
-
-
Method Details
-
setMetadata
-
getItemOrNull
Description copied from interface:InstanceContainerReturns the contained entity instance or null if there is no entity in the container.- Specified by:
getItemOrNullin interfaceInstanceContainer<E>
-
getItem
Description copied from interface:InstanceContainerReturns the contained entity instance.- Specified by:
getItemin interfaceInstanceContainer<E>
-
setItem
Description copied from interface:InstanceContainerSets the given entity instance to the container.- Specified by:
setItemin interfaceInstanceContainer<E>
-
getEntityMetaClass
Description copied from interface:InstanceContainerReturns the meta-class of entities that can be stored in the container.- Specified by:
getEntityMetaClassin interfaceInstanceContainer<E>
-
getFetchPlan
Description copied from interface:InstanceContainerReturns the view which was set by previous call toInstanceContainer.setFetchPlan(FetchPlan). The view is normally used when loading entities for this container.- Specified by:
getFetchPlanin interfaceInstanceContainer<E>
-
setFetchPlan
Description copied from interface:InstanceContainerSets a view to be used when loading entities for this container.- Specified by:
setFetchPlanin interfaceInstanceContainer<E>
-
addItemPropertyChangeListener
public Subscription addItemPropertyChangeListener(Consumer<InstanceContainer.ItemPropertyChangeEvent<E>> listener) Description copied from interface:InstanceContainerAdds listener toInstanceContainer.ItemPropertyChangeEvents.- Specified by:
addItemPropertyChangeListenerin interfaceInstanceContainer<E>
-
addItemChangeListener
Description copied from interface:InstanceContainerAdds listener toInstanceContainer.ItemChangeEvents.- Specified by:
addItemChangeListenerin interfaceInstanceContainer<E>
-
attachListener
-
detachListener
-
toString
-
getLoader
Description copied from interface:HasLoaderReturns the loader of this container. -
setLoader
Description copied from interface:HasLoaderSets the loader for this container. -
fireItemChanged
-
itemPropertyChanged
- Specified by:
itemPropertyChangedin interfaceItemPropertyChangeNotifier
-
mute
public void mute()Description copied from interface:InstanceContainerDisables all event listeners on container data change.
Can be used withInstanceContainer.unmute()for bulk data modification as a perfomance optimization.- Specified by:
mutein interfaceInstanceContainer<E>
-
unmute
public void unmute()Description copied from interface:InstanceContainerEnables all event listeners. No events are fired on this call.- Specified by:
unmutein interfaceInstanceContainer<E>
-