我想在我的英特尔利J IDEA原始版中提供一些档案模板,但我无法理解如何具体指明模板档案的道路。
https://github.com/dengzii/GenerateModuleFromTemplate” rel=“nofollow noretinger”>。 这里有:
<fileTemplateGroup implementation="com.dengzii.plugin.template.template.FileTemplateFactory" order="first"/>
<>strong>plugin.xml,FileTemplateFactory系指:
class FileTemplateFactory : FileTemplateGroupDescriptorFactory {
override fun getFileTemplatesDescriptor(): FileTemplateGroupDescriptor {
val descriptor = FileTemplateGroupDescriptor("Module Template Plugin Descriptor", AllIcons.Nodes.Plugin)
descriptor.addTemplate(getDescriptor("MainActivity.java", getFileIconByExt("java")))
descriptor.addTemplate(getDescriptor("Manifest.xml", getFileIconByExt("xml")))
descriptor.addTemplate(getDescriptor("Application.java", getFileIconByExt("java")))
descriptor.addTemplate(getDescriptor("build.gradle", getFileIconByExt("gradle")))
return descriptor
}
private fun getFileIconByExt(ext: String): Icon {
return FileTypeManager.getInstance().getFileTypeByExtension(ext).icon ?: AllIcons.FileTypes.Unknown
}
private fun getDescriptor(templateName: String, icon: Icon?): FileTemplateDescriptor {
return FileTemplateDescriptor(templateName, icon)
}
}
我的问题是:
- MainActivity.java
- Manifest.xml
- Application.java
- build.gradle
? resources/fileTemplates无此类档案:
用其他词语回答一个问题:当图象活跃时,英特尔法协会正在发现上述图像档案中所提到的情况?
在我的案件中,FileTemplateGroupDescriptorFactory是:
class YDF_GUI_ComponentsTemplatesGroupFactory : FileTemplateGroupDescriptorFactory {
override fun getFileTemplatesDescriptor(): FileTemplateGroupDescriptor {
val groupDescriptor = FileTemplateGroupDescriptor("Yamato Daiwa Frontend GUI Components Templates Group", AllIcons.Nodes.Folder)
/* [ Theory ] No ".ft" must be here. */
groupDescriptor.addTemplate(FileTemplateDescriptor("Badge.styl"))
return groupDescriptor
}
}
<>Badge.styl系指fileTemplates/Styles/Badge.styl.ft。
Try to run the plugin and go to Settings -> File and Code Templates. The group "Yamato Daiwa Frontend GUI Components Templates Group" presents, but the file Badge.styl is empty. Looks like this template has not been detected.
显而易见的解决办法——取而代之
groupDescriptor.addTemplate(FileTemplateDescriptor("Badge.styl"))
iii
groupDescriptor.addTemplate(FileTemplateDescriptor("Styles/Badge.styl"))
只改变档案的显示名称: