ToolWindow with Tabs & Outdated Docs/Examples

已回答

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).

 

0

        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);

0

请先登录再写评论。