from within the Swing dispatch event thread, how does one create another thread that has or can get permission to modify a Document or PsiFile?
I'm adding the ability to execute my plugin on a directory in the project view (right click on directory to run the plugin on all files in the directory). When I do that, the actionPerformed() method in the plugin is being called on the Swing dispatch event thread. I can create a progress bar, put it in a dialog, and display it.
But I don't want to do all the plugin work on that thread. All updating of files has to be done inside an Application.runWriteAction() call (or I get an exception), and this call has to be made by the Swing dispatch event thread. All updating of files also appears to have to be done inside a CommandProcessor.executeCommand() call so that I don't get an exception about trying to perform an undo-able operation outside that call. I've tried all permutations I can think of but (unless I simply do all the work on the Swing dispatch event thread) I usually get
Can someone suggest a workaround? These requirements (about being inside a writeAction and CommandProcessor.executeCommand()) seem to be new with build 957 or maybe the previous.