mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
DBE-1242 Having focus in "Database Console" and pressing "close tab" with CMD-w always closes SQL console instead
This commit is contained in:
@@ -22,6 +22,7 @@ import com.intellij.execution.ui.layout.actions.CloseViewAction;
|
||||
import com.intellij.execution.ui.layout.actions.MinimizeViewAction;
|
||||
import com.intellij.execution.ui.layout.actions.RestoreViewAction;
|
||||
import com.intellij.ide.DataManager;
|
||||
import com.intellij.ide.actions.CloseAction;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -1400,6 +1401,17 @@ public class RunnerContentUi implements ContentUI, Disposable, CellTransform.Fac
|
||||
if (KEY.is(dataId)) {
|
||||
return RunnerContentUi.this;
|
||||
}
|
||||
else if (CloseAction.CloseTarget.KEY.is(dataId)) {
|
||||
Content content = getContentManager().getSelectedContent();
|
||||
if (content != null && content.getManager().canCloseContents() && content.isCloseable()) {
|
||||
return new CloseAction.CloseTarget() {
|
||||
@Override
|
||||
public void close() {
|
||||
content.getManager().removeContent(content, true, true, true);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
ContentManager originalContentManager = myOriginal == null ? null : myOriginal.getContentManager();
|
||||
JComponent originalContentComponent = originalContentManager == null ? null : originalContentManager.getComponent();
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ public class RunnerLayoutUiImpl implements Disposable.Parent, RunnerLayoutUi, La
|
||||
runnerTitle + " - " + sessionName);
|
||||
Disposer.register(this, myContentUI);
|
||||
|
||||
myViewsContentManager = getContentFactory().createContentManager(myContentUI.getContentUI(), false, project);
|
||||
myViewsContentManager = getContentFactory().createContentManager(myContentUI.getContentUI(), true, project);
|
||||
myViewsContentManager.addDataProvider(this);
|
||||
Disposer.register(this, myViewsContentManager);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user