コード例 #1
0
 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();
 }
コード例 #2
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;
        }
      }
    }
  }
コード例 #3
0
 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);
             }
           });
 }
コード例 #4
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;
          }
        }
      }
    }
  }
コード例 #5
0
 public void initTree() {
   myBuilder.initRootNode();
   mySelectedElementInfo.showPropertiesPanel();
 }
コード例 #6
0
 public void updateRootNode() {
   myBuilder.updateNode(myTree.getRootNode());
 }
コード例 #7
0
 public void updateTreeNodesPresentation() {
   myBuilder.updateFromRoot(false);
 }
コード例 #8
0
 public void rebuildTree() {
   myBuilder.updateFromRoot(true);
   updatePropertiesPanel(true);
   myArtifactsEditor.queueValidation();
 }
コード例 #9
0
 public void setSortElements(boolean sortElements) {
   mySortElements = sortElements;
   myBuilder.setNodeDescriptorComparator(getComparator());
   myArtifactsEditor.getContext().getParent().getDefaultSettings().setSortElements(sortElements);
 }