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

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

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

Children.getNodeAt介绍

[英]Getter for a child at a given position. If child with such index does not exists it returns null.
[中]在给定的位置为一个孩子做准备。如果具有此类索引的子级不存在,则返回null。

代码示例

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

nodes = new Node[Math.min(prefetchCount, count)];
for (int i = 0; i < nodes.length; i++) {
  nodes[i] = nch.getNodeAt(i);

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

@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
  // Even when this renderer is set as default for any object,
  // we need to call super, as it sets bacgrounds and does some other
  // things...
  super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
  if (table instanceof ETable) {
    row = ((ETable) table).convertRowIndexToModel(row);
    Node n = manager.getRootContext().getChildren().getNodeAt(row);
    if (n instanceof FunctionCallNode) {
      node = (FunctionCallNode) n;
      setText(ensureVisible(node.getHtmlDisplayName(), getBackground()));
    }
  }
  return this;
}

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

static void openTestsuite(TestsuiteNode node) {
  Children childrens  = node.getChildren();
  if (childrens != null){
    Node child = childrens.getNodeAt(0);
    if ((child != null) && (child instanceof JUnitTestMethodNode)){
      final FileObject fo = ((JUnitTestMethodNode)child).getTestcaseFileObject();

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-maven-junit-ui

public void openTestsuite(TestsuiteNode node) {
  Children childrens = node.getChildren();
  if (childrens != null) {
    Node child = childrens.getNodeAt(0);
    if ((child != null) && (child instanceof MavenJUnitTestMethodNode)) {
      final FileObject fo = ((MavenJUnitTestMethodNode) child).getTestcaseFileObject();

代码示例来源:origin: org.gephi/desktop-filters

private void saveExpandStatus(Node node) {
    if (node instanceof RootNode) {
      RootNode rootNode = (RootNode) node;
      for (Node n : rootNode.getChildren().getNodes()) {
        saveExpandStatus(n);
      }
    } else if (node instanceof QueryNode) {
      QueryNode queryNode = (QueryNode) node;
      Node firstChild = queryNode.getChildren().getNodeAt(0);
      boolean parameterExpanded = false;
      if (firstChild != null && firstChild instanceof ParameterNode) {
        parameterExpanded = isExpanded(firstChild);
      }
      uiModel.setExpand(queryNode.getQuery(), isExpanded(queryNode), parameterExpanded);
      for (Node n : queryNode.getChildren().getNodes()) {
        saveExpandStatus(n);
      }
    }
  }
}

代码示例来源:origin: org.gephi/desktop-filters

private void loadExpandStatus(Node node) {
  if (node instanceof RootNode) {
    RootNode rootNode = (RootNode) node;
    for (Node n : rootNode.getChildren().getNodes()) {
      loadExpandStatus(n);
    }
  } else if (node instanceof QueryNode) {
    QueryNode queryNode = (QueryNode) node;
    if (uiModel.isExpanded(queryNode.getQuery())) {
      expandNode(queryNode);
    }
    Node firstChild = queryNode.getChildren().getNodeAt(0);
    if (firstChild != null && firstChild instanceof ParameterNode) {
      if (uiModel.isParametersExpanded(queryNode.getQuery())) {
        expandNode(firstChild);
      }
    }
    for (Node n : queryNode.getChildren().getNodes()) {
      loadExpandStatus(n);
    }
  }
}

代码示例来源:origin: senbox-org/snap-desktop

assertEquals(PNode.class, rootNode.getChildren().getNodeAt(0).getClass());
PNode pNode = (PNode) rootNode.getChildren().getNodeAt(0);

相关文章