org.pm4j.core.pm
Interface PmAttrPmList<T_ITEM_PM extends PmElement>

All Superinterfaces:
java.lang.Comparable<PmObject>, PmAttr<java.util.List<T_ITEM_PM>>, PmDataInput, PmObject, PmTreeNode
All Known Implementing Classes:
PmAttrPmListImpl

public interface PmAttrPmList<T_ITEM_PM extends PmElement>
extends PmAttr<java.util.List<T_ITEM_PM>>, PmTreeNode

Presentation model for sets of elements.

Example: The set of childeren of a person object may be represented by an element set with the name 'children'.

Author:
olaf boede

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.pm4j.core.pm.PmAttr
PmAttr.Converter<T>
 
Field Summary
 
Fields inherited from interface org.pm4j.core.pm.PmObject
STYLE_CLASS_DISABLED, STYLE_CLASS_ERROR, STYLE_CLASS_INFO, STYLE_CLASS_REQUIRED, STYLE_CLASS_WARN
 
Method Summary
 void add(T_ITEM_PM pmElement)
           
 T_ITEM_PM getFirstItem()
           
 boolean getHasVisibleItems()
          For lists that may contain invisible items.
 T_ITEM_PM getLastItem()
           
 int getSize()
           
 java.util.List<T_ITEM_PM> getValueAsList()
          An explicte list value signature.
 java.util.List<T_ITEM_PM> getValueSubset(int fromIdx, int numItems)
          Provides a subset of the whole item set.
 boolean remove(T_ITEM_PM pmElement)
           
 void setValueAsList(java.util.List<T_ITEM_PM> value)
           
 
Methods inherited from interface org.pm4j.core.pm.PmAttr
getFormatString, getMaxLen, getMinLen, getOptionSet, getValue, getValueAsString, getValueLocalized, isPmValueChanged, isRequired, resetPmValues, setPmValueChanged, setValue, setValueAsString
 
Methods inherited from interface org.pm4j.core.pm.PmDataInput
commitBufferedPmChanges, isBufferedPmValueMode, pmValidate, rollbackBufferedPmChanges
 
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
 
Methods inherited from interface org.pm4j.core.pm.PmTreeNode
getNodeDetailsPm, getPmChildNodes, isPmTreeLeaf
 

Method Detail

add

void add(T_ITEM_PM pmElement)

remove

boolean remove(T_ITEM_PM pmElement)

getValueAsList

java.util.List<T_ITEM_PM> getValueAsList()
An explicte list value signature. This signature is required for reflection based frameworks that analyze the method signature for their data binding (e.g. JSF). Such analysis for PmAttr.getValue() will just find out that the method returns an object. The same analysis perfomed on this method will provide the result that the returned value is a list...

Returns:
The list value.

getValueSubset

java.util.List<T_ITEM_PM> getValueSubset(int fromIdx,
                                         int numItems)
Provides a subset of the whole item set.

Parameters:
fromIdx - Index of the first item to get.
numItems - The maximal number of items to get.
Returns:
The subset. May be empty but never null

getFirstItem

T_ITEM_PM getFirstItem()
Returns:
The first list item. null in case of an empty list.

getLastItem

T_ITEM_PM getLastItem()
Returns:
The last list item. null in case of an empty list.

setValueAsList

void setValueAsList(java.util.List<T_ITEM_PM> value)
Parameters:
value - The new list value.
See Also:
getValueAsList()

getSize

int getSize()
Returns:
number of list items provided by #{link PmAttr.getValue().

getHasVisibleItems

boolean getHasVisibleItems()
For lists that may contain invisible items.

Used for very special JSF components (such as t:dataList) which require at least a single dummy element to be able to be refreshed by ajax requests...

Returns:
true if at least a single list item is visible.