IDEA-81554 Database console loses toolbar after detaching and reattaching tab

This commit is contained in:
Gregory.Shrago
2012-02-21 23:44:09 +03:00
parent 4f45e447b2
commit bca1bf262b
3 changed files with 6 additions and 1 deletions
@@ -551,7 +551,7 @@ public class LanguageConsoleImpl implements Disposable, TypeSafeDataProvider {
@Override
public void fileClosed(FileEditorManager source, VirtualFile file) {
if (file != myFile.getVirtualFile()) return;
if (myUiUpdateRunnable != null) {
if (myUiUpdateRunnable != null && !Boolean.TRUE.equals(file.getUserData(FileEditorManagerImpl.CLOSING_TO_REOPEN))) {
ApplicationManager.getApplication().runReadAction(myUiUpdateRunnable);
}
}
@@ -585,6 +585,7 @@ final class EditorTabbedContainer implements Disposable, CloseAction.CloseTarget
public void dragOutFinished(MouseEvent event, TabInfo source) {
boolean copy = event.isMetaDown() || (!SystemInfo.isMac && event.isControlDown());
if (!copy) {
myFile.putUserData(FileEditorManagerImpl.CLOSING_TO_REOPEN, Boolean.TRUE);
FileEditorManagerEx.getInstanceEx(myProject).closeFile(myFile, myWindow);
}
else {
@@ -592,6 +593,9 @@ final class EditorTabbedContainer implements Disposable, CloseAction.CloseTarget
}
mySession.process(event);
if (!copy) {
myFile.putUserData(FileEditorManagerImpl.CLOSING_TO_REOPEN, null);
}
myFile = null;
mySession = null;
@@ -96,6 +96,7 @@ public class FileEditorManagerImpl extends FileEditorManagerEx implements Projec
private static final FileEditor[] EMPTY_EDITOR_ARRAY = {};
private static final FileEditorProvider[] EMPTY_PROVIDER_ARRAY = {};
public static final Key<Boolean> CLOSING_TO_REOPEN = Key.create("CLOSING_TO_REOPEN");
private volatile JPanel myPanels;
private EditorsSplitters mySplitters;