From 3bf0245a95961a9bc687db99bf5b0300f6727277 Mon Sep 17 00:00:00 2001 From: "Gregory.Shrago" Date: Mon, 25 Nov 2024 05:17:49 +0400 Subject: [PATCH] IJPL-171375, IJPL-171377 Suppress Problems View tabs in Editor GitOrigin-RevId: fe8af934b3b747280352014838faa4cdc7c316d9 --- platform/ide-core/api-dump-unreviewed.txt | 1 + .../ide-core/src/com/intellij/openapi/wm/ToolWindowId.java | 1 + .../analysis/problemsView/toolWindow/ProblemsView.java | 3 ++- .../openapi/wm/impl/MoveToolWindowTabToEditorAction.kt | 4 +++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/platform/ide-core/api-dump-unreviewed.txt b/platform/ide-core/api-dump-unreviewed.txt index 14fe9192ed6b5..e1a852e38260a 100644 --- a/platform/ide-core/api-dump-unreviewed.txt +++ b/platform/ide-core/api-dump-unreviewed.txt @@ -2530,6 +2530,7 @@ com.intellij.openapi.wm.ToolWindowId - sf:MESSAGES_WINDOW:java.lang.String - sf:MODULES_DEPENDENCIES:java.lang.String - sf:PREVIEW:java.lang.String +- sf:PROBLEMS_VIEW:java.lang.String - sf:PROJECT_VIEW:java.lang.String - sf:RUN:java.lang.String - sf:SERVICES:java.lang.String diff --git a/platform/ide-core/src/com/intellij/openapi/wm/ToolWindowId.java b/platform/ide-core/src/com/intellij/openapi/wm/ToolWindowId.java index e6c9837361e4b..b7379167eab74 100644 --- a/platform/ide-core/src/com/intellij/openapi/wm/ToolWindowId.java +++ b/platform/ide-core/src/com/intellij/openapi/wm/ToolWindowId.java @@ -6,6 +6,7 @@ public interface ToolWindowId { String MESSAGES_WINDOW = "Messages"; String PROJECT_VIEW = "Project"; String STRUCTURE_VIEW = "Structure"; + String PROBLEMS_VIEW = "Problems View"; String FAVORITES_VIEW = "Favorites"; String BOOKMARKS = "Bookmarks"; String ANT_BUILD = "Ant"; diff --git a/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProblemsView.java b/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProblemsView.java index b5fe9a31ed1c9..b44670e152652 100644 --- a/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProblemsView.java +++ b/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProblemsView.java @@ -11,6 +11,7 @@ import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.wm.ToolWindow; import com.intellij.openapi.wm.ToolWindowFactory; +import com.intellij.openapi.wm.ToolWindowId; import com.intellij.openapi.wm.ToolWindowManager; import com.intellij.openapi.wm.ex.ToolWindowManagerListener; import com.intellij.openapi.wm.impl.ToolWindowManagerImpl; @@ -31,7 +32,7 @@ import java.util.concurrent.atomic.AtomicBoolean; public final class ProblemsView implements DumbAware, ToolWindowFactory { - public static final String ID = "Problems View"; + public static final String ID = ToolWindowId.PROBLEMS_VIEW; public static @Nullable ToolWindow getToolWindow(@NotNull Project project) { return project.isDisposed() ? null : ToolWindowManager.getInstance(project).getToolWindow(ID); diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/MoveToolWindowTabToEditorAction.kt b/platform/platform-impl/src/com/intellij/openapi/wm/impl/MoveToolWindowTabToEditorAction.kt index cb82cbdf940b3..c17f2a3eb137a 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/MoveToolWindowTabToEditorAction.kt +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/MoveToolWindowTabToEditorAction.kt @@ -45,7 +45,9 @@ internal class MoveToolWindowTabToEditorAction : DumbAwareAction() { val fileEditor = e.getData(PlatformDataKeys.FILE_EDITOR) val toolWindow = e.getData(PlatformDataKeys.TOOL_WINDOW) val content = toolWindow?.let { ToolWindowContextMenuActionBase.getContextContent(e, it) } - val enabled = content != null && toolWindow.id != ToolWindowId.STRUCTURE_VIEW || + val enabled = content != null && + toolWindow.id != ToolWindowId.STRUCTURE_VIEW && + toolWindow.id != ToolWindowId.PROBLEMS_VIEW || fileEditor?.file is ToolWindowTabFileImpl e.presentation.isEnabledAndVisible = enabled