From 566c7c026a9eabaf685a105f6790a5fc19b160bd Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Mon, 24 Mar 2025 11:42:03 +0100 Subject: [PATCH] ui: document ToolWindow API limitations GitOrigin-RevId: 2c63c1ad3eabc9501c0bfed778e8036161903aae --- .../src/com/intellij/openapi/wm/ToolWindowFactory.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/platform/platform-api/src/com/intellij/openapi/wm/ToolWindowFactory.kt b/platform/platform-api/src/com/intellij/openapi/wm/ToolWindowFactory.kt index 451102caa7bb..35b9c1fa3b3d 100644 --- a/platform/platform-api/src/com/intellij/openapi/wm/ToolWindowFactory.kt +++ b/platform/platform-api/src/com/intellij/openapi/wm/ToolWindowFactory.kt @@ -16,6 +16,11 @@ import javax.swing.Icon * See [Tool Windows](https://plugins.jetbrains.com/docs/intellij/tool-windows.html) in SDK Docs. */ interface ToolWindowFactory : PossiblyDumbAware { + /** + * This will be called once, and cannot be undone. + * + * @return false to deactivate the factory + */ suspend fun isApplicableAsync(project: Project): Boolean { return blockingContext { @Suppress("DEPRECATION") @@ -42,8 +47,12 @@ interface ToolWindowFactory : PossiblyDumbAware { /** * Check if the tool window (and its stripe button) should be visible after startup. + * Unavailable tool windows are still visible in the "Main Menu | View | Tool Windows". + * + * This will be called once. Use [ToolWindow.setAvailable] on state changes. * * @see ToolWindow.isAvailable + * @see ToolWindowManager.unregisterToolWindow */ fun shouldBeAvailable(project: Project): Boolean = true