站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 4.1.0

DefaultHandle (NetBeans APIs) - NetBeans API Javadoc 4.1.0


org.openide.nodes
Class DefaultHandle

java.lang.Object
  extended byorg.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

Method Summary
static DefaultHandle createHandle(Node node)
          Create a handle for a given node.
 Node getNode()
          Find the node.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

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 recreated
NodeNotFoundException - 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:
  1. The node has no name.
  2. The node has no parent.
  3. The parent has no handle.
  4. 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()


Built on May 4 2005.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.