IntelliJ plugin: Access is allowed from event dispatch thread only

Daniel Ramos :

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?

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=143312&siteId=1