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
Modifier and TypeFieldDescriptionprotected 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
ConstructorDescriptionCmsResultsBackwardsScrollHandler
(CmsResultsTab resultsTab) Creates a new handler instance for a given results tab. -
Method Summary
Modifier and TypeMethodDescriptionboolean
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
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 Details
-
SCROLL_THRESHOLD
The scroll threshold in pixels.- See Also:
-
m_enabled
Flag used to temporarily disable the scroll handler. -
m_firstShownPage
The index of the first shown page. -
m_pageSize
The number of results per page. -
m_resultBeans
The list of search result beans. -
m_resultsTab
The search results tab. -
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
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
- Specified by:
onScroll
in interfacecom.google.gwt.event.dom.client.ScrollHandler
- See Also:
-
ScrollHandler.onScroll(com.google.gwt.event.dom.client.ScrollEvent)
-
loadPage
Loads a page with a given index.- Parameters:
pageNum
- the index of the page to load
-
loadPreviousPage
Loads the page before the first shown page.
-