I wrode a little plugin, that needs to intercept some of actions (run, debug, stop, restart). I implemented this with AnActionListener and in there I checked the actionId. This all worked well. But my logic throws errors if I have more than one project open. So I thought good. I will compare the action events project with my saved instance. This works for one project but not for the other one. I get an error saying "cannot share data context between Swing events".
This makes complete sense because I execute an action in one window, and in the other window my listener tries to excess the data context.
What is the correct way to do something like this?
I could sorround my project check with try...catch but that looks and feels dirty.