IDEA-152049 Project view collapses in unpinned mode after some time and changes in editor

This commit is contained in:
Sergey Malenkov
2016-07-21 16:24:12 +03:00
parent 601f057d4e
commit 22f0f80163
2 changed files with 7 additions and 5 deletions
@@ -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);