org.apache.wicket.extensions.markup.html.repeater.tree.table
Class TreeDataProvider<T>

java.lang.Object
  extended by org.apache.wicket.extensions.markup.html.repeater.tree.table.TreeDataProvider<T>
Type Parameters:
T - node type
All Implemented Interfaces:
Serializable, ITreeDataProvider<T>, IDataProvider<T>, IDetachable, IClusterable

public abstract class TreeDataProvider<T>
extends Object
implements ITreeDataProvider<T>

An adapter of a ITreeProvider to a IDataProvider.

Author:
svenmeier
See Also:
Serialized Form

Constructor Summary
TreeDataProvider(ITreeProvider<T> provider)
          Construct.
 
Method Summary
 void detach()
          Detaches model after use.
protected abstract  boolean iterateChildren(T node)
          Hook method to decide wether the given node's children should be iterated.
 Iterator<? extends T> iterator(long first, long count)
          Gets an iterator for the subset of total data
 NodeModel<T> model(T object)
          Wrap the given node in a NodeModel which provides additional branch information needed by TreeColumn.
 long 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

TreeDataProvider

public TreeDataProvider(ITreeProvider<T> provider)
Construct.

Parameters:
provider - the provider to adapt
Method Detail

size

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

Specified by:
size in interface IDataProvider<T>
Returns:
total item count

iterator

public Iterator<? extends T> iterator(long first,
                                      long count)
Description copied from interface: IDataProvider
Gets an iterator for the subset of total data

Specified by:
iterator in interface IDataProvider<T>
Parameters:
first - first row of data
count - minimum number of elements to retrieve
Returns:
iterator capable of iterating over {first, first+count} items

iterateChildren

protected abstract boolean iterateChildren(T node)
Hook method to decide wether the given node's children should be iterated.

Parameters:
node - node
Returns:
true if the node's children should be iterated

model

public NodeModel<T> model(T object)
Description copied from interface: ITreeDataProvider
Wrap the given node in a NodeModel which provides additional branch information needed by TreeColumn.

Specified by:
model in interface ITreeDataProvider<T>
Specified by:
model in interface IDataProvider<T>
Parameters:
object - node
Returns:
the model representation of the object

detach

public void detach()
Description copied from interface: IDetachable
Detaches model after use. This is generally used to null out transient references that can be re-attached later.

Specified by:
detach in interface IDetachable


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.