diff options
author | Tor Norbye <tnorbye@google.com> | 2014-08-19 12:53:10 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2014-08-19 12:53:10 -0700 |
commit | 02cf98d65c798d368fcec43ed64a001d513bdd4f (patch) | |
tree | e39e210ab20917b7e5ffdce14a42f5747506eed0 /platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/ParenthesizedPostfixTemplate.java | |
parent | 2e5965e996aad62ab1338b09d54caaf99ff3dd6a (diff) | |
download | idea-02cf98d65c798d368fcec43ed64a001d513bdd4f.tar.gz |
Snapshot idea/138.1503 from git://git.jetbrains.org/idea/community.git
Change-Id: Ie01af1d8710ec0ff51d90301bda1a18b0b5c0faf
Diffstat (limited to 'platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/ParenthesizedPostfixTemplate.java')
-rw-r--r-- | platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/ParenthesizedPostfixTemplate.java | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/ParenthesizedPostfixTemplate.java b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/ParenthesizedPostfixTemplate.java index 9a5d03a9359c..3f1dd1143348 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/ParenthesizedPostfixTemplate.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/ParenthesizedPostfixTemplate.java @@ -16,16 +16,25 @@ package com.intellij.codeInsight.template.postfix.templates; import com.intellij.openapi.editor.Editor; +import com.intellij.openapi.util.Condition; import com.intellij.psi.PsiElement; import org.jetbrains.annotations.NotNull; -public class ParenthesizedPostfixTemplate extends ExpressionPostfixTemplateWithChooser { - public ParenthesizedPostfixTemplate(PostfixTemplatePsiInfoBase psiInfo) { - super("par", "(expr)", psiInfo); +import static com.intellij.codeInsight.template.postfix.templates.PostfixTemplatesUtils.selectorWithChooser; + +public class ParenthesizedPostfixTemplate extends PostfixTemplateWithExpressionSelector { + + public ParenthesizedPostfixTemplate(PostfixTemplatePsiInfo psiInfo, Condition<PsiElement> condition) { + super("par", "(expr)", psiInfo, selectorWithChooser(condition)); + } + + + public ParenthesizedPostfixTemplate(PostfixTemplatePsiInfo psiInfo) { + super("par", "(expr)", psiInfo, selectorWithChooser()); } @Override - protected void doIt(@NotNull Editor editor, @NotNull PsiElement expression) { - expression.replace(myInfo.createExpression(expression, "(", ")")); + protected void expandForChooseExpression(@NotNull PsiElement expression, @NotNull Editor editor) { + expression.replace(myPsiInfo.createExpression(expression, "(", ")")); } }
\ No newline at end of file |