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

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

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

Children.nodes介绍

[英]Get the nodes as an enumeration.
[中]获取节点作为枚举。

代码示例

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial

private Node getNode(Node node, Object obj) {
  Object object = node.getLookup().lookup(obj.getClass());
  if (obj.equals(object)) return node;
  Enumeration children = node.getChildren().nodes();
  while (children.hasMoreElements()) {
    Node child = (Node) children.nextElement();
    Node result = getNode(child, obj);
    if (result != null) return result;
  }
  return null;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-classview

/** 
   * Traversing nodes
   * for tracing/debugging purposes 
   */
  protected void traverse(Callback callback) {
    callback.call(this);
    for( Enumeration children = getChildren().nodes(); children.hasMoreElements(); ) {
      Node child = (Node) children.nextElement();
      if( child instanceof BaseNode ) {
        ((BaseNode) child).traverse(callback);
      }
    }
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-modelutil

protected void dump(Tracer tracer) {
  tracer.trace(this.getDisplayName());
  tracer.indent();
  for( Enumeration children = getChildren().nodes(); children.hasMoreElements(); ) {
    Node child = (Node) children.nextElement();
    if( child instanceof AbstractCsmNode ) {
    ((AbstractCsmNode) child).dump(tracer);
    }
  }
  tracer.unindent();
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-j2ee-jboss4

public void run() {
    t.waitFinished();
    if(node != null) {
      Node apps = node.getParentNode();
      if (apps != null) {
        Enumeration appTypes = apps.getChildren().nodes();
        while (appTypes.hasMoreElements()) {
          Node appType = (Node)appTypes.nextElement();
          RefreshModulesCookie cookie = (RefreshModulesCookie)
              appType.getCookie(RefreshModulesCookie.class);
          if (cookie != null) {
            cookie.refresh();
          }
        }
      }
    }
  }
});

相关文章