Package org.patternfly.dataprovider
Class DataProvider<T>
- java.lang.Object
-
- org.patternfly.dataprovider.DataProvider<T>
-
public class DataProvider<T> extends Object
Holds items and state for components like data lists and tables. Modifications of items and state are reflected in the bound displays.
-
-
Constructor Summary
Constructors Constructor Description DataProvider(Function<T,String> identifier)DataProvider(Function<T,String> identifier, int pageSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFilter(String id, Predicate<T> filter)voidbindDisplay(Display<T> display)voidclearAllSelection()Clears the selection for all items.voidclearFilters()voidclearVisibleSelection()Clears the selection for all visible items.booleancontains(T item)Iterable<T>getAllItems()Iterable<T>getFilteredItems()StringgetId(T item)Function<T,String>getIdentifier()TgetItem(String id)SelectionInfo<T>getSelectionInfo()Iterable<T>getVisibleItems()voidgotoFirstPage()voidgotoLastPage()voidgotoNextPage()voidgotoPage(int page)voidgotoPreviousPage()booleanhasFilters()booleanisVisible(T item)voidonSelect(SelectHandler<T> selectHandler)voidremoveFilter(String id)voidselect(T item, boolean select)(De)selects the specified item and fires a selection event ifselect == true.voidselectAll()Selects all items ifmultiSelect == true.voidselectVisible()Selects all visible items ifmultiSelect == true.voidsetPageSize(int pageSize)voidsort(SortInfo<T> sortInfo)voidupdate(Iterable<T> items)Replaces the items, resets the paging and selection and applies the current filter and sort order.voidupdate(T[] items)Replaces the items, resets the paging and selection and applies the current filter and sort order.
-
-
-
Method Detail
-
update
public void update(T[] items)
Replaces the items, resets the paging and selection and applies the current filter and sort order.
-
update
public void update(Iterable<T> items)
Replaces the items, resets the paging and selection and applies the current filter and sort order.
-
contains
public boolean contains(T item)
-
isVisible
public boolean isVisible(T item)
-
onSelect
public void onSelect(SelectHandler<T> selectHandler)
-
selectAll
public void selectAll()
Selects all items ifmultiSelect == true. Does not fire selection events.
-
selectVisible
public void selectVisible()
Selects all visible items ifmultiSelect == true. Does not fire selection events.
-
clearAllSelection
public void clearAllSelection()
Clears the selection for all items.
-
clearVisibleSelection
public void clearVisibleSelection()
Clears the selection for all visible items.
-
select
public void select(T item, boolean select)
(De)selects the specified item and fires a selection event ifselect == true.
-
getSelectionInfo
public SelectionInfo<T> getSelectionInfo()
-
removeFilter
public void removeFilter(String id)
-
clearFilters
public void clearFilters()
-
hasFilters
public boolean hasFilters()
-
setPageSize
public void setPageSize(int pageSize)
-
gotoFirstPage
public void gotoFirstPage()
-
gotoPreviousPage
public void gotoPreviousPage()
-
gotoNextPage
public void gotoNextPage()
-
gotoLastPage
public void gotoLastPage()
-
gotoPage
public void gotoPage(int page)
-
-