public interface MutableTreeModel
extends javax.swing.tree.TreeModel
The mutable list model adds suport for the following operations
to the javax.swing.tree.TreeModel interface:
javax.swing.Action's
for a group of elementsjava.awt.transfer.Transferable.| Modifier and Type | Method and Description |
|---|---|
javax.swing.tree.TreePath |
createNodeAt(java.lang.Object type,
javax.swing.tree.MutableTreeNode parent,
int index)
Creates the specified element type at the specified position in this list
Shifts the element currently at that position (if any) and any
subsequent elements to the right (adds one to their indices).
|
java.awt.datatransfer.Transferable |
exportTransferable(javax.swing.tree.MutableTreeNode[] nodes)
Creates a Transferable to use as the source for a data
transfer of the specified elements.
|
java.lang.Object |
getCreatableNodeType(java.lang.Object parent)
Returns the default type of children that can be created at
the specified node.
|
java.lang.Object[] |
getCreatableNodeTypes(java.lang.Object parent)
Returns the types of children that may be created at this node.
|
javax.swing.Action[] |
getNodeActions(javax.swing.tree.MutableTreeNode[] nodes)
Gets actions for the specified nodes.
|
int |
importTransferable(java.awt.datatransfer.Transferable t,
int action,
javax.swing.tree.MutableTreeNode parent,
int index)
Causes a transfer to the model from a clipboard or
a DND drop operation.
|
boolean |
isImportable(java.awt.datatransfer.DataFlavor[] transferFlavors,
int action,
javax.swing.tree.MutableTreeNode parent,
int index)
Indicates whether the model would accept an import of the
given set of data flavors prior to actually attempting
to import it.
|
boolean |
isNodeAddable(javax.swing.tree.MutableTreeNode parent,
int index)
Returns whether a node may be added.
|
boolean |
isNodeEditable(javax.swing.tree.MutableTreeNode node)
Returns wether the specified node may be edited.
|
boolean |
isNodeRemovable(javax.swing.tree.MutableTreeNode node)
Returns whether the specified node may be removed.
|
void |
removeNodeFromParent(javax.swing.tree.MutableTreeNode node)
Message this to remove a child from its parent.
|
java.lang.Object[] getCreatableNodeTypes(java.lang.Object parent)
parent - a node from the tree, obtained from this data source.java.lang.Object getCreatableNodeType(java.lang.Object parent)
parent - a node from the tree, obtained from this data source.javax.swing.tree.TreePath createNodeAt(java.lang.Object type,
javax.swing.tree.MutableTreeNode parent,
int index)
throws java.lang.IllegalStateException
This method may create a node at a different location.
type - the type of the new child to be created, obtained
from getCreatableChildrenparent - a node from the tree, obtained from this data source.index - index of the child.java.lang.IllegalArgumentException - if the type is not contained in
the array returned by getInsertableTypes(int).java.lang.IndexOutOfBoundsException - if the index is out of range
(index < 0 || index > size()).java.lang.IllegalStateExceptionboolean isNodeAddable(javax.swing.tree.MutableTreeNode parent,
int index)
parent - a node from the tree, obtained from this data source.index - the insertion index.boolean isNodeRemovable(javax.swing.tree.MutableTreeNode node)
node - a node from the tree, obtained from this data source.void removeNodeFromParent(javax.swing.tree.MutableTreeNode node)
node - a node from the tree, obtained from this data source.java.lang.IllegalStateException - if the node may not be removed.boolean isNodeEditable(javax.swing.tree.MutableTreeNode node)
node - a node from the tree, obtained from this data source.javax.swing.Action[] getNodeActions(javax.swing.tree.MutableTreeNode[] nodes)
nodes - The nodes.java.awt.datatransfer.Transferable exportTransferable(javax.swing.tree.MutableTreeNode[] nodes)
nodes - The nodes.boolean isImportable(java.awt.datatransfer.DataFlavor[] transferFlavors,
int action,
javax.swing.tree.MutableTreeNode parent,
int index)
transferFlavors - the data formats availableaction - the action, this is either COPY, MOVE or LINK.parent - a node from the tree, obtained from this data source.index - The insertion point.int importTransferable(java.awt.datatransfer.Transferable t,
int action,
javax.swing.tree.MutableTreeNode parent,
int index)
throws java.awt.datatransfer.UnsupportedFlavorException,
java.io.IOException
t - The transfer data.parent - a node from the tree, obtained from this data source.index - The insertion point.java.awt.datatransfer.UnsupportedFlavorExceptionjava.io.IOException