org.openide.nodes
Class DefaultHandle
java.lang.Object
|
+--org.openide.nodes.DefaultHandle
- All Implemented Interfaces:
- Node.Handle, Serializable
- public final class DefaultHandle
- extends Object
- implements Node.Handle
Simple implementation of Node.Handle
.
When created by createHandle(org.openide.nodes.Node)
it
looks for the parent of the node and stores the node's name.
When getNode()
is then called, it tries to restore the
parent and then to walk down to the child.
Note that if most nodes use DefaultHandle
, this
may walk up to the root recursively. Otherwise, some other sort
of handle may provide the termination case.
- See Also:
- Serialized Form
getNode
public Node getNode()
throws IOException
- Find the node.
- Specified by:
getNode
in interface Node.Handle
- Returns:
- the found node
- Throws:
IOException
- if the parent cannot be recreatedNodeNotFoundException
- if the path is not valid (exception may be examined for details)
createHandle
public static DefaultHandle createHandle(Node node)
- Create a handle for a given node.
A handle cannot be created under these circumstances:
- The node has no name.
- The node has no parent.
- The parent has no handle.
- The parent is incapable of finding its child by the supplied name.
- Parameters:
node
- the node to create a handler for- Returns:
- the handler, or
null
if a handle cannot be created
toString
public String toString()
- Overrides:
toString
in class Object
Built on December 12 2001. | Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.