Class TableDataProvider<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
PersistentTableDataProvider
TableDataProvider class.
- See Also:
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionTableDataProvider
(int entriesPerPage, TableDataProvider.SortOrder sortOrder, TableDataSource<T> source) Constructor for TableDataProvider.TableDataProvider
(TableDataSource<T> source) Constructor for TableDataProvider. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFilter
(TableDataFilter filter) addFilter.cmdMoveFirst.cmdMoveLast.cmdMoveNext.cmdMovePrevious.int
Getter for the fieldentriesPerPage
.getFilter.getFilterIfPresent
(String... columns) getFilterIfPresent.Getter for the fieldfilters
.getFiltersAsMap.int
getLastPageNumber.getPageNumberCurrent.getPageNumberLast.getPaginatorList.long
getSizeOfDataList.Getter for the fieldsortField
.Getter for the fieldsortOrder
.int
getTxtMoveTo.boolean
hasNextPage.boolean
hasPreviousPage.static <T> TableDataProvider<T>
initDataProvider
(int itemsPerPage, String defaultSortField, TableDataProvider.SortOrder defaultSortOrder, DAOSearchFunction<T> search) initDataProvider.boolean
isFirstPage.boolean
isLastPage.loadList()
loadList.void
removeFilter
(TableDataFilter filter) removeFilter.void
resetAll()
resetAll.protected void
Called ony any changes to the currently listed objects noop - may be implemented by inheriting classesvoid
resetFilters.void
setEntriesPerPage
(int entriesPerPage) Setter for the fieldentriesPerPage
.void
setSortField
(String sortField) Setter for the fieldsortField
.void
setSortOrder
(TableDataProvider.SortOrder sortOrder) Setter for the fieldsortOrder
.void
setTxtMoveTo
(int neueSeite) setTxtMoveTo.void
sortBy
(String sortField, TableDataProvider.SortOrder sortOrder) sortBy.void
sortBy.void
update()
update.
-
Constructor Details
-
TableDataProvider
Constructor for TableDataProvider.
- Parameters:
source
- aTableDataSource
object.
-
TableDataProvider
public TableDataProvider(int entriesPerPage, TableDataProvider.SortOrder sortOrder, TableDataSource<T> source) Constructor for TableDataProvider.
- Parameters:
entriesPerPage
- the number of entries per pagesortOrder
- aTableDataProvider.SortOrder
objectsource
- aTableDataSource
object.
-
-
Method Details
-
initDataProvider
public static <T> TableDataProvider<T> initDataProvider(int itemsPerPage, String defaultSortField, TableDataProvider.SortOrder defaultSortOrder, DAOSearchFunction<T> search) initDataProvider.
- Type Parameters:
T
- a T class- Parameters:
itemsPerPage
- a intdefaultSortField
- aString
objectdefaultSortOrder
- aTableDataProvider.SortOrder
objectsearch
- aDAOSearchFunction
object- Returns:
- a
TableDataProvider
object
-
getPaginatorList
getPaginatorList.
- Returns:
- a
List
object. - Throws:
TableDataSourceException
- if any.
-
loadList
loadList.
- Returns:
- a
Optional
object.
-
getFiltersAsMap
getFiltersAsMap.
- Returns:
- a
Map
object.
-
resetCurrentList
protected void resetCurrentList()Called ony any changes to the currently listed objects noop - may be implemented by inheriting classes -
sortBy
sortBy.
-
sortBy
sortBy.
- Parameters:
sortField
- aString
object.sortOrder
- aTableDataProvider.SortOrder
object.
-
cmdMoveFirst
cmdMoveFirst.
- Returns:
- a
String
object. - Throws:
TableDataSourceException
- if any.
-
cmdMovePrevious
cmdMovePrevious.
- Returns:
- a
String
object. - Throws:
TableDataSourceException
- if any.
-
cmdMoveNext
cmdMoveNext.
- Returns:
- a
String
object. - Throws:
TableDataSourceException
- if any.
-
cmdMoveLast
cmdMoveLast.
- Returns:
- a
String
object. - Throws:
TableDataSourceException
- if any.
-
setTxtMoveTo
setTxtMoveTo.
- Parameters:
neueSeite
- a int.- Throws:
TableDataSourceException
- if any.
-
getTxtMoveTo
public int getTxtMoveTo()getTxtMoveTo.
- Returns:
- a int.
-
getLastPageNumber
public int getLastPageNumber()getLastPageNumber.
- Returns:
- a int.
-
isFirstPage
public boolean isFirstPage()isFirstPage.
- Returns:
- a boolean.
-
isLastPage
public boolean isLastPage()isLastPage.
- Returns:
- a boolean.
-
hasNextPage
public boolean hasNextPage()hasNextPage.
- Returns:
- a boolean.
-
hasPreviousPage
public boolean hasPreviousPage()hasPreviousPage.
- Returns:
- a boolean.
-
getPageNumberCurrent
getPageNumberCurrent.
- Returns:
- a
Long
object.
-
getPageNumberLast
getPageNumberLast.
- Returns:
- a
Long
object.
-
getSizeOfDataList
public long getSizeOfDataList()getSizeOfDataList.
- Returns:
- a long.
-
getSortField
Getter for the field
sortField
.- Returns:
- a
String
object.
-
setSortField
Setter for the field
sortField
.- Parameters:
sortField
- aString
object.
-
getSortOrder
Getter for the field
sortOrder
.- Returns:
- a
TableDataProvider.SortOrder
object.
-
setSortOrder
Setter for the field
sortOrder
.- Parameters:
sortOrder
- aTableDataProvider.SortOrder
object.
-
setEntriesPerPage
public void setEntriesPerPage(int entriesPerPage) Setter for the field
entriesPerPage
.- Parameters:
entriesPerPage
- a int.
-
getEntriesPerPage
public int getEntriesPerPage()Getter for the field
entriesPerPage
.- Returns:
- a int.
-
getFilters
Getter for the field
filters
.- Returns:
- a
List
object.
-
removeFilter
removeFilter.
- Parameters:
filter
- aTableDataFilter
object.
-
resetFilters
public void resetFilters()resetFilters.
-
resetAll
public void resetAll()resetAll.
-
update
public void update()update.
-
getFilter
getFilter.
- Parameters:
columns
- aString
object- Returns:
- a
TableDataFilter
object
-
addFilter
addFilter.
- Parameters:
filter
- aTableDataFilter
object
-
getFilterIfPresent
getFilterIfPresent.
-