I want to embed a Editor in a Tool Window, to display snippets of (Java) code with syntax highlight, i.e. the main editor + a Tool Window with a code snippet that is syntax highlighted.
I have followed this example to create and add a FileEditor instance; https://intellij-support.jetbrains.com/hc/en-us/community/posts/206129029-Embedding-PsiAwareTextEditorImpl-in-a-tool-window-?input_string=Embedding%20a%20Editor%20in%20a%20Tool%20Window
However I can figure out howto update the text displayed in the FileEditor. There seems to be no setFile() or setDocument() methods.
What am I doing wrong?