I am creating a plugin, and as part of plugin installation, I would like to install several pre-defined File Templates (File > New > My Template Group > My Template 1).
How would I go about doing this? Is there an install/uninstall plugin hook? What is the API for creating/exposing new File Templates?
Update: It appears the primary hooks are via extensions defined in the plugin.xml, for fileTypeFactory and fileTemplateGroup.
I'm not sure how the mapping between the actual template file (fileTemplates/j2ee/my-template.ext.ft) which seems to happen in my FileTemplateGroup implementation, and the custom fileTypeFactory (and underlying custom LanguageFileType) is made.
Update 2: I found this post https://intellij-support.jetbrains.com/hc/en-us/community/posts/207280245-File-Templates-in-plugin ... which seems to work. This means that I do not need to have any extensions (fileTemplateGroup or fileTypeFactory).
In fact, I don't understand what fileTemplateGroup is supposed to do.. It appears something under New > Edit Templates > Other tab..