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
This commit is contained in:
+3
-5
@@ -438,7 +438,7 @@ public abstract class AbstractProjectViewPane implements DataProvider, Disposabl
|
||||
String subId = subPane.getAttributeValue(ATTRIBUTE_SUBID);
|
||||
TreeState treeState = new TreeState();
|
||||
treeState.readExternal(subPane);
|
||||
myReadTreeState.put(subId, treeState);
|
||||
if (!treeState.isEmpty()) myReadTreeState.put(subId, treeState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -458,15 +458,13 @@ public abstract class AbstractProjectViewPane implements DataProvider, Disposabl
|
||||
protected void saveExpandedPaths() {
|
||||
if (myTree != null) {
|
||||
TreeState treeState = TreeState.createOn(myTree);
|
||||
myReadTreeState.put(getSubId(), treeState);
|
||||
if (!treeState.isEmpty()) myReadTreeState.put(getSubId(), treeState);
|
||||
}
|
||||
}
|
||||
|
||||
public final void restoreExpandedPaths(){
|
||||
TreeState treeState = myReadTreeState.get(getSubId());
|
||||
if (treeState != null) {
|
||||
treeState.applyTo(myTree);
|
||||
}
|
||||
if (treeState != null && !treeState.isEmpty()) treeState.applyTo(myTree);
|
||||
}
|
||||
|
||||
public void installComparator() {
|
||||
|
||||
@@ -110,6 +110,10 @@ public class TreeState implements JDOMExternalizable {
|
||||
this(new ArrayList<List<PathElement>>(), new ArrayList<List<PathElement>>());
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return myExpandedPaths.isEmpty() && mySelectedPaths.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readExternal(Element element) throws InvalidDataException {
|
||||
readExternal(element, myExpandedPaths, PATH);
|
||||
|
||||
Reference in New Issue
Block a user