I would like to make a quick fix that needs some kind of user input. That seems kind of do-able, but I run into problems concerning permissions.
What I'm trying is making a class than extends BaseIntentionAction, and the invoke method then needs to gather some info, based upon which it will show the user a list pop up (through JBPopupFactory.getInstance().createListPopupBuilder).
Based upon the choice that the user makes, changes in the psi tree need to be performed. These are not several different quick fixes, but one quick fix for which I need user input, to clarify.
I first tried to attach a listener to the pop up and as soon as a choice is made I apply the changes in the psi tree. There, I first ran into write permission problems, which I solved by wrapping the part of the callback function that made the change in an ApplicationManager.getInstance().runWriteAction. The next assertion that failed was that I apparently could not make any changes from the thread I was on. I didn't manage to solve that, I then ended up in thinking about other solutions but at a certain moment it started involving semaphores for synchronization and so on (to make sure the user makes it's selection before I continue running the invoke function from BaseIntentionAction (which is allowed to make changes to the psi tree), but making sure I had all the info and so on and so forth) and then I started realizing that this was likely not the way to go, getting a bit too complicated.
So, here goes, is there an advised way of aquiring user input for a quick fix that involves making changes to the psi tree, or is that impossible and should something else be used?