old trees do not support promiseExpandAll

This commit is contained in:
Sergey Malenkov
2018-04-26 13:33:53 +03:00
parent 324ffe835e
commit c0596c7af4
@@ -784,7 +784,24 @@ public final class TreeUtil {
}
public static void expandAll(@NotNull JTree tree) {
promiseExpandAll(tree);
if (AbstractTreeBuilder.getBuilderFor(tree) != null) {
Object root = tree.getModel().getRoot();
if (root == null) return;
tree.expandPath(new TreePath(root));
int oldRowCount = 0;
do {
int rowCount = tree.getRowCount();
if (rowCount == oldRowCount) break;
oldRowCount = rowCount;
for (int i = 0; i < rowCount; i++) {
tree.expandRow(i);
}
}
while (true);
}
else {
promiseExpandAll(tree);
}
}
/**