diff options
Diffstat (limited to 'platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/PostfixTemplatesUtils.java')
-rw-r--r-- | platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/PostfixTemplatesUtils.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/PostfixTemplatesUtils.java b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/PostfixTemplatesUtils.java index 877e10b53490..5ff744e3d72a 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/PostfixTemplatesUtils.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/PostfixTemplatesUtils.java @@ -21,6 +21,8 @@ import com.intellij.lang.surroundWith.Surrounder; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.extensions.ExtensionPointName; import com.intellij.openapi.project.Project; +import com.intellij.openapi.util.Condition; +import com.intellij.openapi.util.Conditions; import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiElement; import com.intellij.refactoring.util.CommonRefactoringUtil; @@ -31,6 +33,22 @@ public abstract class PostfixTemplatesUtils { private PostfixTemplatesUtils() { } + public static PostfixTemplateExpressionSelector selectorWithChooser() { + return selectorWithChooser(Conditions.<PsiElement>alwaysTrue()); + } + + public static PostfixTemplateExpressionSelector selectorTopmost() { + return selectorTopmost(Conditions.<PsiElement>alwaysTrue()); + } + + public static PostfixTemplateExpressionSelector selectorWithChooser(Condition<PsiElement> condition) { + return new ChooserExpressionSelector(condition); + } + + public static PostfixTemplateExpressionSelector selectorTopmost(Condition<PsiElement> condition) { + return new TopmostExpressionSelector(condition); + } + @Nullable public static TextRange surround(@NotNull Surrounder surrounder, @NotNull Editor editor, |