Close toolwindow on startup?

I'm using a toolwindow to display my language console, but I don't start a console at startup. If the user has the toolwindow open when they close IDEA it's still open when they start it up again, even if it has no content. Is there a way I can always close it on startup?

2 comments
Comment actions Permalink

Guessing: com.intellij.openapi.wm.ToolWindow#hide() after project has been loaded (com.intellij.openapi.startup.StartupManager#runWhenProjectIsInitialized()) should probably work.

0
Comment actions Permalink

Thanks for the suggestion, I finally got a chance to try this and it sort of works. I'd tried something similar with a project component, the problem is that the window is still open when the project starts up, and it's there during project initialisation (a good few seconds) then it's hidden. Ideally I'd like to not have it appear at all. I also tried with a project component closing it in the projectClosed() method figuring that it would then be closed and wouldn't appear on startup, but unfortunately that didn't work. I guess IDEA has already written the workspace state at the time that method is called.

0

Please sign in to leave a comment.