org.openide.nodes.Node.getHandle()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(79)

本文整理了Java中org.openide.nodes.Node.getHandle()方法的一些代码示例,展示了Node.getHandle()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getHandle()方法的具体详情如下:
包路径:org.openide.nodes.Node
类名称:Node
方法名:getHandle

Node.getHandle介绍

[英]Obtain handle for this node (for serialization). The handle can be serialized and Handle#getNode used after deserialization to obtain the original node.
[中]

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-nodes

/** Takes array of nodes and creates array of handles. The nodes that do not
* have handles are not included in the resulting array.
*
* @param nodes array of nodes
* @return array of Node.Handles
*/
public static Node.Handle[] toHandles(Node[] nodes) {
  List<Node.Handle> ll = new LinkedList<Node.Handle>();
  for (Node n : nodes) {
    Node.Handle h = n.getHandle();
    if (h != null) {
      ll.add(h);
    }
  }
  return ll.toArray(new Node.Handle[ll.size()]);
}

代码示例来源:origin: org.netbeans.api/org-openide-nodes

/** If this is FilterNode without any changes (subclassed, changed children)
* and the original provides handle, stores them and
* returns a new handle for the proxy.
* <p>Subclasses <strong>must</strong> override this if they wish for their nodes to be
* properly serializable.
*
* @return the handle, or <code>null</code> if this node is subclassed or
*    uses changed children
*/
public Node.Handle getHandle() {
  if (!isDefault()) {
    // subclasses has to implement the method by its own
    return null;
  }
  Node.Handle original = this.original.getHandle();
  if (original == null) {
    // no original handle => no handle here
    return null;
  }
  return new FilterHandle(original);
}

代码示例来源:origin: org.netbeans.api/org-openide-nodes

Node.Handle parentHandle = parentNode.getHandle();

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** Takes array of nodes and creates array of handles. The nodes that do not
* have handles are not included in the resulting array.
*
* @param nodes array of nodes
* @return array of Node.Handles
*/
public static Node.Handle[] toHandles (Node[] nodes) {
  LinkedList ll = new LinkedList ();
  
  for (int i = 0; i < nodes.length; i++) {
    Node.Handle h = nodes[i].getHandle();
    if (h != null) {
      ll.add (h);
    }
  }
  
  return (Node.Handle[])ll.toArray (new Node.Handle[ll.size ()]);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** Takes array of nodes and creates array of handles. The nodes that do not
* have handles are not included in the resulting array.
*
* @param nodes array of nodes
* @return array of Node.Handles
*/
public static Node.Handle[] toHandles (Node[] nodes) {
  LinkedList ll = new LinkedList ();
  
  for (int i = 0; i < nodes.length; i++) {
    Node.Handle h = nodes[i].getHandle();
    if (h != null) {
      ll.add (h);
    }
  }
  
  return (Node.Handle[])ll.toArray (new Node.Handle[ll.size ()]);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide-loaders

public Node.Handle getHandle() {
  return getOriginal().getHandle();
}
// #17920: Index cookie works only when equality works

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** Serialize this top component.
* Subclasses wishing to store state must call the super method, then write to the stream.
* @param out the stream to serialize to
*/
public void writeExternal (ObjectOutput out)
throws IOException {
  out.writeObject(new Short (serialVersion));
  out.writeInt (closeOperation);
  out.writeObject (getName());
  out.writeObject (getToolTipText());
  Node.Handle h = nodeName == null ? null : nodeName.node.getHandle ();
  out.writeObject(h);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** Serialize this top component.
* Subclasses wishing to store state must call the super method, then write to the stream.
* @param out the stream to serialize to
*/
public void writeExternal (ObjectOutput out)
throws IOException {
  out.writeObject(new Short (serialVersion));
  out.writeInt (closeOperation);
  out.writeObject (getName());
  out.writeObject (getToolTipText());
  Node.Handle h = nodeName == null ? null : nodeName.node.getHandle ();
  out.writeObject(h);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** If this is FilterNode without any changes (subclassed, changed children)
* and the original provides handle, stores them and
* returns a new handle for the proxy.
* <p>Subclasses <strong>must</strong> override this if they wish for their nodes to be
* properly serializable.
*
* @return the handle, or <code>null</code> if this node is subclassed or
*    uses changed children
*/
public Node.Handle getHandle () {
  if (!isDefault ()) {
    // subclasses has to implement the method by its own
    return null;
  }
  Node.Handle original = this.original.getHandle ();
  if (original == null) {
    // no original handle => no handle here
    return null;
  }
  return new FilterHandle (original);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** If this is FilterNode without any changes (subclassed, changed children)
* and the original provides handle, stores them and
* returns a new handle for the proxy.
* <p>Subclasses <strong>must</strong> override this if they wish for their nodes to be
* properly serializable.
*
* @return the handle, or <code>null</code> if this node is subclassed or
*    uses changed children
*/
public Node.Handle getHandle () {
  if (!isDefault ()) {
    // subclasses has to implement the method by its own
    return null;
  }
  Node.Handle original = this.original.getHandle ();
  if (original == null) {
    // no original handle => no handle here
    return null;
  }
  return new FilterHandle (original);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide-loaders

list.add (persistent ? new Pair (type, listener.getHandle ()) : new Pair (type, listener));

代码示例来源:origin: org.netbeans.api/org-openide-explorer

Node.Handle rCH = rootContext.getHandle();
fields.put("root", rCH); // NOI18N

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

Node.Handle rCH = rootContext.getHandle ();
fields.put ("root", rCH); // NOI18N

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

Node.Handle rCH = rootContext.getHandle ();
fields.put ("root", rCH); // NOI18N

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

Node.Handle parentHandle = parentNode.getHandle ();
if (parentHandle == null) return null;
return new DefaultHandle (parentHandle, childPath);

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

Node.Handle parentHandle = parentNode.getHandle ();
if (parentHandle == null) return null;
return new DefaultHandle (parentHandle, childPath);

相关文章

微信公众号

最新文章

更多