コード例 #1
0
  @TestOnly
  public void selectNode(@NotNull String parentPath, @NotNull String nodeName) {
    final PackagingElementNode<?> parent = myTree.findCompositeNodeByPath(parentPath);
    if (parent == null) return;

    for (SimpleNode node : parent.getChildren()) {
      if (node instanceof PackagingElementNode) {
        if (nodeName.equals(
            ((PackagingElementNode) node).getElementPresentation().getSearchName())) {
          myBuilder.select(node);
          return;
        }
      }
    }
  }
コード例 #2
0
  public void selectNode(@NotNull String parentPath, @NotNull PackagingElement<?> element) {
    final PackagingElementNode<?> parent = myTree.findCompositeNodeByPath(parentPath);
    if (parent == null) return;

    for (SimpleNode node : parent.getChildren()) {
      if (node instanceof PackagingElementNode) {
        final List<? extends PackagingElement<?>> elements =
            ((PackagingElementNode<?>) node).getPackagingElements();
        for (PackagingElement<?> packagingElement : elements) {
          if (packagingElement.isEqualTo(element)) {
            myBuilder.select(node);
            return;
          }
        }
      }
    }
  }