AbstractExtractDialog (boolean direct) { setDataFromInputVariables(); return new ExtractMethodDialog(myProject, myTargetClass, myInputVariables, null, getTypeParameterList(), getThrownExceptions(), isStatic(), isCanBeStatic(), false, IntroduceFunctionalVariableAction.getRefactoringName(), HelpID.INTRODUCE_VARIABLE, null, myElements, null) { @Override protected JComponent createNorthPanel() { if (!myInputVariables.hasInstanceFields()) { return null; } JPanel optionsPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 5)); createStaticOptions(optionsPanel, JavaRefactoringBundle.message("introduce.functional.variable.pass.fields.checkbox")); return optionsPanel; } @Override public JComponent getPreferredFocusedComponent() { return myParamTable; } @Override protected String getSignature() { String parametersList = Arrays.stream(getChosenParameters()) .filter(data -> data.passAsParameter) .map(data -> data.type.getPresentableText()) .reduce((result, item) -> result + ", " + item) .orElse(""); String returnTypeString = myReturnType == null || PsiTypes.voidType().equals(myReturnType) ? "{}" : myReturnType.getPresentableText(); return "(" + parametersList + ") -> " + returnTypeString; } @Override protected void checkMethodConflicts(MultiMap<PsiElement, @NlsContexts.DialogMessage String> conflicts) { checkParametersConflicts(conflicts); for (VariableData data : getChosenParameters()) { if (!data.passAsParameter) { PsiElement scope = PsiUtil.getVariableCodeBlock(data.variable, null); if (PsiUtil.isLanguageLevel8OrHigher(data.variable) ? scope != null && !HighlightControlFlowUtil.isEffectivelyFinal(data.variable, scope, null) : data.variable.hasModifierProperty(PsiModifier.FINAL)) { conflicts.putValue(null, JavaBundle.message("introduce.functional.variable.accessibility.conflict", data.name)); } } } } @NotNull @Override public String getVisibility() { return PsiModifier.PUBLIC; } }; }