@Override
    public void invoke(@NotNull Project project, Editor editor, PsiFile file, DataContext dataContext){
        final ScrollingModel scrollingModel = editor.getScrollingModel();
        scrollingModel.scrollToCaret(ScrollType.MAKE_VISIBLE);
        PsiMethod selectedMethod = getSelectedMethod(editor, file);
        if(selectedMethod == null){
          CommonRefactoringUtil.showErrorHint(project, editor, RefactorJBundle.message("cannot.perform.the.refactoring") + RefactorJBundle.message(
              "the.caret.should.be.positioned.within.a.method.declaration.to.be.refactored"), getRefactoringNameText(), this.getHelpID());
          return;
        }
        invoke(project, selectedMethod, editor);
    }
@Override
    public void invoke(@NotNull Project project, Editor editor, PsiFile file, DataContext dataContext)