IDEADEV-41812 - New project view: File selection is lost after rename

This commit is contained in:
Kirill Kalishev
2009-12-03 19:59:34 +03:00
parent 5f3924d661
commit 9c57a0c500
2 changed files with 20 additions and 2 deletions
@@ -1489,6 +1489,18 @@ public class AbstractTreeUi {
myInitialized.setDone();
}
if (myUpdaterState != null && !myUpdaterState.isProcessingNow()) {
UpdaterTreeState oldState = myUpdaterState;
if (!myUpdaterState.restore(null)) {
setUpdaterState(oldState);
}
if (!isReady()) {
return;
}
}
if (myTree.isShowing()) {
if (getBuilder().isToEnsureSelectionOnFocusGained() && Registry.is("ide.tree.ensureSelectionOnFocusGained")) {
TreeUtil.ensureSelection(myTree);
@@ -2868,7 +2880,11 @@ public class AbstractTreeUi {
addNext(elementsToSelect, 0, new Runnable() {
public void run() {
if (getTree().isSelectionEmpty()) {
restoreSelection(currentElements);
processInnerChange(new Runnable() {
public void run() {
restoreSelection(currentElements);
}
});
}
runDone(onDone);
}
@@ -143,7 +143,9 @@ public class UpdaterTreeState {
}
public boolean restore(@Nullable DefaultMutableTreeNode actionNode) {
if (isProcessingNow() || !myCanRunRestore || myUi.hasNodesToUpdate()) return false;
if (isProcessingNow() || !myCanRunRestore || myUi.hasNodesToUpdate()) {
return false;
}
invalidateToSelectWithRefsToParent(actionNode);