Package com.inmethod.grid.common
Class AbstractPageableView<T>
- Type Parameters:
T- row/item model object type
- All Implemented Interfaces:
Serializable,Iterable<Component>,IEventSink,IEventSource,IFeedbackContributor,IConverterLocator,IMetadataContext<Serializable,,Component> IHeaderContributor,IPageable,IRequestableComponent,IHierarchical<Component>,IClusterable
Wicket
AbstractPageableView alternative that uses
IDataSource as data source. Compared to Wicket
AbstractPageableView this component allows paging
without knowing the total number of rows.- Author:
- Matej Knopp
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longConstant for unknown count of rows.Fields inherited from class org.apache.wicket.Component
ENABLE, FLAG_INITIALIZED, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING, RFLAG_CONTAINER_HAS_REMOVALS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclears the queryResult so the next use will be forced to re-initializelongintReturns the count of items on current page.protected abstract IDataSource<T>longGets the total number of pages this pageable object has.protected abstract longprotected abstract IGridSortStatelongReturns the total count of items (sum of count of items on all pages) orUNKNOWN_COUNTin case the count can't be determined.protected voidprotected voidonDetach()CleanupvoidsetCurrentPage(long page) Sets the a page that should be rendered.voidsetMaxFirstItemReached(long maxFirstItemReached) You should never need this method unless your pagingNavigator uses pageParametres and dataSource is with unknown item countprotected IDataSource.IQuerywrapQuery(IDataSource.IQuery original) Allows to wrap created query.Methods inherited from class org.apache.wicket.markup.repeater.RefreshingView
addItems, getItemReuseStrategy, getItems, newItem, newItemFactory, onPopulate, populateItem, setItemReuseStrategyMethods inherited from class org.apache.wicket.markup.repeater.RepeatingView
newChildId, renderIteratorMethods inherited from class org.apache.wicket.markup.repeater.AbstractRepeater
dequeue, getMarkup, onRender, renderChildMethods inherited from class org.apache.wicket.markup.html.WebMarkupContainer
getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSessionMethods inherited from class org.apache.wicket.MarkupContainer
add, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeuePreamble, findChildComponent, findComponentToDequeue, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkupType, getRegionMarkup, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onComponentTagBody, onInitialize, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, stream, streamChildren, toString, toString, visitChildren, visitChildrenMethods inherited from class org.apache.wicket.Component
add, addStateChange, beforeRender, canCallListener, canCallListenerAfterExpiry, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, configure, continueToOriginalDestination, createConverter, debug, detach, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMarkupTag, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnModelChanged, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isInitialized, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, newMarkupSourcingStrategy, onAfterRender, onComponentTag, onConfigure, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderPart, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlForListener, urlForListener, visitParents, visitParents, warn, wrapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
UNKNOWN_COUNT
public static final long UNKNOWN_COUNTConstant for unknown count of rows.- See Also:
-
-
Constructor Details
-
AbstractPageableView
Constructor,- Parameters:
id-model-
-
AbstractPageableView
Constructor.- Parameters:
id-
-
-
Method Details
-
getTotalRowCount
public long getTotalRowCount()Returns the total count of items (sum of count of items on all pages) orUNKNOWN_COUNTin case the count can't be determined.- Returns:
- total count of items or -1L
-
getCurrentPageItemCount
public int getCurrentPageItemCount()Returns the count of items on current page.- Returns:
- count of items on current page
-
getCurrentPage
public long getCurrentPage()- Specified by:
getCurrentPagein interfaceIPageable- Returns:
- The current page that is or will be rendered.
-
onBeforeRender
protected void onBeforeRender()- Overrides:
onBeforeRenderin classAbstractRepeater
-
getPageCount
public long getPageCount()Gets the total number of pages this pageable object has.- Specified by:
getPageCountin interfaceIPageable- Returns:
- The total number of pages this pageable object has
-
setCurrentPage
public void setCurrentPage(long page) Sets the a page that should be rendered.- Specified by:
setCurrentPagein interfaceIPageable- Parameters:
page- The page that should be rendered.
-
setMaxFirstItemReached
public void setMaxFirstItemReached(long maxFirstItemReached) You should never need this method unless your pagingNavigator uses pageParametres and dataSource is with unknown item count- Parameters:
maxFirstItemReached-
-
clearCache
public void clearCache()clears the queryResult so the next use will be forced to re-initialize -
wrapQuery
Allows to wrap created query.- Parameters:
original-- Returns:
-
onDetach
protected void onDetach()Cleanup- Overrides:
onDetachin classMarkupContainer
-
getSortState
-
getDataSource
-
getRowsPerPage
protected abstract long getRowsPerPage() -
getItemModels
- Specified by:
getItemModelsin classRefreshingView<T>- See Also:
-