ToolWindow open close callback.
已回答
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.
请先登录再写评论。
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