ToolWindow open close callback.
Answered
Hi.
I'm developing a plugin and would like to know if do we have a callback to know when the ToolWindow is open or closed by the user.
Thanks.
Please sign in to leave a comment.
You can register the ToolWindowManagerListener listener and implement the stateChanged method, which may check:
Keep in mind, that this method doesn't distinguish, which TW has changed the state (registering/deregistering TW, focus/blur events) - so it's quite verbose.
However, you can get the isActive state of your particular TW and fire another action when this flag has changed to throttle these events.
Thanks Jakub.
With
I've managed to achieve what I what although `addToolWindowManagerListener` is marked as deprecated and I didn't find out what is the non-deprecated approach.
You can register such listener within plugin.xml file. Check out our documentation about Plugin Listeners.
Thanks