How to get IDE template path in plugin development?

Answered

As shown in the title, I want to develop a custom Intellij plugin to add some code templates for people. Also, where can I get complete api documentation? Any help would be appreciated.

10 comments
Comment actions Permalink

U can inspect PathManager.java

I'm using:

new File( FileTemplatesScheme.DEFAULT.getTemplatesDir() + File.separator + "code" + File.separator + "newTemplate.extension" );
-1
Comment actions Permalink

Please use com.intellij.ide.fileTemplates.FileTemplateManager to access templates, new ones can registered via extension point com.intellij.ide.fileTemplates.FileTemplateGroupDescriptorFactory

0
Comment actions Permalink

How to add description to FileTemplate?

0
Comment actions Permalink

Add corresponding *.html file next to the *.ft template file

0
Comment actions Permalink

The android templates folder path just like: "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.2.4\plugins\android\lib\templates", how to get it ?

0
Comment actions Permalink

Why do you need to achieve the physical path, what are you trying to achieve?

0
Comment actions Permalink

I created a template for the Android MVP framework, for the convenience of dissemination to other people, I want to develop a android-studio plugin, just click the menu in IDE, than the template file (like globals.xml.ftl, recipe.xml.ftl, template.xml and other ftl file)  auto extract to this directory.

0
Comment actions Permalink

@Arsen, thanks for your answer, but above is not what I want. Look at the pictures below.

And these templates store in this folder.

How to get the folder path?

0
Comment actions Permalink

Please take a look at com.intellij.ide.fileTemplates.actions.CreateFromTemplateActionBase

0

Please sign in to leave a comment.