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
FieldsModifier and TypeFieldDescriptionprotected booleanFlag used to temporarily disable the scroll handler.protected intThe index of the first shown page.protected intThe number of results per page.protected List<org.opencms.ade.galleries.shared.CmsResultItemBean> The list of search result beans.protected CmsResultsTabThe search results tab.protected org.opencms.ade.galleries.shared.CmsGallerySearchBeanThe search bean.static final intThe scroll threshold in pixels. -
Constructor Summary
ConstructorsConstructorDescriptionCmsResultsBackwardsScrollHandler(CmsResultsTab resultsTab) Creates a new handler instance for a given results tab. -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasMore()Checks whether more items can be loaded at the front of the list.protected voidloadPage(int pageNum) Loads a page with a given index.protected voidLoads the page before the first shown page.voidonScroll(com.google.gwt.event.dom.client.ScrollEvent event) voidupdateSearchBean(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:
onScrollin interfacecom.google.gwt.event.dom.client.ScrollHandler- See Also:
-
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.
-