My plugin, which is an in-house i18n plugin, is running into a problem with IDEA 10, where it's getting lots of "Write access is allowed from event dispatch thread only" errors when it's trying to call PsiDocumentManager.commitAllDocuments() in what seems to be a background thread invoked to run an inspection. It's calling commitAllDocuments because it wants to make sure that the PSI for a properties file is up-to-date with document changes.
This code was written quite a while ago for a much older version of IDEA. Is it still necessary to call commitAllDocuments before accessing PSI? If it is still necessary, how would I do this in code that IDEA is running on a background thread?