title: IntelliJ plugin: Access is allowed from event dispatch thread only
body: <p>Hello Stack Overflow community. I'm writing a IntelliJ plugin that needs to write some text into an open editor by listening messages over a WebSocket.</p>
  
  <p>The thing is, that I'm getting an <code>Access is allowed from event dispatch thread only</code> exception when trying to access the editor instance by <code>final Editor editor = manager.getSelectedTextEditor();</code>.</p>
  
  <p>This makes totally sense, as the WebSocket's message handler is being executed in another thread.</p>
  
  <p>Do you know any way for writing into the editor from another thread? Or some other workaround?</p>