org.pm4j.core.pm.pageable
Class PmPagerImpl<T_ITEM>

java.lang.Object
  extended by org.pm4j.core.pm.impl.PmObjectBase
      extended by org.pm4j.core.pm.impl.PmDataInputBase
          extended by org.pm4j.core.pm.impl.PmElementBase
              extended by org.pm4j.core.pm.impl.PmBeanBase<PageableCollection<T_ITEM>>
                  extended by org.pm4j.core.pm.pageable.PmPagerImpl<T_ITEM>
Type Parameters:
T_ITEM -
All Implemented Interfaces:
java.lang.Comparable<PmObject>, PmPager, PmBean<PageableCollection<T_ITEM>>, PmDataInput, PmElement, PmObject, PmTreeNode

public class PmPagerImpl<T_ITEM>
extends PmBeanBase<PageableCollection<T_ITEM>>
implements PmPager

Implementation for some standard pager functionality.

Author:
olaf boede

Nested Class Summary
static class PmPagerImpl.PagerVisibility
          The set of standard pager visibility conditions.
static class PmPagerImpl.SelectableItemPm<T_BEAN>
          PM base class for items that support item selection functionality.
 
Nested classes/interfaces inherited from class org.pm4j.core.pm.impl.PmBeanBase
PmBeanBase.MetaData, PmBeanBase.Nested<T_BEAN>
 
Nested classes/interfaces inherited from class org.pm4j.core.pm.impl.PmObjectBase
PmObjectBase.NameBuilder, PmObjectBase.NameBuilderAbsoluteName, PmObjectBase.NameBuilderShortName, PmObjectBase.NameBuilderTitle
 
Field Summary
 PmCommand cmdDeSelectAll
           
 PmCommand cmdDeSelectAllOnPage
           
 PmCommand cmdFirst
           
 PmCommand cmdLast
           
 PmCommand cmdNext
           
 PmCommand cmdPrev
           
 PmCommand cmdSelectAll
           
 PmCommand cmdSelectAllOnPage
           
 PmAttrInteger currentPageIdx
           
 PmLabel itemXtillYofZ
           
 
Fields inherited from class org.pm4j.core.pm.impl.PmObjectBase
pmCacheLog
 
Fields inherited from interface org.pm4j.core.pm.PmObject
STYLE_CLASS_DISABLED, STYLE_CLASS_ERROR, STYLE_CLASS_INFO, STYLE_CLASS_REQUIRED, STYLE_CLASS_WARN
 
Constructor Summary
PmPagerImpl(PmObject parent)
           
 
Method Summary
 PmCommand getCmdDeSelectAll()
           
 PmCommand getCmdDeSelectAllOnPage()
           
 PmCommand getCmdFirstPage()
           
 PmCommand getCmdLastPage()
           
 PmCommand getCmdNextPage()
           
 PmCommand getCmdPrevPage()
           
 PmCommand getCmdSelectAll()
           
 PmCommand getCmdSelectAllOnPage()
           
 PmAttrInteger getCurrentPageIdx()
           
 PmLabel getItemXtillYofZ()
           
 int getNumOfItems()
           
 int getNumOfPages()
           
 int getPageSize()
           
protected  PageableCollection<T_ITEM> getPmBeanImpl()
          Provides an initial empty backing bean if there is none.
 boolean isPmValueChanged()
          The changed state of this element does usually not indicate a real data change Thus it is by default configured to NOT report its changes in isPmValueChanged().
However, this definition may be changed by setting propagateChangedStateToParent to true.
protected  boolean isPmVisibleImpl()
           
 void setPagerVisibility(PmPagerImpl.PagerVisibility pagerVisibility)
           
 void setPageSize(int pageSize)
          Adjusts the page size.
 
Methods inherited from class org.pm4j.core.pm.impl.PmBeanBase
findPmBeanImpl, getPmBean, getPmBeanClass, getPmKey, initMetaData, makeMetaData, setPmBean
 
Methods inherited from class org.pm4j.core.pm.impl.PmElementBase
accept, clearCachedPmValues, findAnnotationsInPmHierarchy, getNodeDetailsPm, getPmAttribute, getPmAttributes, getPmChildNodes, getPmChildNodesImpl, getPmConversation, isPmReadonlyImpl, isPmTreeLeaf, isValidatingOnSetPmValue
 
Methods inherited from class org.pm4j.core.pm.impl.PmDataInputBase
commitBufferedPmChanges, isBufferedPmValueMode, pmValidate, resetPmValues, rollbackBufferedPmChanges
 
Methods inherited from class org.pm4j.core.pm.impl.PmObjectBase
addToPmComposite, canSetPmTitle, clearPmInvalidValues, compareTo, ensurePmMetaDataInitialization, getPmConversationImpl, getPmIconPath, getPmMetaData, getPmMetaDataWithoutPmInitCall, getPmName, getPmParent, getPmProperty, getPmRelativeName, getPmResKey, getPmResKeyBase, getPmResLoaderCtxtClasses, getPmShortTitle, getPmStyleClasses, getPmStyleClassesImpl, getPmTitle, getPmTitleDef, getPmTitleImpl, getPmTooltip, getPmTooltipImpl, getVisiblePmCommands, getVisiblePmCommands, isMetaDataInitialized, isPmEnabled, isPmEnabledImpl, isPmReadonly, isPmValid, isPmVisible, onPmChildStateChange, onPmInit, onPmValueChange, readCacheStrategy, removePmChild, setPmEnabled, setPmParent, setPmProperty, setPmTitle, setPmVisible, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.pm4j.core.pm.PmElement
getPmAttribute, getPmAttributes
 
Methods inherited from interface org.pm4j.core.pm.PmDataInput
commitBufferedPmChanges, isBufferedPmValueMode, pmValidate, resetPmValues, rollbackBufferedPmChanges
 
Methods inherited from interface org.pm4j.core.pm.PmTreeNode
getNodeDetailsPm, getPmChildNodes, isPmTreeLeaf
 
Methods inherited from interface org.pm4j.core.pm.PmObject
accept, canSetPmTitle, compareTo, getPmConversation, getPmIconPath, getPmName, getPmParent, getPmProperty, getPmRelativeName, getPmShortTitle, getPmStyleClasses, getPmTitle, getPmTooltip, isPmEnabled, isPmReadonly, isPmValid, isPmVisible, setPmEnabled, setPmParent, setPmProperty, setPmTitle, setPmVisible
 

Field Detail

cmdFirst

public final PmCommand cmdFirst

cmdPrev

public final PmCommand cmdPrev

cmdNext

public final PmCommand cmdNext

cmdLast

public final PmCommand cmdLast

itemXtillYofZ

public final PmLabel itemXtillYofZ

currentPageIdx

public final PmAttrInteger currentPageIdx

cmdSelectAllOnPage

public final PmCommand cmdSelectAllOnPage

cmdDeSelectAllOnPage

public final PmCommand cmdDeSelectAllOnPage

cmdSelectAll

public final PmCommand cmdSelectAll

cmdDeSelectAll

public final PmCommand cmdDeSelectAll
Constructor Detail

PmPagerImpl

public PmPagerImpl(PmObject parent)
Method Detail

isPmVisibleImpl

protected boolean isPmVisibleImpl()
Overrides:
isPmVisibleImpl in class PmObjectBase

getPageSize

public int getPageSize()
Specified by:
getPageSize in interface PmPager
Returns:
The maximal number of items on a single page.

setPageSize

public void setPageSize(int pageSize)
Description copied from interface: PmPager
Adjusts the page size.

Specified by:
setPageSize in interface PmPager

getNumOfItems

public int getNumOfItems()
Specified by:
getNumOfItems in interface PmPager
Returns:
The total number of items (on all pages).

getNumOfPages

public int getNumOfPages()
Specified by:
getNumOfPages in interface PmPager
Returns:
The total number of pages.

getPmBeanImpl

protected PageableCollection<T_ITEM> getPmBeanImpl()
Provides an initial empty backing bean if there is none.

Overrides:
getPmBeanImpl in class PmBeanBase<PageableCollection<T_ITEM>>
Returns:
The found bean.

isPmValueChanged

public boolean isPmValueChanged()
The changed state of this element does usually not indicate a real data change Thus it is by default configured to NOT report its changes in isPmValueChanged().
However, this definition may be changed by setting propagateChangedStateToParent to true.

Specified by:
isPmValueChanged in interface PmDataInput
Overrides:
isPmValueChanged in class PmDataInputBase
Returns:
true if the value of this PM or one of its composite children was changed.

getCmdFirstPage

public PmCommand getCmdFirstPage()
Specified by:
getCmdFirstPage in interface PmPager
Returns:
A command that navigates to the first page.

getCmdPrevPage

public PmCommand getCmdPrevPage()
Specified by:
getCmdPrevPage in interface PmPager
Returns:
A command that navigates to the previous page.

getCmdNextPage

public PmCommand getCmdNextPage()
Specified by:
getCmdNextPage in interface PmPager
Returns:
A command that navigates to the next page.

getCmdLastPage

public PmCommand getCmdLastPage()
Specified by:
getCmdLastPage in interface PmPager
Returns:
A command that navigates to the last page.

getItemXtillYofZ

public PmLabel getItemXtillYofZ()
Specified by:
getItemXtillYofZ in interface PmPager
Returns:
A label presenting a text like 'Element 5 - 10 of 54'.

getCurrentPageIdx

public PmAttrInteger getCurrentPageIdx()
Specified by:
getCurrentPageIdx in interface PmPager
Returns:
An attribute that can be used to jump to an entered page number.

getCmdSelectAllOnPage

public PmCommand getCmdSelectAllOnPage()
Specified by:
getCmdSelectAllOnPage in interface PmPager
Returns:
A command that allows to select all items on the current page.

getCmdDeSelectAllOnPage

public PmCommand getCmdDeSelectAllOnPage()
Specified by:
getCmdDeSelectAllOnPage in interface PmPager
Returns:
A command that allows to de-select all items on the current page.

getCmdSelectAll

public PmCommand getCmdSelectAll()
Specified by:
getCmdSelectAll in interface PmPager
Returns:
A command that allows to select all items across all pages.

getCmdDeSelectAll

public PmCommand getCmdDeSelectAll()
Specified by:
getCmdDeSelectAll in interface PmPager
Returns:
A command that allows to de-select all items.

setPagerVisibility

public void setPagerVisibility(PmPagerImpl.PagerVisibility pagerVisibility)
Parameters:
pagerVisibility - The pager visibility rule to use.