Package org.jdesktop.swingx.treetable
Interface MutableTreeTableNode
-
- All Superinterfaces:
javax.swing.tree.TreeNode,TreeTableNode
- All Known Implementing Classes:
AbstractMutableTreeTableNode,DefaultMutableTreeTableNode
public interface MutableTreeTableNode extends TreeTableNode
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
MutableTreeNodeto minimize the contract breakage, cf.TreeNode.getIndex(javax.swing.tree.TreeNode).- See Also:
MutableTreeNode
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Enumeration<? extends MutableTreeTableNode>children()Returns an enumeration this node's children.voidinsert(MutableTreeTableNode child, int index)Adds thechildto this node at the specifiedindex.voidremove(int index)Removes the child node at the specifiedindexfrom this node.voidremove(MutableTreeTableNode node)Removes the specified childnodefrom this node.voidremoveFromParent()Removes this node from it's parent.voidsetParent(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 Detail
-
children
java.util.Enumeration<? extends MutableTreeTableNode> children()
Returns an enumeration this node's children.- Specified by:
childrenin interfacejavax.swing.tree.TreeNode- Specified by:
childrenin interfaceTreeTableNode- Returns:
- an enumeration of
TreeTableNodes
-
insert
void insert(MutableTreeTableNode child, int index)
Adds thechildto this node at the specifiedindex. This method callssetParentonchildwiththisas the parameter.- Parameters:
child- the node to add as a childindex- the index of the child- Throws:
java.lang.IndexOutOfBoundsException- ifindexis not a valid index
-
remove
void remove(int index)
Removes the child node at the specifiedindexfrom this node. This method callssetParentonchildwith anullparameter.- Parameters:
index- the index of the child- Throws:
java.lang.IndexOutOfBoundsException- ifindexis not a valid index
-
remove
void remove(MutableTreeTableNode node)
Removes the specified childnodefrom this node. This method callssetParentonchildwith anullparameter.- Parameters:
node- the index of the child
-
removeFromParent
void removeFromParent()
Removes this node from it's parent. Most implementations will usegetParent().remove(this).- Throws:
java.lang.NullPointerException- ifgetParent()returnsnull
-
setParent
void setParent(MutableTreeTableNode newParent)
Sets the parent of this node tonewParent. This methods remove the node from its old parent.- Parameters:
newParent- the new parent for this node
-
-