Create closeable ToolWindow Tab

I am creating a plugin which is a toolwindow extension. I want to have it closeable tabs like in Version Control.

I created a class which implements ToolWindowFactory

override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
component = MyComponent()
val content = toolWindow.contentManager.factory.createContent(component, "title", false)
content.isCloseable = true

But this way the tab is not closeable (when I right click on it I cannot select 'Close tab')

Any ideas on how to make this work?


Please sign in to leave a comment.