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

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

本文整理了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

  1. /** Takes array of nodes and creates array of handles. The nodes that do not
  2. * have handles are not included in the resulting array.
  3. *
  4. * @param nodes array of nodes
  5. * @return array of Node.Handles
  6. */
  7. public static Node.Handle[] toHandles(Node[] nodes) {
  8. List<Node.Handle> ll = new LinkedList<Node.Handle>();
  9. for (Node n : nodes) {
  10. Node.Handle h = n.getHandle();
  11. if (h != null) {
  12. ll.add(h);
  13. }
  14. }
  15. return ll.toArray(new Node.Handle[ll.size()]);
  16. }

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

  1. /** If this is FilterNode without any changes (subclassed, changed children)
  2. * and the original provides handle, stores them and
  3. * returns a new handle for the proxy.
  4. * <p>Subclasses <strong>must</strong> override this if they wish for their nodes to be
  5. * properly serializable.
  6. *
  7. * @return the handle, or <code>null</code> if this node is subclassed or
  8. * uses changed children
  9. */
  10. public Node.Handle getHandle() {
  11. if (!isDefault()) {
  12. // subclasses has to implement the method by its own
  13. return null;
  14. }
  15. Node.Handle original = this.original.getHandle();
  16. if (original == null) {
  17. // no original handle => no handle here
  18. return null;
  19. }
  20. return new FilterHandle(original);
  21. }

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

  1. Node.Handle parentHandle = parentNode.getHandle();

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

  1. /** Takes array of nodes and creates array of handles. The nodes that do not
  2. * have handles are not included in the resulting array.
  3. *
  4. * @param nodes array of nodes
  5. * @return array of Node.Handles
  6. */
  7. public static Node.Handle[] toHandles (Node[] nodes) {
  8. LinkedList ll = new LinkedList ();
  9. for (int i = 0; i < nodes.length; i++) {
  10. Node.Handle h = nodes[i].getHandle();
  11. if (h != null) {
  12. ll.add (h);
  13. }
  14. }
  15. return (Node.Handle[])ll.toArray (new Node.Handle[ll.size ()]);
  16. }

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

  1. /** Takes array of nodes and creates array of handles. The nodes that do not
  2. * have handles are not included in the resulting array.
  3. *
  4. * @param nodes array of nodes
  5. * @return array of Node.Handles
  6. */
  7. public static Node.Handle[] toHandles (Node[] nodes) {
  8. LinkedList ll = new LinkedList ();
  9. for (int i = 0; i < nodes.length; i++) {
  10. Node.Handle h = nodes[i].getHandle();
  11. if (h != null) {
  12. ll.add (h);
  13. }
  14. }
  15. return (Node.Handle[])ll.toArray (new Node.Handle[ll.size ()]);
  16. }

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

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

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

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

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

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

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

  1. /** If this is FilterNode without any changes (subclassed, changed children)
  2. * and the original provides handle, stores them and
  3. * returns a new handle for the proxy.
  4. * <p>Subclasses <strong>must</strong> override this if they wish for their nodes to be
  5. * properly serializable.
  6. *
  7. * @return the handle, or <code>null</code> if this node is subclassed or
  8. * uses changed children
  9. */
  10. public Node.Handle getHandle () {
  11. if (!isDefault ()) {
  12. // subclasses has to implement the method by its own
  13. return null;
  14. }
  15. Node.Handle original = this.original.getHandle ();
  16. if (original == null) {
  17. // no original handle => no handle here
  18. return null;
  19. }
  20. return new FilterHandle (original);
  21. }

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

  1. /** If this is FilterNode without any changes (subclassed, changed children)
  2. * and the original provides handle, stores them and
  3. * returns a new handle for the proxy.
  4. * <p>Subclasses <strong>must</strong> override this if they wish for their nodes to be
  5. * properly serializable.
  6. *
  7. * @return the handle, or <code>null</code> if this node is subclassed or
  8. * uses changed children
  9. */
  10. public Node.Handle getHandle () {
  11. if (!isDefault ()) {
  12. // subclasses has to implement the method by its own
  13. return null;
  14. }
  15. Node.Handle original = this.original.getHandle ();
  16. if (original == null) {
  17. // no original handle => no handle here
  18. return null;
  19. }
  20. return new FilterHandle (original);
  21. }

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

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

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

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

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

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

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

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

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

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

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

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

相关文章