I want to create a custom Live Template that will be available with my plugin. I know how to create custom Live Templates using the Settings dialog, but I want to be able to distribute the Live Template as part of my plugin:
Thanks.
using 12.1.5 I was able to accomplish this after looking at the groovy plugin source.
Go ahead and create your template using the settings dialog. It will store the resulting xml file somewhere under %home%/.Ideawhatever/config/templates
in group_name.xml
Copy this file into project/resources/liveTemplates
Create an implementation of DefaultLiveTemplatesProvider
and implement as follows:
@Override
public String[] getDefaultLiveTemplateFiles()
{
return new String[] {"liveTemplates/group_name"};
}
add the following under extensions in your plugin.xml
defaultLiveTemplatesProvider implementation="com.tridium.intellij.NiagaraTemplatesProvider"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With