Search in sources :

Example 1 with GrIntroduceVariableHandler

use of org.jetbrains.plugins.groovy.refactoring.introduce.variable.GrIntroduceVariableHandler in project intellij-community by JetBrains.

the class GrIntroduceParameterHandler method createContext.

private static GrIntroduceContext createContext(@NotNull IntroduceParameterInfo info, @NotNull Editor editor) {
    GrExpression expr = GroovyIntroduceParameterUtil.findExpr(info);
    GrVariable var = GroovyIntroduceParameterUtil.findVar(info);
    StringPartInfo stringPart = info.getStringPartInfo();
    return new GrIntroduceVariableHandler().getContext(info.getProject(), editor, expr, var, stringPart, info.getToReplaceIn());
}
Also used : GrVariable(org.jetbrains.plugins.groovy.lang.psi.api.statements.GrVariable) GrExpression(org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression) StringPartInfo(org.jetbrains.plugins.groovy.refactoring.introduce.StringPartInfo) GrIntroduceVariableHandler(org.jetbrains.plugins.groovy.refactoring.introduce.variable.GrIntroduceVariableHandler)

Example 2 with GrIntroduceVariableHandler

use of org.jetbrains.plugins.groovy.refactoring.introduce.variable.GrIntroduceVariableHandler in project intellij-community by JetBrains.

the class GrIntroduceLocalVariableIntention method processIntention.

@Override
protected void processIntention(@NotNull final PsiElement element, @NotNull final Project project, final Editor editor) throws IncorrectOperationException {
    setSelection(editor, getTargetExpression(element));
    final PsiFile file = element.getContainingFile();
    new GrIntroduceVariableHandler().invoke(project, editor, file, null);
}
Also used : PsiFile(com.intellij.psi.PsiFile) GrIntroduceVariableHandler(org.jetbrains.plugins.groovy.refactoring.introduce.variable.GrIntroduceVariableHandler)

Aggregations

GrIntroduceVariableHandler (org.jetbrains.plugins.groovy.refactoring.introduce.variable.GrIntroduceVariableHandler)2 PsiFile (com.intellij.psi.PsiFile)1 GrVariable (org.jetbrains.plugins.groovy.lang.psi.api.statements.GrVariable)1 GrExpression (org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression)1 StringPartInfo (org.jetbrains.plugins.groovy.refactoring.introduce.StringPartInfo)1