|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.extensions.markup.html.repeater.util.TreeModelProvider<T>
T - model object typepublic abstract class TreeModelProvider<T>
A provider wrapping a Swing TreeModel.
EXPERIMENTAL !
| Field Summary | |
|---|---|
protected List<T> |
branchUpdates
|
protected boolean |
completeUpdate
|
protected List<T> |
nodeUpdates
|
| Constructor Summary | |
|---|---|
TreeModelProvider(TreeModel treeModel)
Wrap the given TreeModel. |
|
TreeModelProvider(TreeModel treeModel,
boolean rootVisible)
Wrap the given TreeModel. |
|
| Method Summary | |
|---|---|
protected void |
branchUpdate(Object branch)
|
protected T |
cast(Object object)
|
void |
detach()
|
Iterator<T> |
getChildren(T object)
Get the children of the given node. |
Iterator<T> |
getRoots()
Get the roots of the tree. |
boolean |
hasChildren(T object)
Does the given object have children - note that this method may return true even
if ITreeProvider.getChildren(Object) returns an empty iterator. |
abstract IModel<T> |
model(T object)
Callback used by the consumer of this tree provider to wrap objects retrieved from ITreeProvider.getRoots() or ITreeProvider.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 wrapped TreeModel being initiated via
AjaxRequestTarget. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean completeUpdate
protected List<T> nodeUpdates
protected List<T> branchUpdates
| Constructor Detail |
|---|
public TreeModelProvider(TreeModel treeModel)
TreeModel.
treeModel - model to wrap
public TreeModelProvider(TreeModel treeModel,
boolean rootVisible)
TreeModel.
treeModel - the wrapped modelrootVisible - should the root be visible| Method Detail |
|---|
public Iterator<T> getRoots()
ITreeProvider
getRoots in interface ITreeProvider<T>public boolean hasChildren(T object)
ITreeProvidertrue even
if ITreeProvider.getChildren(Object) returns an empty iterator.
hasChildren in interface ITreeProvider<T>object - the node to check for children
true if node has childrenpublic Iterator<T> getChildren(T object)
ITreeProvider
getChildren in interface ITreeProvider<T>object - node to get children for
protected T cast(Object object)
public abstract IModel<T> model(T object)
ITreeProviderITreeProvider.getRoots() or ITreeProvider.getChildren(Object) with a model (usually a detachable one).
Important note: The model must implement Object.equals(Object) and
Object.hashCode() !
model in interface ITreeProvider<T>object - the object that needs to be wrapped
public void detach()
detach in interface IDetachable
public void update(AbstractTree<T> tree,
AjaxRequestTarget target)
TreeModel being initiated via
AjaxRequestTarget.
tree - the tree utilizing this ITreeProvidertarget - the AjaxRequestTarget which initiated the changesprotected void nodeUpdate(Object[] nodes)
protected void branchUpdate(Object branch)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||