org.pm4j.core.pm.impl
Class PmTableColImpl

java.lang.Object
  extended by org.pm4j.core.pm.impl.PmObjectBase
      extended by org.pm4j.core.pm.impl.PmTableColImpl
All Implemented Interfaces:
java.lang.Comparable<PmObject>, PmObject, PmTableCol

public class PmTableColImpl
extends PmObjectBase
implements PmTableCol

Implements the table column PM behavior.

Author:
olaf boede

Nested Class Summary
protected  class PmTableColImpl.CmdSortPm
           
protected static class PmTableColImpl.MetaData
           
 class PmTableColImpl.SortOrderAttr
          Default sort order PM attribute class.
 
Nested classes/interfaces inherited from class org.pm4j.core.pm.impl.PmObjectBase
PmObjectBase.NameBuilder, PmObjectBase.NameBuilderAbsoluteName, PmObjectBase.NameBuilderShortName, PmObjectBase.NameBuilderTitle
 
Nested classes/interfaces inherited from interface org.pm4j.core.pm.PmTableCol
PmTableCol.Filter<T>
 
Field Summary
 PmCommand defaultCmdSort
           
 PmAttrInteger defaultColPosAttr
           
 PmAttrEnum<PmSortOrder> defaultSortOrderAttr
           
 
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
PmTableColImpl(PmTable<?> pmTable)
           
PmTableColImpl(PmTable<?> pmTable, java.util.Comparator<?> rowSortComparator)
           
 
Method Summary
 void accept(PmVisitor visitor)
           
 PmCommand getCmdSort()
           
 PmAttrInteger getColPosAttr()
          Specification and visualization of the column position is supported by the PM attribute provided by this method.
 org.pm4j.core.util.table.ColSizeSpec getPmColSize()
           
 PmTableCol.Filter<?> getRowFilter()
           
 java.util.Comparator<?> getRowSortComparator()
          Provides the configured row sort comparator.
 PmAttrEnum<PmSortOrder> getSortOrderAttr()
          Specification and visualization of the column sort order is supported by the PM attribute provided by this method.
protected  void initMetaData(PmObjectBase.MetaData metaData)
           
protected  PmCommand makeCmdSort()
           
protected  PmObjectBase.MetaData makeMetaData()
          Gets called when the meta data instance for this presentation model is not yet available (first call within the VM live time).
protected  PmAttrEnum<PmSortOrder> makeSortOrderAttr()
          Creates the PM for the sortOrderAttr attribute.
Concrete subclasses may define here their specific sortOrderAttr PM.
 void setRowFilter(PmTableCol.Filter<?> rowFilter)
           
 
Methods inherited from class org.pm4j.core.pm.impl.PmObjectBase
addToPmComposite, canSetPmTitle, clearCachedPmValues, clearPmInvalidValues, compareTo, ensurePmMetaDataInitialization, findAnnotationsInPmHierarchy, getPmConversation, 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, isPmReadonlyImpl, isPmValid, isPmVisible, isPmVisibleImpl, 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.PmObject
canSetPmTitle, compareTo, getPmConversation, getPmIconPath, getPmName, getPmParent, getPmProperty, getPmRelativeName, getPmShortTitle, getPmStyleClasses, getPmTitle, getPmTooltip, isPmEnabled, isPmReadonly, isPmValid, isPmVisible, setPmEnabled, setPmParent, setPmProperty, setPmTitle, setPmVisible
 

Field Detail

defaultSortOrderAttr

public final PmAttrEnum<PmSortOrder> defaultSortOrderAttr

defaultCmdSort

public final PmCommand defaultCmdSort

defaultColPosAttr

public final PmAttrInteger defaultColPosAttr
Constructor Detail

PmTableColImpl

public PmTableColImpl(PmTable<?> pmTable)

PmTableColImpl

public PmTableColImpl(PmTable<?> pmTable,
                      java.util.Comparator<?> rowSortComparator)
Parameters:
pmTable - The table containing this column.
rowSortComparator - A specific row sort comparator. The type of items to compare depends on the kind of PageableCollection container behind the table.
Method Detail

getPmColSize

public org.pm4j.core.util.table.ColSizeSpec getPmColSize()
Specified by:
getPmColSize in interface PmTableCol
Returns:
The column size specification.
May be null if there is no size specified for the column.

getSortOrderAttr

public PmAttrEnum<PmSortOrder> getSortOrderAttr()
Description copied from interface: PmTableCol
Specification and visualization of the column sort order is supported by the PM attribute provided by this method.

Specified by:
getSortOrderAttr in interface PmTableCol
Returns:
The attribute that defines the column sort order.

getCmdSort

public PmCommand getCmdSort()
Specified by:
getCmdSort in interface PmTableCol
Returns:
A command that allows to switch the sort order.

getColPosAttr

public PmAttrInteger getColPosAttr()
Description copied from interface: PmTableCol
Specification and visualization of the column position is supported by the PM attribute provided by this method.

Specified by:
getColPosAttr in interface PmTableCol
Returns:
The position of the column within the table.

makeSortOrderAttr

protected PmAttrEnum<PmSortOrder> makeSortOrderAttr()
Creates the PM for the sortOrderAttr attribute.
Concrete subclasses may define here their specific sortOrderAttr PM.

Returns:
The sortOrderAttr attribute to use.
Should be not visible if this column is not sortable.

makeCmdSort

protected PmCommand makeCmdSort()

accept

public void accept(PmVisitor visitor)
Specified by:
accept in interface PmObject
Overrides:
accept in class PmObjectBase
Parameters:
visitor - A visitor to call back.

getRowSortComparator

public java.util.Comparator<?> getRowSortComparator()
Description copied from interface: PmTableCol
Provides the configured row sort comparator. It no specific comparator is configured, the default implementation simply compares the column specific cell-PMs.

The type of items to compare depends on the kind of PageableCollection container behind the table.

Specified by:
getRowSortComparator in interface PmTableCol
Returns:
The configured comparator or null.

getRowFilter

public PmTableCol.Filter<?> getRowFilter()
Specified by:
getRowFilter in interface PmTableCol

setRowFilter

public void setRowFilter(PmTableCol.Filter<?> rowFilter)

makeMetaData

protected PmObjectBase.MetaData makeMetaData()
Description copied from class: PmObjectBase
Gets called when the meta data instance for this presentation model is not yet available (first call within the VM live time).

Subclasses that provide more specific meta data should override this method to provide their meta data information container.

Specified by:
makeMetaData in class PmObjectBase
Returns:
A static data container for this presentation model.

initMetaData

protected void initMetaData(PmObjectBase.MetaData metaData)
Overrides:
initMetaData in class PmObjectBase