How to automatically open a 'Tool Window' used as a custom console view when launching a action Follow
Hello,
I created a custom "ToolWindow" registered in plugin.xml:
<toolWindow id="My Console"
anchor="bottom"
factoryClass="com.user.intellij.utils.CustomToolWindowFactory">
</toolWindow>
This custom 'ToolWindow' acts as a console view used to display the result (in live) of a non blocking action.
It works perfectly (info, error, warning logs are well displayed), but only if the custom "Window Tool" was opened manually.
Once this view is open, I can manually close it or remove it from slide bar, and programmatically open it again once my action is launched using the following code:
CustomToolWindowFactory.aToolWindow?.let {
if (!it.isActive) {
it.activate(null, false)
} else if (!it.isVisible) {
it.show(null)
}
}
My issue is that I've not found how to automatically open it:
- the first time Intellij is open after this extension has been created
- when Intellij starts again and this "Window Tool" was closed in previous session
I always needs to open it manually.
Can you please help me on this topic?
Thanks a lot in advance.
Please sign in to leave a comment.
Did you try using ProjectManagerListener?? I haven't tried it before but, you can try using its projectOpened() method.
Hello Safeuq,
Thanks a lot for this solution, which works for me :-)
StartupActivity EP might be even easier https://plugins.jetbrains.com/docs/intellij/plugin-components.html#project-open
Thanks a lot Yann. I'll have a look to this other solution.