IntroduceVariableSettings (Project project, Editor editor, PsiExpression expr, PsiExpression[] occurrences, TypeSelectorManagerImpl typeSelectorManager, boolean declareFinalIfAll, boolean anyAssignmentLHS, final InputValidator validator, PsiElement anchor, JavaReplaceChoice replaceChoice) { if (replaceChoice != null) { return super.getSettings(project, editor, expr, occurrences, typeSelectorManager, declareFinalIfAll, anyAssignmentLHS, validator, anchor, replaceChoice); } ArrayList<RangeHighlighter> highlighters = new ArrayList<>(); HighlightManager highlightManager = null; if (editor != null) { highlightManager = HighlightManager.getInstance(project); if (occurrences.length > 1) { highlightManager.addOccurrenceHighlights(editor, occurrences, EditorColors.SEARCH_RESULT_ATTRIBUTES, true, highlighters); } } IntroduceVariableDialog dialog = new IntroduceVariableDialog( project, expr, occurrences.length, anyAssignmentLHS, declareFinalIfAll, typeSelectorManager, validator); if (!dialog.showAndGet()) { if (occurrences.length > 1) { WindowManager.getInstance().getStatusBar(project).setInfo(RefactoringBundle.message("press.escape.to.remove.the.highlighting")); } } else { if (editor != null) { for (RangeHighlighter highlighter : highlighters) { highlightManager.removeSegmentHighlighter(editor, highlighter); } } } return dialog; }