boolean (boolean autoExpand, @NotNull Object element) { if (autoExpand) { int distance = getDistanceToAutoExpandRoot(element); if (distance < 0) { myAutoExpandRoots.add(element); } else { if (distance >= myAutoExpandDepth.asInteger() - 1) { autoExpand = false; } } if (autoExpand) { DefaultMutableTreeNode node = getNodeForElement(element, false); autoExpand = node != null && isInVisibleAutoExpandChain(node); } } return autoExpand; }