How to create the subgroup of the files templates shared via plugin?
For example, in the File and code templates -> other, the JPA group has two-level organizing:
I need similar 2-level organizing for my plugin, but have not found the example how to provide it.
Currently it is:
I want to change it to:
YDF/
├─ GUI Components
│ ├─ Badge.styl
│ ├─ Button.styl
│ ├─ ...
├─ Web pages/
│ ├─ RegularWebPage.pug
│ ├─ StaticPreviewAnywherePage.pug
│ ├─ ...
Also, currently I have the sole class YDF_GUI_ComponentsTemplatesGroupFactory.kt:
package com.yamato_daiwa.ydf.intellij_idea_plugin
import com.intellij.icons.AllIcons
import com.intellij.ide.fileTemplates.FileTemplateDescriptor
import com.intellij.ide.fileTemplates.FileTemplateGroupDescriptor
import com.intellij.ide.fileTemplates.FileTemplateGroupDescriptorFactory
class YDF_GUI_ComponentsTemplatesGroupFactory : FileTemplateGroupDescriptorFactory {
override fun getFileTemplatesDescriptor(): FileTemplateGroupDescriptor {
val groupDescriptor = FileTemplateGroupDescriptor("YDF GUI Components", AllIcons.Nodes.Folder)
/* [ Theory ] No ".ft" must be here. */
groupDescriptor.addTemplate(FileTemplateDescriptor("Badge.styl"))
return groupDescriptor
}
}
Please sign in to leave a comment.