-
Notifications
You must be signed in to change notification settings - Fork 7
Home
To create an empty template, click on the "Tools" -> "Create New Template" menu item
In the Dialog box enter the name of the template
The plugin will create an empty template at the root of your project.
All templates are stored in the folder "Your project name"/templates
The heart of the template is the Json file Main
Inside it has a structure
Key | Value | comment |
---|---|---|
name | Name Template | |
description | Description Template | |
path | Path to Template | |
param | Variables to insert into the template | list String |
addFile | Files to create | list object File |
The parameter is an array of strings. It can be in the File Structure in name and path. And also in the template itself.
It is declared in brackets {param}
Example
There is a default parameter for Java and Kotlin {package}
When creating files from a template, the plugin will correct to fill in the parameter fields.
Key | Value | comment |
---|---|---|
name | Name when creating a file | You can use Param in the name |
path | Additional directories for saving | You can use Param in the name. Creates a catalog automatically if it does not exist |
fileTemplatePath | The name of the template from which the file is created | It must be specified with the extension .tm and you can specify the directory where this file is located |
To create a file from a template, right-click on the gurney in which we want to create and select the template we need from the list
To add a file to the template, right-click on it and select "Add file in template" The plugin will ask you to choose which template you want to add (if there are several of them) and will ask you to rename the file as it will be named in the template.