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

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

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

Node.reassignTo介绍

[英]Code that reasignes the reference from to parent from its Children to its ChildrenArray.
[中]将“从到父”的引用从其子数组重新分配到其子数组的代码。

代码示例

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

  1. /** Getter method to receive a set of computed nodes.
  2. */
  3. public Node[] nodes() {
  4. if (entrySupport == null) {
  5. // not fully initialize
  6. return null;
  7. }
  8. if (nodes == null) {
  9. nodes = entrySupport.justComputeNodes();
  10. for (int i = 0; i < nodes.length; i++) {
  11. // keeps a hard reference from the children node to this
  12. // so we can be GCed only when child nodes are gone
  13. nodes[i].reassignTo(entrySupport.children, this);
  14. }
  15. // if at least one node => be weak
  16. entrySupport.registerChildrenArray(this, nodes.length > 0);
  17. }
  18. return nodes;
  19. }

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

  1. /** Getter method to receive a set of computed nodes.
  2. */
  3. public Node[] nodes () {
  4. if (children == null) {
  5. // not fully initialize
  6. return null;
  7. }
  8. if (nodes == null) {
  9. nodes = children.justComputeNodes ();
  10. for (int i = 0; i < nodes.length; i++) {
  11. // keeps a hard reference from the children node to this
  12. // so we can be GCed only when child nodes are gone
  13. nodes[i].reassignTo (children, this);
  14. }
  15. // if at least one node => be weak
  16. children.registerChildrenArray (this, nodes.length > 0);
  17. }
  18. return nodes;
  19. }

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

  1. /** Getter method to receive a set of computed nodes.
  2. */
  3. public Node[] nodes () {
  4. if (children == null) {
  5. // not fully initialize
  6. return null;
  7. }
  8. if (nodes == null) {
  9. nodes = children.justComputeNodes ();
  10. for (int i = 0; i < nodes.length; i++) {
  11. // keeps a hard reference from the children node to this
  12. // so we can be GCed only when child nodes are gone
  13. nodes[i].reassignTo (children, this);
  14. }
  15. // if at least one node => be weak
  16. children.registerChildrenArray (this, nodes.length > 0);
  17. }
  18. return nodes;
  19. }

相关文章