ToolWindow with Tabs & Outdated Docs/Examples
Answered
Hi,
i having still issues to understand the docs. as described here:
https://plugins.jetbrains.com/docs/intellij/tool-windows.html#contents-tabs
it would be better to provide ready-to-use code snippets instead of linking to several interfaces. furthermore the provided example do not show how to add contents as tabs and is outdated as well (https://github.com/JetBrains/intellij-sdk-code-samples/blob/main/tool_window/src/main/java/org/intellij/sdk/toolWindow/MyToolWindowFactory.java using SERVICE which is deprecated).
Please sign in to leave a comment.
ToolWindowManager toolWindowManager = com.intellij.openapi.wm.ToolWindowManager.getInstance(myProject);
ToolWindow toolWindow = toolWindowManager.getToolWindow("NameOfToolWindow");
in combination with https://plugins.jetbrains.com/docs/intellij/plugin-listeners.html#defining-application-level-listeners is what i was looking for
Tabs are magically appears if a name is provided:
Content content = contentFactory.createContent(compnent, "TabName", false);