public class TreeNodeModelBase<T extends ITreeNode<T>> extends Object implements ITreeModel<T>
| Constructor and Description |
|---|
TreeNodeModelBase(T root) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChangeListener(ITreeModelChangedListener<T> l)
Add a listener to be called when nodes on the tree change.
|
void |
collapseChildren(T item)
Called when this node's children are to be collapsed.
|
void |
expandChildren(T item)
Called when this node is attempted to be expanded.
|
T |
getChild(T parent,
int index)
Returns the nth child in the parent's list.
|
int |
getChildCount(T item)
Returns the #of children for this object.
|
protected List<ITreeModelChangedListener<T>> |
getListeners() |
T |
getParent(T child)
Get the parent node of a child in the tree.
|
T |
getRoot()
Get the root object of the tree.
|
boolean |
hasChildren(T item)
If possible this should quickly decide if a tree node has children or not.
|
void |
removeChangeListener(ITreeModelChangedListener<T> l)
Remove a registered change listener.
|
public TreeNodeModelBase(T root)
public void addChangeListener(@Nonnull ITreeModelChangedListener<T> l)
ITreeModeladdChangeListener in interface ITreeModel<T extends ITreeNode<T>>public void removeChangeListener(@Nonnull ITreeModelChangedListener<T> l)
ITreeModelremoveChangeListener in interface ITreeModel<T extends ITreeNode<T>>protected List<ITreeModelChangedListener<T>> getListeners()
@Nonnull public T getChild(@Nullable T parent, int index) throws Exception
ITreeModelpublic int getChildCount(@Nullable T item) throws Exception
ITreeModelgetChildCount in interface ITreeModel<T extends ITreeNode<T>>Exception@Nullable public T getParent(@Nullable T child) throws Exception
ITreeModel@Nullable public T getRoot() throws Exception
ITreeModelpublic boolean hasChildren(@Nullable T item) throws Exception
ITreeModelhasChildren in interface ITreeModel<T extends ITreeNode<T>>Exceptionpublic void expandChildren(@Nullable T item) throws Exception
ITreeModelexpandChildren in interface ITreeModel<T extends ITreeNode<T>>Exceptionpublic void collapseChildren(@Nullable T item) throws Exception
ITreeModelcollapseChildren in interface ITreeModel<T extends ITreeNode<T>>ExceptionCopyright © 2017 etc.to. All rights reserved.