Custom liveTemplate context

Hi, is there any way of introducing own liveTemplate context?

0
Avatar
Permanently deleted user

Aha, solution is in implementing DefaultLiveTemplatesProvider.

Answer's closed.

0

Hello Valeriy,

Unless I'm mistaken in understanding your goal, the DefaultLiveTemplatesProvider
has nothing to do with live template contexts. To provide a custom live template
context, you need to extend TemplateContextType and register it as liveTemplateContext
extension.

Aha, solution is in implementing DefaultLiveTemplatesProvider.

Answer's closed.


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Avatar
Permanently deleted user

Hi, 

Actually, I did not get how to use the class which extends "TemplateContextType" for getting own live template context using code.

In my plugin, I have a text and checkbox same as the android live template to add the template in IntelliJ but did not get how to set the template context using code.

I use hardcoded code like this 

====================================

final TemplateContextType contextTypeTemp = ContainerUtil.findInstance(TemplateContextType.EP_NAME.getExtensions(), JavaCodeContextType.class); ((TemplateImpl) template).getTemplateContext().setEnabled(contextTypeTemp, true);

====================================

for java context, but what about others and dynamic scenario?

0

请先登录再写评论。