Class CmsResultsBackwardsScrollHandler

  • All Implemented Interfaces:
    com.google.gwt.event.dom.client.ScrollHandler, com.google.gwt.event.shared.EventHandler

    public class CmsResultsBackwardsScrollHandler
    extends java.lang.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 m_enabled
      Flag used to temporarily disable the scroll handler.
      protected int m_firstShownPage
      The index of the first shown page.
      protected int m_pageSize
      The number of results per page.
      protected java.util.List<org.opencms.ade.galleries.shared.CmsResultItemBean> m_resultBeans
      The list of search result beans.
      protected CmsResultsTab m_resultsTab
      The search results tab.
      protected org.opencms.ade.galleries.shared.CmsGallerySearchBean m_searchBean
      The search bean.
      static int SCROLL_THRESHOLD
      The scroll threshold in pixels.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasMore()
      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 loadPreviousPage()
      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 Detail

      • 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 java.util.List<org.opencms.ade.galleries.shared.CmsResultItemBean> m_resultBeans
        The list of search result beans.
      • m_searchBean

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

      • CmsResultsBackwardsScrollHandler

        public CmsResultsBackwardsScrollHandler​(CmsResultsTab resultsTab)
        Creates a new handler instance for a given results tab.

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

      • 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.