From bc3c1fa8d9f8b5b8e7aa75d64eab1e13f57e2811 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Sun, 29 Jul 2012 16:51:44 +0200 Subject: [PATCH] IDEA-87621 Collapse/expand all in file structure popup --- .../src/com/intellij/ide/util/FileStructurePopup.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/platform/lang-impl/src/com/intellij/ide/util/FileStructurePopup.java b/platform/lang-impl/src/com/intellij/ide/util/FileStructurePopup.java index 2934ab76294c..3693efbc1938 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/FileStructurePopup.java +++ b/platform/lang-impl/src/com/intellij/ide/util/FileStructurePopup.java @@ -18,7 +18,9 @@ package com.intellij.ide.util; import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer; import com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl; import com.intellij.ide.DataManager; +import com.intellij.ide.DefaultTreeExpander; import com.intellij.ide.IdeBundle; +import com.intellij.ide.TreeExpander; import com.intellij.ide.structureView.StructureViewModel; import com.intellij.ide.structureView.StructureViewTreeElement; import com.intellij.ide.structureView.impl.common.PsiTreeElementBase; @@ -119,6 +121,8 @@ public class FileStructurePopup implements Disposable { private boolean myInitialNodeIsLeaf; private final boolean myDaemonUpdateEnabled; private final List> myTriggeredCheckboxes = new ArrayList>(); + private final TreeExpander myTreeExpander; + public FileStructurePopup(StructureViewModel structureViewModel, @Nullable Editor editor, @@ -220,6 +224,8 @@ public class FileStructurePopup implements Disposable { } }; + myTreeExpander = new DefaultTreeExpander(myTree); + //myAbstractTreeBuilder.getUi().setPassthroughMode(true); myAbstractTreeBuilder.getUi().getUpdater().setDelay(1); myInitialPsiElement = getCurrentElement(getPsiFile(myProject)); @@ -537,6 +543,9 @@ public class FileStructurePopup implements Disposable { if (LangDataKeys.POSITION_ADJUSTER_POPUP.is(dataId)) { return myPopup; } + if (PlatformDataKeys.TREE_EXPANDER.is(dataId)) { + return myTreeExpander; + } return null; } });