public class TemplateBuilderImpl extends java.lang.Object implements TemplateBuilder
Constructor and Description |
---|
TemplateBuilderImpl(PsiElement element) |
Modifier and Type | Method and Description |
---|---|
Template |
buildInlineTemplate() |
Template |
buildTemplate() |
int |
getElementsCount() |
void |
replaceElement(PsiElement element,
Expression expression)
Creates a replacement box for the specified element with the specified expression.
|
void |
replaceElement(PsiElement element,
Expression expression,
boolean alwaysStopAt) |
void |
replaceElement(PsiElement element,
java.lang.String replacementText)
Creates a replacement box for the specified element with the specified initial value.
|
void |
replaceElement(PsiElement element,
java.lang.String varName,
Expression expression,
boolean alwaysStopAt) |
void |
replaceElement(PsiElement element,
java.lang.String varName,
Expression expression,
boolean alwaysStopAt,
boolean skipOnStart) |
void |
replaceElement(PsiElement element,
java.lang.String varName,
java.lang.String dependantVariableName,
boolean alwaysStopAt) |
void |
replaceElement(PsiElement element,
TextRange rangeWithinElement,
Expression expression) |
void |
replaceElement(PsiElement element,
TextRange rangeWithinElement,
java.lang.String replacementText) |
void |
replaceElement(PsiElement element,
TextRange textRange,
java.lang.String varName,
Expression expression,
boolean alwaysStopAt) |
void |
replaceElement(PsiElement element,
TextRange textRange,
java.lang.String primaryVariableName,
java.lang.String otherVariableName,
boolean alwaysStopAt) |
void |
replaceElement(PsiReference ref,
java.lang.String varName,
Expression expression,
boolean alwaysStopAt) |
void |
replaceElement(PsiReference ref,
java.lang.String varName,
java.lang.String dependantVariableName,
boolean alwaysStopAt) |
void |
replaceElement(TextRange rangeWithinElement,
java.lang.String varName,
java.lang.String dependantVariableName,
boolean alwaysStopAt) |
void |
replaceRange(TextRange rangeWithinElement,
Expression expression)
Creates a replacement box for the specified text range within the container element.
|
void |
replaceRange(TextRange rangeWithinElement,
java.lang.String replacementText)
Creates a replacement box for the specified text range within the container element.
|
void |
replaceRange(TextRange rangeWithinElement,
java.lang.String varName,
Expression expression,
boolean alwaysStopAt) |
void |
run()
Shows the live template and initiates editing process.
|
void |
run(Editor editor,
boolean inline)
Shows the live template and initiates editing process.
|
void |
setEndVariableAfter(PsiElement element)
Adds end variable after the specified element
|
void |
setEndVariableBefore(PsiElement element) |
void |
setGreedyToRight(boolean greedy) |
void |
setSelection(PsiElement element) |
public TemplateBuilderImpl(PsiElement element)
public void setGreedyToRight(boolean greedy)
public int getElementsCount()
public void replaceElement(PsiElement element, Expression expression, boolean alwaysStopAt)
public void replaceElement(PsiElement element, java.lang.String varName, Expression expression, boolean alwaysStopAt)
public void replaceElement(PsiReference ref, java.lang.String varName, Expression expression, boolean alwaysStopAt)
public void replaceElement(PsiElement element, TextRange textRange, java.lang.String varName, Expression expression, boolean alwaysStopAt)
public void replaceElement(PsiElement element, java.lang.String varName, java.lang.String dependantVariableName, boolean alwaysStopAt)
public void replaceElement(PsiReference ref, java.lang.String varName, java.lang.String dependantVariableName, boolean alwaysStopAt)
public void replaceElement(PsiElement element, TextRange textRange, java.lang.String primaryVariableName, java.lang.String otherVariableName, boolean alwaysStopAt)
public void replaceElement(PsiElement element, Expression expression)
TemplateBuilder
replaceElement
in interface TemplateBuilder
element
- the element to replace.expression
- the replacement expression.public void replaceElement(PsiElement element, TextRange rangeWithinElement, Expression expression)
replaceElement
in interface TemplateBuilder
public void replaceRange(TextRange rangeWithinElement, java.lang.String replacementText)
TemplateBuilder
replaceRange
in interface TemplateBuilder
rangeWithinElement
- range within the container element.replacementText
- the initial value for the replacement.public void replaceRange(TextRange rangeWithinElement, Expression expression)
TemplateBuilder
replaceRange
in interface TemplateBuilder
rangeWithinElement
- range within the container element.expression
- the replacement expression.public void setEndVariableAfter(PsiElement element)
public void setEndVariableBefore(PsiElement element)
public void setSelection(PsiElement element)
public Template buildInlineTemplate()
public Template buildTemplate()
public void replaceElement(PsiElement element, java.lang.String replacementText)
TemplateBuilder
replaceElement
in interface TemplateBuilder
element
- the element to replace.replacementText
- the initial value for the replacement.public void replaceElement(PsiElement element, TextRange rangeWithinElement, java.lang.String replacementText)
replaceElement
in interface TemplateBuilder
public void run()
TemplateBuilder
run
in interface TemplateBuilder
public void run(Editor editor, boolean inline)
TemplateBuilder
run
in interface TemplateBuilder
editor
- editor to use to start editing process.inline
- if true then inline template will be created, regular otherwisepublic void replaceElement(PsiElement element, java.lang.String varName, Expression expression, boolean alwaysStopAt, boolean skipOnStart)
public void replaceRange(TextRange rangeWithinElement, java.lang.String varName, Expression expression, boolean alwaysStopAt)
public void replaceElement(TextRange rangeWithinElement, java.lang.String varName, java.lang.String dependantVariableName, boolean alwaysStopAt)