public class EmptyPostfixTemplateProvider extends java.lang.Object implements PostfixTemplateProvider
Constructor and Description |
---|
EmptyPostfixTemplateProvider() |
Modifier and Type | Method and Description |
---|---|
void |
afterExpand(PsiFile file,
Editor editor)
Invoked after template finished (doesn't matter if it finished successfully or not).
|
java.lang.String |
getId()
Identifier of template provider.
|
java.util.Set<PostfixTemplate> |
getTemplates()
Returns builtin templates registered in the provider in their original state.
|
boolean |
isTerminalSymbol(char currentChar)
Check symbol can separate template keys
|
PsiFile |
preCheck(PsiFile copyFile,
Editor realEditor,
int currentOffset)
Prepare file for checking availability of templates.
|
void |
preExpand(PsiFile file,
Editor editor)
Prepare file for template expanding.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createEditor, getPresentableName, readExternalTemplate, writeExternalTemplate
public java.lang.String getId()
PostfixTemplateProvider
getId
in interface PostfixTemplateProvider
public java.util.Set<PostfixTemplate> getTemplates()
PostfixTemplateProvider
PostfixTemplatesUtils.getAvailableTemplates(PostfixTemplateProvider)
for actually enabled templates.getTemplates
in interface PostfixTemplateProvider
public boolean isTerminalSymbol(char currentChar)
PostfixTemplateProvider
isTerminalSymbol
in interface PostfixTemplateProvider
public void preExpand(PsiFile file, Editor editor)
PostfixTemplateProvider
File content doesn't contain template's key, it is deleted just before this method invocation.
Note that while postfix template is checking its availability the file parameter is a _COPY_ of the real file, so you can do with it anything that you want, but in the same time it doesn't recommended to modify editor state because it's real.
preExpand
in interface PostfixTemplateProvider
public void afterExpand(PsiFile file, Editor editor)
PostfixTemplateProvider
afterExpand
in interface PostfixTemplateProvider
public PsiFile preCheck(PsiFile copyFile, Editor realEditor, int currentOffset)
PostfixTemplateProvider
this#preExpand(PsiFile, Editor)
with several differences:
1. Processes copy of file. So implementations can modify it without corrupting the real file.
2. Could be invoked from anywhere (EDT, write-action, read-action, completion-thread etc.). So implementations should make
additional effort to make changes in file.
Content of file copy doesn't contain template's key, it is deleted just before this method invocation.
NOTE: editor is real (not copy) and it doesn't represents the copyFile. So it's safer to use currentOffset parameter instead of offset from editor. Do not modify text via editor.
preCheck
in interface PostfixTemplateProvider