FileAnnotation.reload problem.
I developed a plugin of cloud comment.
Previously I use JavaFX webview and JavaInterop to communicate with the plugin.
But the JavaFX webview has cross domain bug.
So I change it to BrowserUtil.browse and local http server to communicate with the plugin.
Then, the problem comes.
I previously update the comment count by fileAnnotation.reload(fileAnnotation) when the webview dialog is disposed.
It's working. The dialog is modal. I update the comment count when I close the dialog.
When I use the local http server, it's working for some cases and not working for some cases.To use with local http server. I have to use the line below. Or it will fail on read action assert.
ApplicationManager.getApplication().runReadAction(()->annotation.reload(annotation));
Here's a screen recording of the cases working and the cases not working.
https://www31.zippyshare.com/v/dFuzO2Nk/file.html
Can you please help? How can I call the fileAnnotation.reload(fileAnnotation) to be working 100%?
Please sign in to leave a comment.
I finally get it working by using the method below.
But I don't know why. Application.runReadAction, Application.runWriteAction, ProgressManager.run are all not working.
Could you please tell me why? Thank you.
Application.runReadAction provides read access to the data in the current thread:
Application.invokeLater makes your Runnable to be run in AWS thread also with write access:
I assume that in your case, the significant part was to run your code in the Event Dispatching Thread.