mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Do not collapse a single root node in Project View (IDEA-230663)
GitOrigin-RevId: 550e2f5efc637764401ec0cf43023f2dca2d6457
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e23d3b2146
commit
ac16f6050e
@@ -959,7 +959,12 @@ public class ProjectViewImpl extends ProjectView implements PersistentStateCompo
|
||||
AnAction collapseAllAction = CommonActionsManager.getInstance().createCollapseAllAction(new DefaultTreeExpander(() -> {
|
||||
AbstractProjectViewPane pane = getCurrentProjectViewPane();
|
||||
return pane == null ? null : pane.myTree;
|
||||
}), getComponent());
|
||||
}) {
|
||||
@Override
|
||||
protected void collapseAll(@NotNull JTree tree, boolean strict, int keepSelectionLevel) {
|
||||
super.collapseAll(tree, false, keepSelectionLevel);
|
||||
}
|
||||
}, getComponent());
|
||||
collapseAllAction.getTemplatePresentation().setIcon(AllIcons.Actions.Collapseall);
|
||||
titleActions.add(collapseAllAction);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,11 @@ open class DefaultTreeExpander(private val supplier: () -> JTree?) : TreeExpande
|
||||
}
|
||||
|
||||
protected open fun collapseAll(tree: JTree, keepSelectionLevel: Int) {
|
||||
TreeUtil.collapseAll(tree, keepSelectionLevel)
|
||||
collapseAll(tree, true, keepSelectionLevel)
|
||||
}
|
||||
|
||||
protected open fun collapseAll(tree: JTree, strict: Boolean, keepSelectionLevel: Int) {
|
||||
TreeUtil.collapseAll(tree, strict, keepSelectionLevel)
|
||||
showSelectionCentered(tree)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user