Package io.jmix.flowui.data.pagination
Class PaginationDataLoaderImpl
java.lang.Object
io.jmix.flowui.data.pagination.PaginationDataLoaderImpl
- All Implemented Interfaces:
- PaginationDataLoader
@Component("flowui_PaginationDataLoaderImpl")
@Scope("prototype")
public class PaginationDataLoaderImpl
extends Object
implements PaginationDataLoader
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected CollectionContainer<?>protected Consumer<CollectionContainer.CollectionChangeEvent<?>>protected DataManagerprotected BaseCollectionLoaderprotected Consumer<CollectionChangeType>protected Function<DataLoadContext,Integer> protected WeakCollectionChangeListener<?>
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidintgetCount()intintvoidrefresh()Reloads instances.voidRemoves collection change listener.voidSets collection change listener.voidsetDataManager(DataManager dataManager) voidsetFirstResult(int startPosition) Sets the position of the first instance to load.voidsetMaxResults(int maxResults) Sets maximum number of instances to load.voidsetTotalCountDelegate(Function<DataLoadContext, Integer> totalCountDelegate) Sets delegate which is used to get the total count of items.intsize()
- 
Field Details- 
dataManager
- 
container
- 
loader
- 
refreshListener
- 
weakContainerCollectionChangeListener
- 
containerCollectionChangeListener
- 
totalCountDelegate
 
- 
- 
Constructor Details- 
PaginationDataLoaderImpl
 
- 
- 
Method Details- 
attachCollectionChangeListenerprotected void attachCollectionChangeListener()
- 
setDataManager
- 
getFirstResultpublic int getFirstResult()- Specified by:
- getFirstResultin interface- PaginationDataLoader
- Returns:
- first position to load
 
- 
setFirstResultpublic void setFirstResult(int startPosition) Description copied from interface:PaginationDataLoaderSets the position of the first instance to load.- Specified by:
- setFirstResultin interface- PaginationDataLoader
 
- 
getMaxResultspublic int getMaxResults()- Specified by:
- getMaxResultsin interface- PaginationDataLoader
- Returns:
- maximum number of instances to load
 
- 
setMaxResultspublic void setMaxResults(int maxResults) Description copied from interface:PaginationDataLoaderSets maximum number of instances to load.- Specified by:
- setMaxResultsin interface- PaginationDataLoader
 
- 
getCountpublic int getCount()- Specified by:
- getCountin interface- PaginationDataLoader
- Returns:
- number of instances in the data store
 
- 
sizepublic int size()- Specified by:
- sizein interface- PaginationDataLoader
- Returns:
- number of instances are currently loaded
 
- 
refreshpublic void refresh()Description copied from interface:PaginationDataLoaderReloads instances.- Specified by:
- refreshin interface- PaginationDataLoader
 
- 
removeCollectionChangeListenerpublic void removeCollectionChangeListener()Description copied from interface:PaginationDataLoaderRemoves collection change listener.- Specified by:
- removeCollectionChangeListenerin interface- PaginationDataLoader
 
- 
setCollectionChangeListenerDescription copied from interface:PaginationDataLoaderSets collection change listener.- Specified by:
- setCollectionChangeListenerin interface- PaginationDataLoader
 
- 
getEntityMetaClass- Specified by:
- getEntityMetaClassin interface- PaginationDataLoader
- Returns:
- meta class of entity
 
- 
getTotalCountDelegate- Specified by:
- getTotalCountDelegatein interface- PaginationDataLoader
- Returns:
- total count delegate or nullotherwise
 
- 
setTotalCountDelegateDescription copied from interface:PaginationDataLoaderSets delegate which is used to get the total count of items.- Specified by:
- setTotalCountDelegatein interface- PaginationDataLoader
- Parameters:
- totalCountDelegate- function that takes current- DataLoadContextof loader and return calculated total count
 
 
-