mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-152049 Project view collapses in unpinned mode after some time and changes in editor
restore tree state on activation and save it on deactivation
This commit is contained in:
+21
@@ -48,6 +48,8 @@ import com.intellij.util.OpenSourceUtil;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import com.intellij.util.ui.accessibility.ScreenReader;
|
||||
import com.intellij.util.ui.tree.TreeUtil;
|
||||
import com.intellij.util.ui.update.Activatable;
|
||||
import com.intellij.util.ui.update.UiNotifyConnector;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -118,6 +120,25 @@ public abstract class AbstractProjectViewPSIPane extends AbstractProjectViewPane
|
||||
installComparator();
|
||||
initTree();
|
||||
|
||||
Disposer.register(getTreeBuilder(), new UiNotifyConnector(myTree, new Activatable() {
|
||||
private boolean showing;
|
||||
|
||||
@Override
|
||||
public void showNotify() {
|
||||
if (!showing) {
|
||||
showing = true;
|
||||
restoreExpandedPaths();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideNotify() {
|
||||
if (showing) {
|
||||
showing = false;
|
||||
saveExpandedPaths();
|
||||
}
|
||||
}
|
||||
}));
|
||||
return myComponent;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user