Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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 `MutableTreeNode` to minimize the contract breakage, cf. `TreeNode.getIndex(javax.swing.tree.TreeNode)`.

Author:
  Karl Schaefer
See Also:
  `MutableTreeNode`

Method Summary
`java.util.Enumeration<? extends MutableTreeTableNode>` | `children()` Returns an enumeration this node's children.
`void` | `insert(MutableTreeTableNode child, int index)` Adds the `child` to this node at the specified `index`.
`void` | `remove(int index)` Removes the child node at the specified `index` from this node.
`void` | `remove(MutableTreeTableNode node)` Removes the specified child `node` from this node.
`void` | `removeFromParent()` Removes this node from it's parent.
`void` | `setParent(MutableTreeTableNode newParent)` Sets the parent of this node to `newParent`.

Methods inherited from interface org.jdesktop.swingx.treetable.TreeTableNode
`getChildAt, getColumnCount, getParent, getUserObject, getValueAt, isEditable, setUserObject, setValueAt`

Methods inherited from interface javax.swing.tree.TreeNode
`getAllowsChildren, getChildCount, getIndex, isLeaf`

Method Detail

### children

    java.util.Enumeration<? extends MutableTreeTableNode> children()

  Returns an enumeration this node's children.

  Specified by:
    `children` in interface `javax.swing.tree.TreeNode`
  Specified by:
    `children` in interface `TreeTableNode`
  Returns:
    an enumeration of `TreeTableNode`s

### insert

    void insert(MutableTreeTableNode child,
                int index)

  Adds the `child` to this node at the specified `index`. This method calls `setParent` on `child` with `this` as the parameter.

  Parameters:
    `child` - the node to add as a child
    `index` - the index of the child
  Throws:
    `java.lang.IndexOutOfBoundsException` - if `index` is not a valid index

### remove

    void remove(int index)

  Removes the child node at the specified `index` from this node. This method calls `setParent` on `child` with a `null` parameter.

  Parameters:
    `index` - the index of the child
  Throws:
    `java.lang.IndexOutOfBoundsException` - if `index` is not a valid index

### remove

    void remove(MutableTreeTableNode node)

  Removes the specified child `node` from this node. This method calls `setParent` on `child` with a `null` parameter.

  Parameters:
    `node` - the index of the child

### removeFromParent

    void removeFromParent()

  Removes this node from it's parent. Most implementations will use `getParent().remove(this)`.

  Throws:
    `java.lang.NullPointerException` - if `getParent()` returns `null`

### setParent

    void setParent(MutableTreeTableNode newParent)

  Sets the parent of this node to `newParent`. This methods remove the node from its old parent.

  Parameters:
    `newParent` - the new parent for this node

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010. All Rights Reserved.