Java Code Examples for com.intellij.codeInsight.template.impl.TemplateManagerImpl#isApplicable()
The following examples show how to use
com.intellij.codeInsight.template.impl.TemplateManagerImpl#isApplicable() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CustomTemplateCallback.java From consulo with Apache License 2.0 | 4 votes |
private boolean isAvailableTemplate(@Nonnull TemplateImpl template) { if (myApplicableContextTypes == null) { myApplicableContextTypes = TemplateManagerImpl.getApplicableContextTypes(myFile, myOffset); } return !template.isDeactivated() && TemplateManagerImpl.isApplicable(template, myApplicableContextTypes); }
Example 2
Source File: PostfixTemplateCompletionContributor.java From consulo with Apache License 2.0 | 4 votes |
@Nullable public static PostfixLiveTemplate getPostfixLiveTemplate(@Nonnull PsiFile file, @Nonnull Editor editor) { PostfixLiveTemplate postfixLiveTemplate = CustomLiveTemplate.EP_NAME.findExtension(PostfixLiveTemplate.class); return postfixLiveTemplate != null && TemplateManagerImpl.isApplicable(postfixLiveTemplate, editor, file) ? postfixLiveTemplate : null; }