net.databinder.models
Class SublistProjectionModel
java.lang.Object
org.apache.wicket.model.AbstractReadOnlyModel
org.apache.wicket.model.LoadableDetachableModel
net.databinder.models.SublistProjectionModel
- All Implemented Interfaces:
- java.io.Serializable, org.apache.wicket.IClusterable, org.apache.wicket.model.IDetachable, org.apache.wicket.model.IModel
- Direct Known Subclasses:
- SublistProjectionModel.Chunked
public abstract class SublistProjectionModel
- extends org.apache.wicket.model.LoadableDetachableModel
Projects a single list into multiple, arbitrarily transformed sublists without replicating
the list structure. A parent list containing sublists is the object wrapped in this model,
while the master list model passed in is held and used internally.
If you need to detach the master list, detach this model and the command will be
passed to the contained master list. Any action that changes the size of the master
list must also detach this model so it can recalculate the sublist count.
- Author:
- Nathan Hamblen
- See Also:
- Serialized Form
|
Method Summary |
protected java.util.List |
getMasterList()
|
protected abstract int |
getParentSize()
|
protected abstract int |
getSize(int parentIdx)
|
protected java.util.List<java.util.List> |
load()
|
protected void |
onDetach()
Detach master list. |
protected abstract int |
transform(int parentIdx,
int sublistIdx)
|
| Methods inherited from class org.apache.wicket.model.LoadableDetachableModel |
detach, getObject, isAttached, onAttach, toString |
| Methods inherited from class org.apache.wicket.model.AbstractReadOnlyModel |
getObject, setObject |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SublistProjectionModel
public SublistProjectionModel(org.apache.wicket.model.IModel master)
getParentSize
protected abstract int getParentSize()
- Returns:
- number of sublists
transform
protected abstract int transform(int parentIdx,
int sublistIdx)
- Returns:
- index of master list mapped to parameters
getSize
protected abstract int getSize(int parentIdx)
- Returns:
- size sublist at given index
getMasterList
protected java.util.List getMasterList()
load
protected java.util.List<java.util.List> load()
- Specified by:
load in class org.apache.wicket.model.LoadableDetachableModel
onDetach
protected void onDetach()
- Detach master list.
- Overrides:
onDetach in class org.apache.wicket.model.LoadableDetachableModel
Copyright © 2005-2008 Nathan Hamblen. All Rights Reserved.