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 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.
-
Constructor Summary
Constructors Constructor Description CmsResultsBackwardsScrollHandler(CmsResultsTab resultsTab)
Creates a new handler instance for a given results tab.
-
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.
-
-
-
Field Detail
-
SCROLL_THRESHOLD
public static final int SCROLL_THRESHOLD
The scroll threshold in pixels.- See Also:
- Constant Field Values
-
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_resultsTab
protected CmsResultsTab m_resultsTab
The search results tab.
-
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 interfacecom.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.
-
-