Class AbstractPageableView<T>

    • Method Detail

      • getItemModels

        protected Iterator<IModel<T>> getItemModels()
        This method retrieves the subset of models for items in the current page and allows RefreshingView to generate items.
        Specified by:
        getItemModels in class RefreshingView<T>
        Returns:
        iterator over models for items in the current page
      • onBeforeRender

        protected void onBeforeRender()
        Description copied from class: Component
        Called on all visible components before any component is rendered.

        NOTE: If you override this, you *must* call super.onBeforeRender() within your implementation. Because this method is responsible for cascading Component.onBeforeRender() call to its children it is strongly recommended that super call is made at the end of the override.

        Changes to the component tree can be made only before calling super.onBeforeRender().
        Overrides:
        onBeforeRender in class AbstractRepeater
        See Also:
        AbstractRepeater.onBeforeRender()
      • getItemModels

        protected abstract Iterator<IModel<T>> getItemModels​(long offset,
                                                             long size)
        Returns an iterator over models for items in the current page
        Parameters:
        offset - index of first item in this page
        size - number of items that will be shown in the current page
        Returns:
        an iterator over models for items in the current page
      • getItemsPerPage

        public long getItemsPerPage()
        Description copied from interface: IPageableItems
        maximum number of visible items per page
        Specified by:
        getItemsPerPage in interface IPageableItems
        Returns:
        maximum number of items that will be shown per page
      • setItemsPerPage

        public final void setItemsPerPage​(long items)
        Sets the maximum number of items to show per page. The current page will also be set to zero
        Specified by:
        setItemsPerPage in interface IPageableItems
        Parameters:
        items -
      • internalGetItemCount

        protected abstract long internalGetItemCount()
        Returns:
        total item count
      • getRowCount

        public final long getRowCount()
        Get the row count.
        Returns:
        total item count, but 0 if not visible in the hierarchy
        See Also:
        getItemCount()
      • getItemCount

        public final long getItemCount()
        Get the item count. Since dataprovider.size() could potentially be expensive, the item count is cached.
        Specified by:
        getItemCount in interface IPageableItems
        Returns:
        the item count
        See Also:
        getRowCount()
      • setCurrentPage

        public final void setCurrentPage​(long page)
        Description copied from interface: IPageable
        Sets the a page that should be rendered (page number is zero-based)
        Specified by:
        setCurrentPage in interface IPageable
        Parameters:
        page - The page that should be rendered.
        See Also:
        IPageable.setCurrentPage(long)
      • getPageCount

        public long getPageCount()
        Description copied from interface: IPageable
        Gets the total number of pages this pageable object has.
        Specified by:
        getPageCount in interface IPageable
        Returns:
        The total number of pages this pageable object has
        See Also:
        IPageable.getPageCount()
      • getFirstItemOffset

        public long getFirstItemOffset()
        Returns:
        the index of the first visible item in the view
      • getViewSize

        public long getViewSize()
        Returns:
        the number of items visible
      • onDetach

        protected void onDetach()
        Description copied from class: Component
        Called to allow a component to detach resources after use. Overrides of this method MUST call the super implementation, the most logical place to do this is the last line of the override method.
        Overrides:
        onDetach in class MarkupContainer
        See Also:
        Component.onDetach()