Search in sources :

Example 1 with InitialInfo

use of org.jetbrains.plugins.groovy.refactoring.extract.InitialInfo in project intellij-community by JetBrains.

the class GroovyExtractMethodHandler method invokeImpl.

private void invokeImpl(Project project, Editor editor, PsiFile file, final int startOffset, final int endOffset) {
    try {
        final InitialInfo initialInfo = GroovyExtractChooser.invoke(project, editor, file, startOffset, endOffset, true);
        if (findConflicts(initialInfo))
            return;
        performRefactoring(initialInfo, editor);
    } catch (GrRefactoringError e) {
        CommonRefactoringUtil.showErrorHint(project, editor, e.getMessage(), REFACTORING_NAME, HelpID.EXTRACT_METHOD);
    }
}
Also used : GrRefactoringError(org.jetbrains.plugins.groovy.refactoring.GrRefactoringError) InitialInfo(org.jetbrains.plugins.groovy.refactoring.extract.InitialInfo)

Example 2 with InitialInfo

use of org.jetbrains.plugins.groovy.refactoring.extract.InitialInfo in project intellij-community by JetBrains.

the class GrIntroduceParameterHandler method invoke.

private void invoke(@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file, int startOffset, int endOffset) {
    try {
        final InitialInfo initialInfo = GroovyExtractChooser.invoke(project, editor, file, startOffset, endOffset, false);
        chooseScopeAndRun(initialInfo, editor);
    } catch (GrRefactoringError e) {
        if (ApplicationManager.getApplication().isUnitTestMode())
            throw e;
        CommonRefactoringUtil.showErrorHint(project, editor, e.getMessage(), RefactoringBundle.message("introduce.parameter.title"), HelpID.GROOVY_INTRODUCE_PARAMETER);
    }
}
Also used : GrRefactoringError(org.jetbrains.plugins.groovy.refactoring.GrRefactoringError) InitialInfo(org.jetbrains.plugins.groovy.refactoring.extract.InitialInfo)

Aggregations

GrRefactoringError (org.jetbrains.plugins.groovy.refactoring.GrRefactoringError)2 InitialInfo (org.jetbrains.plugins.groovy.refactoring.extract.InitialInfo)2