void () { // expanding lots of nodes is a slow operation (and result is not very useful) if (TreeUtil.hasManyNodes(this, EXPAND_NODES_THRESHOLD)) { TreeUtil.collapseAll(this, 1); return; } expandDefaults(); int selectedTreeRow = -1; if (myShowCheckboxes) { if (!getIncludedSet().isEmpty()) { ChangesBrowserNode root = getRoot(); Enumeration enumeration = root.depthFirstEnumeration(); while (enumeration.hasMoreElements()) { ChangesBrowserNode node = (ChangesBrowserNode)enumeration.nextElement(); if (node != root && getNodeStatus(node) == State.NOT_SELECTED) { collapsePath(new TreePath(node.getPath())); } } enumeration = root.depthFirstEnumeration(); while (enumeration.hasMoreElements()) { ChangesBrowserNode node = (ChangesBrowserNode)enumeration.nextElement(); if (node.isLeaf() && getNodeStatus(node) == State.SELECTED) { selectedTreeRow = getRowForPath(new TreePath(node.getPath())); break; } } } } if (selectedTreeRow >= 0) { setSelectionRow(selectedTreeRow); } TreeUtil.showRowCentered(this, selectedTreeRow, false); }