tool_windows.md: ToolWindowManagerListener topic

This commit is contained in:
Yann Cébron 2021-10-14 16:27:52 +02:00
parent 1359d53321
commit e781314383

View File

@ -19,7 +19,7 @@ Alternatively, using programmatic setup, the tool window is created to show the
### Declarative Setup ### Declarative Setup
The tool window is registered in `plugin.xml` using the `com.intellij.toolWindow` extension point. The tool window is registered in <path>plugin.xml</path> using the `com.intellij.toolWindow` extension point.
The extension point attributes specify all the data which is necessary to display the tool window button: The extension point attributes specify all the data which is necessary to display the tool window button:
* The `id` of the tool window (corresponds to the text displayed on the tool window button) * The `id` of the tool window (corresponds to the text displayed on the tool window button)
@ -42,6 +42,8 @@ Note the condition is evaluated only once when the project is loaded; to show an
To provide a localized text for the tool window button, specify matching `toolwindow.stripe.[id]` message key (escape spaces with `_`) in your [message bundle](localization_guide.md) (code insight supported in 2020.3 and later). To provide a localized text for the tool window button, specify matching `toolwindow.stripe.[id]` message key (escape spaces with `_`) in your [message bundle](localization_guide.md) (code insight supported in 2020.3 and later).
Project-level topic [`ToolWindowManagerListener`](upsource:///platform/platform-impl/src/com/intellij/openapi/wm/ex/ToolWindowManagerListener.java) allows listening to tool window (un-)registering/show events.
### Programmatic Setup ### Programmatic Setup
The second method involves simply calling [`ToolWindowManager.registerToolWindow()`](upsource:///platform/platform-api/src/com/intellij/openapi/wm/ToolWindowManager.kt) from the plugin code. The second method involves simply calling [`ToolWindowManager.registerToolWindow()`](upsource:///platform/platform-api/src/com/intellij/openapi/wm/ToolWindowManager.kt) from the plugin code.