Module org.apache.wicket.extensions
Class TreeModelProvider<T>
java.lang.Object
org.apache.wicket.extensions.markup.html.repeater.util.TreeModelProvider<T>
- Type Parameters:
T
- model object type
- All Implemented Interfaces:
Serializable
,ITreeProvider<T>
,IDetachable
,IClusterable
A provider wrapping a Swing
EXPERIMENTAL !
TreeModel
.
EXPERIMENTAL !
- Author:
- svenmeier
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
-
Constructor Summary
ConstructorDescriptionTreeModelProvider
(TreeModel treeModel) Wrap the givenTreeModel
.TreeModelProvider
(TreeModel treeModel, boolean rootVisible) Wrap the givenTreeModel
. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
branchUpdate
(Object branch) protected T
void
detach()
Detaches model after use.getChildren
(T object) Get the children of the given node.getRoots()
Get the roots of the tree.boolean
hasChildren
(T object) Does the given object have children - note that this method may returntrue
even ifITreeProvider.getChildren(Object)
returns an empty iterator.Callback used by the consumer of this tree provider to wrap objects retrieved fromITreeProvider.getRoots()
orITreeProvider.getChildren(Object)
with a model (usually a detachable one).protected void
nodeUpdate
(Object[] nodes) void
update
(AbstractTree<T> tree, AjaxRequestTarget target) Call this method after all change to the wrappedTreeModel
being initiated viaAjaxRequestTarget
.
-
Field Details
-
completeUpdate
-
nodeUpdates
-
branchUpdates
-
-
Constructor Details
-
Method Details
-
getRoots
Description copied from interface:ITreeProvider
Get the roots of the tree.- Specified by:
getRoots
in interfaceITreeProvider<T>
- Returns:
- roots
-
hasChildren
Description copied from interface:ITreeProvider
Does the given object have children - note that this method may returntrue
even ifITreeProvider.getChildren(Object)
returns an empty iterator.- Specified by:
hasChildren
in interfaceITreeProvider<T>
- Parameters:
object
- the node to check for children- Returns:
true
if node has children
-
getChildren
Description copied from interface:ITreeProvider
Get the children of the given node.- Specified by:
getChildren
in interfaceITreeProvider<T>
- Parameters:
object
- node to get children for- Returns:
- children of node
-
cast
-
model
Description copied from interface:ITreeProvider
Callback used by the consumer of this tree provider to wrap objects retrieved fromITreeProvider.getRoots()
orITreeProvider.getChildren(Object)
with a model (usually a detachable one).Important note: The model must implement
Object.equals(Object)
andObject.hashCode()
!- Specified by:
model
in interfaceITreeProvider<T>
- Parameters:
object
- the object that needs to be wrapped- Returns:
- the model representation of the object
-
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 interfaceIDetachable
-
update
Call this method after all change to the wrappedTreeModel
being initiated viaAjaxRequestTarget
.- Parameters:
tree
- the tree utilizing thisITreeProvider
target
- theAjaxRequestTarget
which initiated the changes
-
nodeUpdate
-
branchUpdate
-