public class TemplateManagerImpl extends TemplateManager implements Disposable
Disposable.Parent
TEMPLATE_STARTED_TOPIC
Constructor and Description |
---|
TemplateManagerImpl(Project project) |
Modifier and Type | Method and Description |
---|---|
static OffsetsInFile |
copyWithDummyIdentifier(OffsetsInFile offsetMap,
int startOffset,
int endOffset,
java.lang.String replacement) |
Template |
createTemplate(java.lang.String key,
java.lang.String group) |
Template |
createTemplate(java.lang.String key,
java.lang.String group,
java.lang.String text) |
void |
dispose()
Usually not invoked directly, see class javadoc.
|
java.util.Map<TemplateImpl,java.lang.String> |
findMatchingTemplates(PsiFile file,
Editor editor,
java.lang.Character shortcutChar,
TemplateSettings templateSettings) |
boolean |
finishTemplate(Editor editor)
Finished a live template in the given editor, if it's present
|
Template |
getActiveTemplate(Editor editor) |
static java.util.List<TemplateContextType> |
getAllContextTypes() |
static java.util.Set<TemplateContextType> |
getApplicableContextTypes(PsiFile file,
int offset) |
static TemplateState |
getTemplateState(Editor editor) |
static boolean |
isApplicable(CustomLiveTemplate customLiveTemplate,
Editor editor,
PsiFile file) |
static boolean |
isApplicable(CustomLiveTemplate customLiveTemplate,
Editor editor,
PsiFile file,
boolean wrapping) |
static boolean |
isApplicable(PsiFile file,
int offset,
TemplateImpl template) |
static boolean |
isApplicable(TemplateImpl template,
java.util.Set<? extends TemplateContextType> contextTypes) |
static java.util.List<CustomLiveTemplate> |
listApplicableCustomTemplates(Editor editor,
PsiFile file,
boolean selectionOnly) |
static java.util.List<TemplateImpl> |
listApplicableTemplates(PsiFile file,
int offset,
boolean selectionOnly) |
static java.util.List<TemplateImpl> |
listApplicableTemplateWithInsertingDummyIdentifier(Editor editor,
PsiFile file,
boolean selectionOnly) |
java.lang.Runnable |
prepareTemplate(Editor editor,
char shortcutChar,
PairProcessor<? super java.lang.String,? super java.lang.String> processor) |
static void |
setTemplateTesting(Disposable parentDisposable) |
boolean |
shouldSkipInTests() |
java.lang.Runnable |
startNonCustomTemplates(java.util.Map<TemplateImpl,java.lang.String> template2argument,
Editor editor,
PairProcessor<? super java.lang.String,? super java.lang.String> processor) |
boolean |
startTemplate(Editor editor,
char shortcutChar) |
void |
startTemplate(Editor editor,
java.lang.String selectionString,
Template template) |
void |
startTemplate(Editor editor,
Template template) |
void |
startTemplate(Editor editor,
Template template,
boolean inSeparateCommand,
java.util.Map<java.lang.String,java.lang.String> predefinedVarValues,
TemplateEditingListener listener) |
void |
startTemplate(Editor editor,
Template template,
TemplateEditingListener listener) |
void |
startTemplate(Editor editor,
Template template,
TemplateEditingListener listener,
PairProcessor<? super java.lang.String,? super java.lang.String> processor) |
void |
startTemplateWithPrefix(Editor editor,
TemplateImpl template,
int templateStart,
PairProcessor<? super java.lang.String,? super java.lang.String> processor,
java.lang.String argument) |
void |
startTemplateWithPrefix(Editor editor,
TemplateImpl template,
PairProcessor<? super java.lang.String,? super java.lang.String> processor,
java.lang.String argument) |
getInstance
public TemplateManagerImpl(Project project)
public void dispose()
Disposable
dispose
in interface Disposable
public static void setTemplateTesting(Disposable parentDisposable)
public Template createTemplate(java.lang.String key, java.lang.String group)
createTemplate
in class TemplateManager
public Template createTemplate(java.lang.String key, java.lang.String group, java.lang.String text)
createTemplate
in class TemplateManager
public static TemplateState getTemplateState(Editor editor)
public boolean startTemplate(Editor editor, char shortcutChar)
startTemplate
in class TemplateManager
public void startTemplate(Editor editor, Template template)
startTemplate
in class TemplateManager
public void startTemplate(Editor editor, java.lang.String selectionString, Template template)
startTemplate
in class TemplateManager
public void startTemplate(Editor editor, Template template, TemplateEditingListener listener, PairProcessor<? super java.lang.String,? super java.lang.String> processor)
startTemplate
in class TemplateManager
public boolean shouldSkipInTests()
public void startTemplate(Editor editor, Template template, TemplateEditingListener listener)
startTemplate
in class TemplateManager
public void startTemplate(Editor editor, Template template, boolean inSeparateCommand, java.util.Map<java.lang.String,java.lang.String> predefinedVarValues, TemplateEditingListener listener)
startTemplate
in class TemplateManager
public java.lang.Runnable prepareTemplate(Editor editor, char shortcutChar, PairProcessor<? super java.lang.String,? super java.lang.String> processor)
public static boolean isApplicable(CustomLiveTemplate customLiveTemplate, Editor editor, PsiFile file)
public static boolean isApplicable(CustomLiveTemplate customLiveTemplate, Editor editor, PsiFile file, boolean wrapping)
public java.util.Map<TemplateImpl,java.lang.String> findMatchingTemplates(PsiFile file, Editor editor, java.lang.Character shortcutChar, TemplateSettings templateSettings)
public java.lang.Runnable startNonCustomTemplates(java.util.Map<TemplateImpl,java.lang.String> template2argument, Editor editor, PairProcessor<? super java.lang.String,? super java.lang.String> processor)
public void startTemplateWithPrefix(Editor editor, TemplateImpl template, PairProcessor<? super java.lang.String,? super java.lang.String> processor, java.lang.String argument)
public void startTemplateWithPrefix(Editor editor, TemplateImpl template, int templateStart, PairProcessor<? super java.lang.String,? super java.lang.String> processor, java.lang.String argument)
public static java.util.List<TemplateContextType> getAllContextTypes()
public Template getActiveTemplate(Editor editor)
getActiveTemplate
in class TemplateManager
public boolean finishTemplate(Editor editor)
TemplateManager
finishTemplate
in class TemplateManager
public static boolean isApplicable(PsiFile file, int offset, TemplateImpl template)
public static boolean isApplicable(TemplateImpl template, java.util.Set<? extends TemplateContextType> contextTypes)
public static java.util.List<TemplateImpl> listApplicableTemplates(PsiFile file, int offset, boolean selectionOnly)
public static java.util.List<TemplateImpl> listApplicableTemplateWithInsertingDummyIdentifier(Editor editor, PsiFile file, boolean selectionOnly)
public static java.util.List<CustomLiveTemplate> listApplicableCustomTemplates(Editor editor, PsiFile file, boolean selectionOnly)
public static java.util.Set<TemplateContextType> getApplicableContextTypes(PsiFile file, int offset)
public static OffsetsInFile copyWithDummyIdentifier(OffsetsInFile offsetMap, int startOffset, int endOffset, java.lang.String replacement)