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.
The thing is, that I'm getting an Access is allowed from event dispatch thread only exception when trying to access the editor instance by final Editor editor = manager.getSelectedTextEditor();.
This makes totally sense, as the WebSocket's message handler is being executed in another thread.
Do you know any way for writing into the editor from another thread? Or some other workaround?
ApplicationManager.getApplication().invokeLater()
http://www.jetbrains.org/intellij/sdk/docs/basics/architectural_overview/general_threading_rules.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With