|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | 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 Action[] |
findActions(Node[] nodes)
Asks the provided nodes for their actions and those that are common, to all of them returns. |
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()
Deprecated. Do not use this method. It is useless now. |
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. |
static NodeListener |
weakNodeListener(NodeListener l,
Object source)
Creates a weak implementation of NodeListener. |
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 nodes
public static Action[] findActions(Node[] nodes)
nodes
- array of nodes to compose actions for
public static boolean isSon(Node parent, Node son)
parent
- parent nodeson
- son node
true
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 for
null
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 path
NodeNotFoundException
- 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 path
NodeNotFoundException
- 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 node
public static int[] computePermutation(Node[] arr1, Node[] arr2) throws IllegalArgumentException
arr1
- first arrayarr2
- second array
null
if the arrays are the same
IllegalArgumentException
- 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 nodes
public static Node[] fromHandles(Node.Handle[] handles) throws IOException
handles
- array of handles
IOException
- if a node cannot be created from the handlepublic static NodeListener weakNodeListener(NodeListener l, Object source)
l
- the listener to delegate tosource
- the source that the listener should detach from when
listener l
is freed, can be null
l
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |