Package io.jmix.flowui.model
Interface KeyValueCollectionLoader
- All Superinterfaces:
BaseCollectionLoader
,DataLoader
- All Known Implementing Classes:
KeyValueCollectionLoaderImpl
@InstallSubject("loadDelegate")
public interface KeyValueCollectionLoader
extends BaseCollectionLoader
Loader of
KeyValueEntity
collections.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Event sent after successful loading of entities and setting to the container.static class
Event sent before loading entities. -
Method Summary
Modifier and TypeMethodDescriptionAdds a listener toKeyValueCollectionLoader.PostLoadEvent
.Adds a listener toKeyValueCollectionLoader.PreLoadEvent
.ReturnsValueLoadContext
which is created by the parameters of this loader.Returns the container which accepts loaded entities.Returns a function which will be used to load data instead of standard implementation.Returns data store name.void
setContainer
(KeyValueCollectionContainer container) Sets the container which accepts loaded entities.void
setLoadDelegate
(Function<ValueLoadContext, List<KeyValueEntity>> delegate) Sets a function which will be used to load data instead of standard implementation.void
setStoreName
(String name) Sets the data store name.Methods inherited from interface io.jmix.flowui.model.BaseCollectionLoader
getFirstResult, getMaxResults, getSort, setFirstResult, setMaxResults, setSort
Methods inherited from interface io.jmix.flowui.model.DataLoader
getCondition, getDataContext, getHints, getParameter, getParameters, getQuery, load, removeParameter, setCondition, setDataContext, setHint, setParameter, setParameters, setQuery
-
Method Details
-
getContainer
KeyValueCollectionContainer getContainer()Returns the container which accepts loaded entities.- Specified by:
getContainer
in interfaceBaseCollectionLoader
- Specified by:
getContainer
in interfaceDataLoader
-
setContainer
Sets the container which accepts loaded entities. -
createLoadContext
ValueLoadContext createLoadContext()ReturnsValueLoadContext
which is created by the parameters of this loader. TheValueLoadContext
can be used withDataManager
to load data by the same conditions. -
getStoreName
String getStoreName()Returns data store name. -
setStoreName
Sets the data store name. By default, the main data store is used. -
getDelegate
Function<ValueLoadContext,List<KeyValueEntity>> getDelegate()Returns a function which will be used to load data instead of standard implementation. -
setLoadDelegate
Sets a function which will be used to load data instead of standard implementation. -
addPreLoadListener
Adds a listener toKeyValueCollectionLoader.PreLoadEvent
.You can also add an event listener declaratively using a controller method annotated with
Subscribe
:@Subscribe(id = "fooDl", target = Target.DATA_LOADER) private void onFooDlPreLoad(KeyValueCollectionLoader.PreLoadEvent event) { // handle event here }
- Parameters:
listener
- listener- Returns:
- subscription
-
addPostLoadListener
Adds a listener toKeyValueCollectionLoader.PostLoadEvent
.You can also add an event listener declaratively using a controller method annotated with
Subscribe
:@Subscribe(id = "fooDl", target = Target.DATA_LOADER) private void onFooDlPostLoad(KeyValueCollectionLoader.PostLoadEvent event) { // handle event here }
- Parameters:
listener
- listener- Returns:
- subscription
-