public class PostfixLiveTemplate extends CustomLiveTemplateBase
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
POSTFIX_TEMPLATE_ID |
EP_NAME
Constructor and Description |
---|
PostfixLiveTemplate() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
computeTemplateKey(CustomTemplateCallback callback) |
java.lang.String |
computeTemplateKeyWithoutContextChecking(CustomTemplateCallback callback) |
static PsiFile |
copyFile(PsiFile file,
java.lang.StringBuilder fileContentWithoutKey) |
void |
expand(java.lang.String key,
CustomTemplateCallback callback) |
static void |
expandTemplate(java.lang.String key,
CustomTemplateCallback callback,
Editor editor,
PostfixTemplateProvider provider,
PostfixTemplate postfixTemplate) |
java.util.Set<java.lang.String> |
getAllTemplateKeys(PsiFile file,
int offset) |
java.util.Collection<? extends CustomLiveTemplateLookupElement> |
getLookupElements(PsiFile file,
Editor editor,
int offset)
Return lookup elements for popup that appears on ListTemplateAction (Ctrl + J)
|
char |
getShortcut() |
java.lang.String |
getTitle() |
boolean |
hasCompletionItem(CustomTemplateCallback callback,
int offset)
Implementation should returns
true if it has own lookup item in completion autopopup
and it is supposed that template should be expanded while completion auto-popup is active. |
boolean |
isApplicable(CustomTemplateCallback callback,
int offset,
boolean wrapping) |
static boolean |
isApplicableTemplate(PostfixTemplateProvider provider,
java.lang.String key,
PsiFile file,
Editor editor) |
boolean |
supportsMultiCaret() |
boolean |
supportsWrapping() |
void |
wrap(java.lang.String selection,
CustomTemplateCallback callback) |
addCompletions
public static final java.lang.String POSTFIX_TEMPLATE_ID
public java.util.Set<java.lang.String> getAllTemplateKeys(PsiFile file, int offset)
public java.lang.String computeTemplateKey(CustomTemplateCallback callback)
public java.lang.String computeTemplateKeyWithoutContextChecking(CustomTemplateCallback callback)
computeTemplateKeyWithoutContextChecking
in class CustomLiveTemplateBase
public boolean supportsMultiCaret()
supportsMultiCaret
in class CustomLiveTemplateBase
public void expand(java.lang.String key, CustomTemplateCallback callback)
public static void expandTemplate(java.lang.String key, CustomTemplateCallback callback, Editor editor, PostfixTemplateProvider provider, PostfixTemplate postfixTemplate)
public boolean isApplicable(CustomTemplateCallback callback, int offset, boolean wrapping)
public boolean supportsWrapping()
public void wrap(java.lang.String selection, CustomTemplateCallback callback)
public java.lang.String getTitle()
public char getShortcut()
public boolean hasCompletionItem(CustomTemplateCallback callback, int offset)
CustomLiveTemplateBase
true
if it has own lookup item in completion autopopup
and it is supposed that template should be expanded while completion auto-popup is active.hasCompletionItem
in class CustomLiveTemplateBase
public java.util.Collection<? extends CustomLiveTemplateLookupElement> getLookupElements(PsiFile file, Editor editor, int offset)
CustomLiveTemplateBase
getLookupElements
in class CustomLiveTemplateBase
public static PsiFile copyFile(PsiFile file, java.lang.StringBuilder fileContentWithoutKey)
public static boolean isApplicableTemplate(PostfixTemplateProvider provider, java.lang.String key, PsiFile file, Editor editor)