Invoking a Live Template programmatically

已回答

Hi there,

I am designing a plug-in and I need to invoke a live template from code. How would you do this programmatically? I already registered a custom action and I would like to invoke the live template from the actionPerformed() callback. 

Thank you.

0
正式评论

Please use TemplateManager#startTemplate

Avatar
Permanently deleted user

Thanks :) Now I just need to find out where to get a handle to the Template I'd like to use.

0

If it's a template that you see in Live Template settings, then you can find it in TemplateSettings.getInstance().getTemplate(...)

0
Avatar
Permanently deleted user

Perfect :)

0
Avatar
Permanently deleted user
0

请先登录再写评论。