boolean (@NotNull DefaultMutableTreeNode child) { TreeNode eachParent = child; while (eachParent != null) { if (myRootNode == eachParent) return true; NodeDescriptor<?> eachDescriptor = getDescriptorFrom(eachParent); if (eachDescriptor == null || !isAutoExpand(eachDescriptor, false)) { TreePath path = getPathFor(eachParent); return myWillBeExpanded.contains(path.getLastPathComponent()) || myTree.isExpanded(path) && myTree.isVisible(path); } eachParent = eachParent.getParent(); } return false; }