How to mark templates with vars with borders and have user tab through them for custom template plugin

Here is an example of “fun1” live template which prompts user to insert code inline. I am trying to write a plugin to create dynamic code templates so that our developers can share them easily.

I have been looking at PSI tree docs and tools like PSI Viewer, but they only show data elements.

I looked at examples and IJ source code as well as UI Inspector, but cannot understand what UI Swing component it is using or if it is just applying the border.

Can you point me to some example or doc explaining how I can achieve this?


Actually figured it out. Creating Template/Variable objects in plugin and passed to TemplateManager.getInstance(event.project)?.startTemplate() and it works.