How to add Java Swing components to Preview Editor?
I have implemented a TextEditorWithPreview in my plugin. Now, I want to add Java Swing components to the Preview editor screen. I want a few components to be shown as soon as Preview Editor screen is opened. For other components I want to add them dynamically based on the code written in the Text Editor. For example:

In the above image, the areas marked red are Tool Windows embedded inside the Preview Editor and are shown as soon as you open files in the editor. And the area marked in blue is dynamically added according to the code written in the Text Editor. I also want the Tool Windows just like these, but the Tool Windows will contain my custom view. And I want to add other custom views dynamically in the blue area, i.e., at the center of the editor. How can I do this?
Please sign in to leave a comment.
I think it's best to inspect existing functionality, you can use UI Inpector to locate underlying classes for the above sample and go from there. https://plugins.jetbrains.com/docs/intellij/internal-ui-inspector.html
AFAIU this is from Android plugin, so sources are available https://github.com/JetBrains/android