public abstract class AbstractProvider<T,M extends org.apache.wicket.model.IModel> extends ItemModelWrapper<T>
JcrItemModel
.
It can be used to uniformly manipulate such lists.Modifier and Type | Field and Description |
---|---|
protected LinkedList<M> |
elements |
Constructor and Description |
---|
AbstractProvider(JcrItemModel itemModel) |
Modifier and Type | Method and Description |
---|---|
abstract void |
addNew()
Add a new element.
|
void |
detach() |
abstract ModelPathElement |
getFieldElement(M model)
Retrieve the
ModelPathElement to access an element. |
Iterator<M> |
iterator(int first,
int count)
Iterate over the provided elements.
|
protected void |
load() |
protected abstract void |
loadElements()
Method to be overridden by subclasses, to populate the list of elements.
|
abstract void |
moveUp(M model)
Move a model up one position.
|
void |
refresh()
Force a reloading of items from the session.
|
abstract void |
remove(M model)
Remove a model from the list.
|
void |
setChainedModel(org.apache.wicket.model.IModel model) |
int |
size()
Count the number of elements
|
getChainedModel, getItemModel, getObject, setObject
protected transient LinkedList<M extends org.apache.wicket.model.IModel> elements
public AbstractProvider(JcrItemModel itemModel)
public void refresh()
public void setChainedModel(org.apache.wicket.model.IModel model)
setChainedModel
in interface org.apache.wicket.model.IChainingModel<T>
setChainedModel
in class ItemModelWrapper<T>
public void detach()
detach
in interface org.apache.wicket.model.IDetachable
detach
in class ItemModelWrapper<T>
public Iterator<M> iterator(int first, int count)
first
- count
- public int size()
public abstract void addNew()
public abstract void remove(M model)
model
- the model to removepublic abstract void moveUp(M model)
model
- the model to movepublic abstract ModelPathElement getFieldElement(M model)
ModelPathElement
to access an element.model
- the element to be made accessibleprotected final void load()
protected abstract void loadElements()
Copyright © 2007–2017 Hippo B.V. (http://www.onehippo.com). All rights reserved.