wicket.extensions.markup.html.repeater.refreshing
Class ReuseIfModelsEqualStrategy
java.lang.Object
wicket.extensions.markup.html.repeater.refreshing.ReuseIfModelsEqualStrategy
- All Implemented Interfaces:
- IItemReuseStrategy, java.io.Serializable
- public class ReuseIfModelsEqualStrategy
- extends java.lang.Object
- implements IItemReuseStrategy
Reuse strategy that will reuse an old item if its model is equal to a model
inside the newModels iterator. Useful when state needs to be kept across
requests for as long as the item is visible within the view.
Notice that the model and not the model object needs to
implement the equals method. Most of the time it is a good idea to forward
the equals call to the object, however if a detachable model is used it is
often enough to compare object ids models point to ( this saves the model
from loading the object).
- Author:
- Igor Vaynberg (ivaynberg)
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReuseIfModelsEqualStrategy
public ReuseIfModelsEqualStrategy()
getInstance
public static IItemReuseStrategy getInstance()
- Returns:
- static instance
getItems
public java.util.Iterator getItems(IItemFactory factory,
java.util.Iterator newModels,
java.util.Iterator existingItems)
- Description copied from interface:
IItemReuseStrategy
- Returns an iterator over items that will be added to the view. The
iterator needs to return all the items because the old ones are removed
prior to the new ones added.
- Specified by:
getItems in interface IItemReuseStrategy
- Parameters:
factory - implementation of IItemFactorynewModels - iterator over models for itemsexistingItems - iterator over child items
- Returns:
- iterator over items that will be added after all the old items
are moved.
- See Also:
IItemReuseStrategy.getItems(wicket.extensions.markup.html.repeater.refreshing.IItemFactory,
java.util.Iterator, java.util.Iterator)
Copyright © 2004-2008 Wicket developers. All Rights Reserved.