org.apache.wicket.extensions.markup.html.repeater.tree
Interface ITreeProvider<T>

Type Parameters:
T - the node type
All Superinterfaces:
IClusterable, IDetachable, Serializable
All Known Subinterfaces:
ISortableTreeProvider<T>
All Known Implementing Classes:
FooProvider, SortableTreeProvider, TreeModelProvider

public interface ITreeProvider<T>
extends IDetachable

Provider of a tree. You can use the IDetachable.detach() method for cleaning up your ITreeProvider instance.

Author:
svenmeier
See Also:
IDetachable, AbstractTree

Method Summary
 Iterator<? extends T> getChildren(T node)
          Get the children of the given node.
 Iterator<? extends T> getRoots()
          Get the roots of the tree.
 boolean hasChildren(T node)
          Does the given object have children - note that this method may return true even if getChildren(Object) returns an empty iterator.
 IModel<T> model(T object)
          Callback used by the consumer of this tree provider to wrap objects retrieved from getRoots() or getChildren(Object) with a model (usually a detachable one).
 
Methods inherited from interface org.apache.wicket.model.IDetachable
detach
 

Method Detail

getRoots

Iterator<? extends T> getRoots()
Get the roots of the tree.

Returns:
roots

hasChildren

boolean hasChildren(T node)
Does the given object have children - note that this method may return true even if getChildren(Object) returns an empty iterator.

Parameters:
node - the node to check for children
Returns:
true if node has children

getChildren

Iterator<? extends T> getChildren(T node)
Get the children of the given node.

Parameters:
node - node to get children for
Returns:
children of node

model

IModel<T> model(T object)
Callback used by the consumer of this tree provider to wrap objects retrieved from getRoots() or getChildren(Object) with a model (usually a detachable one).

Important note: The model must implement Object.equals(Object) and Object.hashCode() !

Parameters:
object - the object that needs to be wrapped
Returns:
the model representation of the object


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