wicket.extensions.markup.html.repeater.data
Class ListDataProvider

java.lang.Object
  extended bywicket.extensions.markup.html.repeater.data.ListDataProvider
All Implemented Interfaces:
IDataProvider, java.io.Serializable

public class ListDataProvider
extends java.lang.Object
implements IDataProvider

Allows the use of lists with dataview. The only requirement is that either list items must be serializable or model(Object) needs to be overridden to provide the proper model implementation.

Author:
Igor Vaynberg ( ivaynberg )
See Also:
Serialized Form

Constructor Summary
ListDataProvider(java.util.List list)
           
 
Method Summary
 java.util.Iterator iterator(int first, int count)
          Gets an iterator for the subset of total data
 wicket.model.IModel model(java.lang.Object object)
          Callback used by the consumer of this data provider to wrap objects retrieved from iterator(int, int) with a model (usually a detachable one).
 int size()
          Gets total number of items in the collection represented by the DataProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListDataProvider

public ListDataProvider(java.util.List list)
Parameters:
list - the list used as dataprovider for the dataview
Method Detail

iterator

public java.util.Iterator iterator(int first,
                                   int count)
Description copied from interface: IDataProvider
Gets an iterator for the subset of total data

Specified by:
iterator in interface IDataProvider
Parameters:
first - first row of data
count - minumum number of elements to retrieve
Returns:
iterator capable of iterating over {first, first+count} items
See Also:
IDataProvider.iterator(int, int)

size

public int size()
Description copied from interface: IDataProvider
Gets total number of items in the collection represented by the DataProvider

Specified by:
size in interface IDataProvider
Returns:
total item count
See Also:
IDataProvider.size()

model

public wicket.model.IModel model(java.lang.Object object)
Description copied from interface: IDataProvider
Callback used by the consumer of this data provider to wrap objects retrieved from IDataProvider.iterator(int, int) with a model (usually a detachable one).

Specified by:
model in interface IDataProvider
Parameters:
object - the object that needs to be wrapped
Returns:
the model representation of the object
See Also:
IDataProvider.model(Object)


Copyright © 2004-2008 Wicket developers. All Rights Reserved.