public class NamedTreeNode<E extends NamedObject> extends java.lang.Object implements javax.swing.tree.TreeNode, java.lang.Comparable<NamedTreeNode<E>>, java.io.Serializable
JTree.| Constructor and Description |
|---|
NamedTreeNode()
Create a root node.
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(NamedObject namedObject)
Append a node.
|
java.util.Enumeration<NamedTreeNode<E>> |
children() |
int |
compareTo(NamedTreeNode<E> o) |
boolean |
equals(java.lang.Object obj) |
boolean |
getAllowsChildren() |
javax.swing.tree.TreeNode |
getChildAt(int childIndex) |
int |
getChildCount() |
int |
getIndex(javax.swing.tree.TreeNode node) |
java.lang.String |
getName()
Returns the name.
|
NamedObject |
getNamedObject()
Returns the AbstractNamedObject of this node.
|
NamedTreeNode<E> |
getParent() |
javax.swing.tree.TreePath |
getPathFor(java.lang.String path)
Get the path for a node.
|
int |
hashCode() |
boolean |
isLeaf() |
java.lang.String |
toString() |
public NamedTreeNode()
append(NamedObject).public void append(@NotNull
NamedObject namedObject)
throws IllegalNamedObjectException
namedObject - the node to appendIllegalNamedObjectException - if the named object cannot be added@Nullable public NamedObject getNamedObject()
nullnull for dir
nodes@NotNull public java.lang.String getName()
@NotNull public java.util.Enumeration<NamedTreeNode<E>> children()
children in interface javax.swing.tree.TreeNodepublic boolean getAllowsChildren()
getAllowsChildren in interface javax.swing.tree.TreeNodeisDir()@NotNull public javax.swing.tree.TreeNode getChildAt(int childIndex)
getChildAt in interface javax.swing.tree.TreeNodepublic int getChildCount()
getChildCount in interface javax.swing.tree.TreeNodepublic int getIndex(@NotNull
javax.swing.tree.TreeNode node)
getIndex in interface javax.swing.tree.TreeNode@Nullable public NamedTreeNode<E> getParent()
getParent in interface javax.swing.tree.TreeNodepublic boolean isLeaf()
isLeaf in interface javax.swing.tree.TreeNodetrue for face nodes, false for directory nodespublic boolean equals(@Nullable
java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int compareTo(@NotNull
NamedTreeNode<E> o)
compareTo in interface java.lang.Comparable<NamedTreeNode<E extends NamedObject>>@NotNull
public javax.swing.tree.TreePath getPathFor(@NotNull
java.lang.String path)
path - the String specifying the node@NotNull public java.lang.String toString()
toString in class java.lang.Object