IntroduceVariableSettings (Project project, Editor editor, PsiExpression expr, PsiExpression[] occurrences, TypeSelectorManagerImpl typeSelectorManager, boolean declareFinalIfAll, boolean anyAssignmentLHS, InputValidator validator, PsiElement anchor, JavaReplaceChoice replaceChoice) { boolean isDeclareVarType = myDeclareVar && canBeExtractedWithoutExplicitType(expr); return new IntroduceVariableSettings() { @Override public @NlsSafe String getEnteredName() { return myName; } @Override public boolean isReplaceAllOccurrences() { return myReplaceAll && occurrences.length > 1; } @Override public boolean isDeclareFinal() { return myDeclareFinal || isReplaceAllOccurrences() && declareFinalIfAll; } @Override public boolean isReplaceLValues() { return myReplaceLValues; } @Override public PsiType getSelectedType() { return typeSelectorManager.getDefaultType(); } @Override public boolean isOK() { return true; } @Override public boolean isDeclareVarType() { return isDeclareVarType; } }; }