Class CmsResultsBackwardsScrollHandler

java.lang.Object
org.opencms.ade.galleries.client.ui.CmsResultsBackwardsScrollHandler
All Implemented Interfaces:
com.google.gwt.event.dom.client.ScrollHandler, com.google.gwt.event.shared.EventHandler

public class CmsResultsBackwardsScrollHandler extends Object implements com.google.gwt.event.dom.client.ScrollHandler
Scroll handler class which loads more items in the front of the search result list when the user scrolls to the top.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
    Flag used to temporarily disable the scroll handler.
    protected int
    The index of the first shown page.
    protected int
    The number of results per page.
    protected List<org.opencms.ade.galleries.shared.CmsResultItemBean>
    The list of search result beans.
    protected CmsResultsTab
    The search results tab.
    protected org.opencms.ade.galleries.shared.CmsGallerySearchBean
    The search bean.
    static final int
    The scroll threshold in pixels.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new handler instance for a given results tab.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks whether more items can be loaded at the front of the list.
    protected void
    loadPage(int pageNum)
    Loads a page with a given index.
    protected void
    Loads the page before the first shown page.
    void
    onScroll(com.google.gwt.event.dom.client.ScrollEvent event)
     
    void
    updateSearchBean(org.opencms.ade.galleries.shared.CmsGallerySearchBean searchBean)
    Updates the handler with a new search bean.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SCROLL_THRESHOLD

      public static final int SCROLL_THRESHOLD
      The scroll threshold in pixels.
      See Also:
    • m_enabled

      protected boolean m_enabled
      Flag used to temporarily disable the scroll handler.
    • m_firstShownPage

      protected int m_firstShownPage
      The index of the first shown page.
    • m_pageSize

      protected int m_pageSize
      The number of results per page.
    • m_resultBeans

      protected List<org.opencms.ade.galleries.shared.CmsResultItemBean> m_resultBeans
      The list of search result beans.
    • m_resultsTab

      The search results tab.
    • m_searchBean

      protected org.opencms.ade.galleries.shared.CmsGallerySearchBean m_searchBean
      The search bean.
  • Constructor Details

    • CmsResultsBackwardsScrollHandler

      Creates a new handler instance for a given results tab.

      Parameters:
      resultsTab - the results tab for which to create the handler
  • Method Details

    • hasMore

      public boolean hasMore()
      Checks whether more items can be loaded at the front of the list.

      Returns:
      true if more items can be loaded at the front of the list
    • onScroll

      public void onScroll(com.google.gwt.event.dom.client.ScrollEvent event)
      Specified by:
      onScroll in interface com.google.gwt.event.dom.client.ScrollHandler
      See Also:
      • ScrollHandler.onScroll(com.google.gwt.event.dom.client.ScrollEvent)
    • updateSearchBean

      public void updateSearchBean(org.opencms.ade.galleries.shared.CmsGallerySearchBean searchBean)
      Updates the handler with a new search bean.

      Parameters:
      searchBean - the search bean
    • loadPage

      protected void loadPage(int pageNum)
      Loads a page with a given index.

      Parameters:
      pageNum - the index of the page to load
    • loadPreviousPage

      protected void loadPreviousPage()
      Loads the page before the first shown page.