Class 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 Detail

      • DataProvider

        public DataProvider​(Function<T,​String> identifier,
                            int pageSize)
    • 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)
      • getId

        public String getId​(T item)
      • getItem

        public T getItem​(String id)
      • getAllItems

        public Iterable<T> getAllItems()
      • getFilteredItems

        public Iterable<T> getFilteredItems()
      • getVisibleItems

        public Iterable<T> getVisibleItems()
      • selectAll

        public void selectAll()
        Selects all items if multiSelect == true. Does not fire selection events.
      • selectVisible

        public void selectVisible()
        Selects all visible items if multiSelect == 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 if select == true.
      • removeFilter

        public void removeFilter​(String id)
      • clearFilters

        public void clearFilters()
      • hasFilters

        public boolean hasFilters()
      • sort

        public void sort​(SortInfo<T> sortInfo)
      • 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)
      • bindDisplay

        public void bindDisplay​(Display<T> display)