English 中文(简体)
关于英特尔利J IDEA SDK的`集团Descriptor.addTemplate(FileTemplateDescriptor(XXX)'中的`XXX'参数是什么?
原标题:Into what parameter `XXX` refers in `groupDescriptor.addTemplate(FileTemplateDescriptor(XXX))` of IntelliJ IDEA SDK?

我想在我的英特尔利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无此类档案:

“entergraph

用其他词语回答一个问题:当图象活跃时,英特尔法协会正在发现上述图像档案中所提到的情况?

在我的案件中,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

“enterography

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.

“enterography

显而易见的解决办法——取而代之

groupDescriptor.addTemplate(FileTemplateDescriptor("Badge.styl"))

iii

groupDescriptor.addTemplate(FileTemplateDescriptor("Styles/Badge.styl"))

只改变档案的显示名称:

“entergraph

问题回答

暂无回答




相关问题
IntelliJ IDEA hint parameters of method

I m just swapping from eclipse to IntelliJ, and I can t find this particular feature. In Eclipse, when the cursor is inside the brackets of a method-call and I press Ctrl+Space, it tells me which ...

will installing several IDEs cause problems

I m trying to evaluate a number of IDEs like Eclipse, intelliJ, Aptana, etc. to see which one suits my needs. My question is should I expect any problems from installing several IDEs on the same ...

Restoring the IntelliJ IDEA "Project tab"

By default the IntelliJ IDEA interface contains the following tabs/panels: Project (tabbed to the left) Structure (tabbed to the left) Commander (tabbed to the right) Ant Build (tabbed to the right) ...

Grails 1.1 and how to info level logging

Which setting do I now use to produce logging output with log.info statements within my own controllers? Here s what I ve setup in config.groovy and I thought placing my domain under the info level ...

How to move IntelliJ file tabs?

In IntelliJ, when you open a bunch of source files, is there a way to rearrange the order of the file tabs? In Eclipse you can drag and drop but I don t see a way to do this in IntelliJ.

How to clear the IntelliJ project index?

I ve run into trouble that makes me suspect there is a bad index file that needs to be cleared. The symptoms are: Cmd+N will only find a subset of classes in the project Trying to run JUnit test on a ...

Limiting IntelliJ IDEA import suggestions on completion

When I type the name of a class which will need to be imported, IntelliJ lovingly pops up with a list of suggestions. However, most of the time those suggestions are things I d never want to import, ...

热门标签