public interface TemplateOptionalProcessor
getOptionName()
allows
to show a checkbox to enable/disable specific such aspect in Live Template settings, processText(com.intellij.openapi.project.Project, com.intellij.codeInsight.template.Template, com.intellij.openapi.editor.Document, com.intellij.openapi.editor.RangeMarker, com.intellij.openapi.editor.Editor)
does the actual
modifications during live template expansion.
During indexing, processText(com.intellij.openapi.project.Project, com.intellij.codeInsight.template.Template, com.intellij.openapi.editor.Document, com.intellij.openapi.editor.RangeMarker, com.intellij.openapi.editor.Editor)
is executed only for instances implementing DumbAware
.
Modifier and Type | Field and Description |
---|---|
static ExtensionPointName<TemplateOptionalProcessor> |
EP_NAME |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getOptionName() |
boolean |
isEnabled(Template template) |
default boolean |
isVisible(Template template)
Deprecated.
Please override
isVisible(Template, TemplateContext) |
default boolean |
isVisible(Template template,
TemplateContext context) |
void |
processText(Project project,
Template template,
Document document,
RangeMarker templateRange,
Editor editor)
Invoked inside a write action when a live template is finished.
|
default void |
setEnabled(Template template,
boolean value)
Change whether this processor is enabled for a given template.
|
static final ExtensionPointName<TemplateOptionalProcessor> EP_NAME
void processText(Project project, Template template, Document document, RangeMarker templateRange, Editor editor)
java.lang.String getOptionName()
boolean isEnabled(Template template)
default void setEnabled(Template template, boolean value)
default boolean isVisible(Template template, TemplateContext context)
@Deprecated default boolean isVisible(Template template)
isVisible(Template, TemplateContext)