public void setRootElement(CompositePackagingElement<?> rootElement) {
   myContext
       .getOrCreateModifiableArtifactModel()
       .getOrCreateModifiableArtifact(myOriginalArtifact)
       .setRootElement(rootElement);
   myTreeStructure.updateRootElement();
   final DefaultMutableTreeNode node = myTree.getRootNode();
   node.setUserObject(myTreeStructure.getRootElement());
   myBuilder.updateNode(node);
   rebuildTree();
   myArtifactsEditor.getSourceItemsTree().rebuildTree();
 }
  @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;
        }
      }
    }
  }
 public void updateAndSelect(
     PackagingElementNode<?> node, final List<? extends PackagingElement<?>> toSelect) {
   myArtifactsEditor.queueValidation();
   myTreeStructure.clearCaches();
   myBuilder
       .queueUpdateFrom(node, true)
       .doWhenDone(
           new Runnable() {
             @Override
             public void run() {
               List<PackagingElementNode<?>> nodes = myTree.findNodes(toSelect);
               myBuilder.select(ArrayUtil.toObjectArray(nodes), null);
             }
           });
 }
  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;
          }
        }
      }
    }
  }
 public void initTree() {
   myBuilder.initRootNode();
   mySelectedElementInfo.showPropertiesPanel();
 }
 public void updateRootNode() {
   myBuilder.updateNode(myTree.getRootNode());
 }
 public void updateTreeNodesPresentation() {
   myBuilder.updateFromRoot(false);
 }
 public void rebuildTree() {
   myBuilder.updateFromRoot(true);
   updatePropertiesPanel(true);
   myArtifactsEditor.queueValidation();
 }
 public void setSortElements(boolean sortElements) {
   mySortElements = sortElements;
   myBuilder.setNodeDescriptorComparator(getComparator());
   myArtifactsEditor.getContext().getParent().getDefaultSettings().setSortElements(sortElements);
 }