From 387d5639919f365c8263ddfa35e470bfb1a73237 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Thu, 8 Mar 2012 16:21:58 +0100 Subject: [PATCH] SOE if pass through mode is on and there are >= 144 elements in the tree --- .../ide/util/treeView/AbstractTreeUi.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUi.java b/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUi.java index 808a0ce89bfe..5af6d5c43eb9 100644 --- a/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUi.java +++ b/platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUi.java @@ -4067,7 +4067,24 @@ public class AbstractTreeUi { return preselectedRow; } + private void expandAllWithoutRecursion(@Nullable final Runnable onDone) { + final JTree tree = getTree(); + int myCurrentRow = 0; + if (tree.getRowCount() > 0) { + while (myCurrentRow < tree.getRowCount()) { + final TreePath path = tree.getPathForRow(myCurrentRow); + final Object last = path.getLastPathComponent(); + final Object elem = getElementFor(last); + expand(elem, null); + myCurrentRow++; + } + } + runDone(onDone); + } + public void expandAll(@Nullable final Runnable onDone) { + if (isPassthroughMode()) expandAllWithoutRecursion(onDone); + final JTree tree = getTree(); if (tree.getRowCount() > 0) { final int expandRecursionDepth = Math.max(2, Registry.intValue("ide.tree.expandRecursionDepth"));