|
Copyright 2012-02-25 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface MutableTreeModel
Speficies the requirements for a mutable tree model.
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.
| Method Summary | |
|---|---|
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. |
| Methods inherited from interface javax.swing.tree.TreeModel |
|---|
addTreeModelListener, getChild, getChildCount, getIndexOfChild, getRoot, isLeaf, removeTreeModelListener, valueForPathChanged |
| Method Detail |
|---|
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.IllegalStateException
boolean 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.UnsupportedFlavorException
java.io.IOException
|
Copyright 2012-02-25 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||