Package org.jdesktop.swingx.treetable
Interface MutableTreeTableNode
- All Superinterfaces:
TreeNode
,TreeTableNode
- All Known Implementing Classes:
AbstractMutableTreeTableNode
,DefaultMutableTreeTableNode
Defines the requirements for a tree table node object that can change -- by
adding or removing child nodes, or by changing the contents of a user object
stored in the node.
Note this does not extend MutableTreeNode
to minimize the contract
breakage, cf. TreeNode.getIndex(javax.swing.tree.TreeNode)
.
- Author:
- Karl Schaefer
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionEnumeration<? extends TreeNode>
children()
Returns an enumeration this node's children.void
insert
(MutableTreeTableNode child, int index) Adds thechild
to this node at the specifiedindex
.void
remove
(int index) Removes the child node at the specifiedindex
from this node.void
remove
(MutableTreeTableNode node) Removes the specified childnode
from this node.void
Removes this node from it's parent.void
setParent
(MutableTreeTableNode newParent) Sets the parent of this node tonewParent
.Methods inherited from interface javax.swing.tree.TreeNode
getAllowsChildren, getChildCount, getIndex, isLeaf
Methods inherited from interface org.jdesktop.swingx.treetable.TreeTableNode
getChildAt, getColumnCount, getParent, getUserObject, getValueAt, isEditable, setUserObject, setValueAt
-
Method Details
-
children
Enumeration<? extends TreeNode> children()Returns an enumeration this node's children.- Specified by:
children
in interfaceTreeNode
- Specified by:
children
in interfaceTreeTableNode
- Returns:
- an enumeration of
MutableTreeTableNode
s
-
insert
Adds thechild
to this node at the specifiedindex
. This method callssetParent
onchild
withthis
as the parameter.- Parameters:
child
- the node to add as a childindex
- the index of the child- Throws:
IndexOutOfBoundsException
- ifindex
is not a valid index
-
remove
void remove(int index) Removes the child node at the specifiedindex
from this node. This method callssetParent
onchild
with anull
parameter.- Parameters:
index
- the index of the child- Throws:
IndexOutOfBoundsException
- ifindex
is not a valid index
-
remove
Removes the specified childnode
from this node. This method callssetParent
onchild
with anull
parameter.- Parameters:
node
- the index of the child
-
removeFromParent
void removeFromParent()Removes this node from it's parent. Most implementations will usegetParent().remove(this)
.- Throws:
NullPointerException
- ifgetParent()
returnsnull
-
setParent
Sets the parent of this node tonewParent
. This methods remove the node from its old parent.- Parameters:
newParent
- the new parent for this node
-