I have a tool window and I have an action. I also have some class (let's call it class X). I would like the tool window class and action class to use class X. But I would like them to use the same instance of class X. So the instance of the class X should be created at the beginning (when the plugin starts) and then the tool window class and the action class should be able to access the instance of class X created at the beginning. How to accomplish that?
I think I could use Singleton pattern for that. Is there a better approach?