void (@NotNull final Project project, final Editor editor, final PsiFile file, DataContext dataContext) { PsiDocumentManager.getInstance(project).commitAllDocuments(); editor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE); ElementToWorkOn.processElementToWorkOn(editor, file, getRefactoringName(), HelpID.INTRODUCE_PARAMETER, project, new ElementToWorkOn.ElementsProcessor<>() { @Override public boolean accept(ElementToWorkOn el) { return true; } @Override public void pass(final ElementToWorkOn elementToWorkOn) { if (elementToWorkOn == null) { return; } if (elementToWorkOn.getLocalVariable() == null && elementToWorkOn.getExpression() == null) { if (!introduceStrategy(project, editor, file)) { ElementToWorkOn.showNothingSelectedErrorMessage(editor, getRefactoringName(), HelpID.INTRODUCE_PARAMETER, project); } return; } final PsiExpression expr = elementToWorkOn.getExpression(); final PsiLocalVariable localVar = elementToWorkOn.getLocalVariable(); final boolean isInvokedOnDeclaration = elementToWorkOn.isInvokedOnDeclaration(); invoke(editor, project, expr, localVar, isInvokedOnDeclaration); } }); }