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 Summary
Modifier and TypeFieldDescriptionprotected CollectionContainer<?>
protected Consumer<CollectionContainer.CollectionChangeEvent<?>>
protected DataManager
protected BaseCollectionLoader
protected Consumer<CollectionChangeType>
protected Function<LoadContext,
Integer> protected WeakCollectionChangeListener<?>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
int
getCount()
int
int
void
refresh()
Reloads instances.void
Removes collection change listener.void
Sets collection change listener.void
setDataManager
(DataManager dataManager) void
setFirstResult
(int startPosition) Sets the position of the first instance to load.void
setMaxResults
(int maxResults) Sets maximum number of instances to load.void
setTotalCountDelegate
(Function<LoadContext, Integer> totalCountDelegate) Sets delegate which is used to get the total count of items.int
size()
-
Field Details
-
dataManager
-
container
-
loader
-
refreshListener
-
weakContainerCollectionChangeListener
-
containerCollectionChangeListener
-
totalCountDelegate
-
-
Constructor Details
-
PaginationDataLoaderImpl
-
-
Method Details
-
attachCollectionChangeListener
protected void attachCollectionChangeListener() -
setDataManager
-
getFirstResult
public int getFirstResult()- Specified by:
getFirstResult
in interfacePaginationDataLoader
- Returns:
- first position to load
-
setFirstResult
public void setFirstResult(int startPosition) Description copied from interface:PaginationDataLoader
Sets the position of the first instance to load.- Specified by:
setFirstResult
in interfacePaginationDataLoader
-
getMaxResults
public int getMaxResults()- Specified by:
getMaxResults
in interfacePaginationDataLoader
- Returns:
- maximum number of instances to load
-
setMaxResults
public void setMaxResults(int maxResults) Description copied from interface:PaginationDataLoader
Sets maximum number of instances to load.- Specified by:
setMaxResults
in interfacePaginationDataLoader
-
getCount
public int getCount()- Specified by:
getCount
in interfacePaginationDataLoader
- Returns:
- number of instances in the data store
-
size
public int size()- Specified by:
size
in interfacePaginationDataLoader
- Returns:
- number of instances are currently loaded
-
refresh
public void refresh()Description copied from interface:PaginationDataLoader
Reloads instances.- Specified by:
refresh
in interfacePaginationDataLoader
-
removeCollectionChangeListener
public void removeCollectionChangeListener()Description copied from interface:PaginationDataLoader
Removes collection change listener.- Specified by:
removeCollectionChangeListener
in interfacePaginationDataLoader
-
setCollectionChangeListener
Description copied from interface:PaginationDataLoader
Sets collection change listener.- Specified by:
setCollectionChangeListener
in interfacePaginationDataLoader
-
getEntityMetaClass
- Specified by:
getEntityMetaClass
in interfacePaginationDataLoader
- Returns:
- meta class of entity
-
getTotalCountDelegate
- Specified by:
getTotalCountDelegate
in interfacePaginationDataLoader
- Returns:
- total count delegate or
null
otherwise
-
setTotalCountDelegate
Description copied from interface:PaginationDataLoader
Sets delegate which is used to get the total count of items.- Specified by:
setTotalCountDelegate
in interfacePaginationDataLoader
- Parameters:
totalCountDelegate
- function that takes currentLoadContext
of loader and return calculated total count
-