boolean (@NotNull DefaultMutableTreeNode node) { Object element = getElementFor(node); NodeDescriptor<?> desc = getDescriptorFrom(node); if (desc == null) return false; if (element != null && getTreeStructure().isAlwaysLeaf(element)) { removeFromUnbuilt(node); removeLoading(node, true); if (node.getChildCount() > 0) { TreeNode[] children = new TreeNode[node.getChildCount()]; for (int i = 0; i < node.getChildCount(); i++) { children[i] = node.getChildAt(i); } if (isSelectionInside(node)) { addSelectionPath(getPathFor(node), true, Conditions.alwaysTrue(), null); } processInnerChange(new TreeRunnable("AbstractTreeUi.processAlwaysLeaf") { @Override public void perform() { for (TreeNode each : children) { removeNodeFromParent((MutableTreeNode)each, true); disposeNode((DefaultMutableTreeNode)each); } } }); } removeFromUnbuilt(node); desc.setWasDeclaredAlwaysLeaf(true); processNodeActionsIfReady(node); return true; } else { boolean wasLeaf = desc.isWasDeclaredAlwaysLeaf(); desc.setWasDeclaredAlwaysLeaf(false); if (wasLeaf) { insertLoadingNode(node, true); } return false; } }