|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openide.nodes.NodeOp
Utility class for operations on nodes.
Method Summary | |
static int[] |
computePermutation(Node[] arr1,
Node[] arr2)
Compute a permutation between two arrays of nodes. |
static String[] |
createPath(Node node,
Node parent)
Find a path (by name) from one node to the root or a parent. |
static Node |
findChild(Node node,
String name)
Look for a node child of given name. |
static JPopupMenu |
findContextMenu(Node[] nodes)
Compute common menu for specified nodes. |
static Node |
findPath(Node start,
Enumeration names)
Traverse a path from a parent node down, by an enumeration of names. |
static Node |
findPath(Node start,
String[] names)
Traverse a path from a parent node down, by an enumeration of names. |
static Node |
findRoot(Node node)
Find the root for a given node. |
static Node[] |
fromHandles(Node.Handle[] handles)
Takes array of handles and creates array of nodes. |
static SystemAction[] |
getDefaultActions()
Get the default actions for all nodes. |
static boolean |
isSon(Node parent,
Node son)
Test whether the second node is a (direct) child of the first one. |
static void |
setDefaultActions(SystemAction[] def)
Deprecated. Useless. |
static Node.Handle[] |
toHandles(Node[] nodes)
Takes array of nodes and creates array of handles. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static SystemAction[] getDefaultActions()
public static void setDefaultActions(SystemAction[] def)
public static JPopupMenu findContextMenu(Node[] nodes)
nodes
- the nodespublic static boolean isSon(Node parent, Node son)
parent
- parent nodeson
- son nodetrue
if sopublic static String[] createPath(Node node, Node parent)
node
- the node to start inparent
- parent node to stop in (can be null
for the root)IllegalArgumentException
- if node
's getName()
method returns null
public static Node findChild(Node node, String name)
node
- node to search inname
- name of child to look fornull
if there is no such childpublic static Node findPath(Node start, Enumeration names) throws NodeNotFoundException
start
- node to start searching atnames
- enumeration of String
s containing names of nodes
along the pathNodeNotFoundException
- if the node with such name
does not exists; the exception contains additional information
about the failure.public static Node findPath(Node start, String[] names) throws NodeNotFoundException
start
- node to start searching atnames
- names of nodes
along the pathNodeNotFoundException
- if the node with such name
does not exists; the exception contains additional information
about the failure.public static Node findRoot(Node node)
node
- the nodepublic static int[] computePermutation(Node[] arr1, Node[] arr2) throws IllegalArgumentException
arr1
- first arrayarr2
- second arraynull
if the arrays are the sameIllegalArgumentException
- if the arrays cannot be permuted to each other. Either
they have different sizes or they do not contain the same elements.public static Node.Handle[] toHandles(Node[] nodes)
nodes
- array of nodespublic static Node[] fromHandles(Node.Handle[] handles) throws IOException
handles
- array of handlesIOException
- if a node cannot be created from the handle
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |