@Override
    protected void init() {
        super.init();

        ExtractableCodeDescriptor extractableCodeDescriptor = originalDescriptor.getDescriptor();

        functionNameField = new NameSuggestionsField(
                //TODO ArrayUtil.toStringArray(extractableCodeDescriptor.getSuggestedNames()),
                // without type pointers (see KT-60484), combobox with names fires events which invalidate types precalculated by first phase of refactoring
                new String[] { extractableCodeDescriptor.getName() },
                project,
                PlainTextFileType.INSTANCE
        );
        functionNameField.addDataChangedListener(() -> update());
        functionNamePanel.add(functionNameField, BorderLayout.CENTER);
        functionNameLabel.setLabelFor(functionNameField);

        KtElement context = originalDescriptor.getDescriptor().getContext();
        List<KaType> possibleReturnTypes = ExtractableCodeDescriptorKt.getPossibleReturnTypes(extractableCodeDescriptor.getControlFlow());
        if (!possibleReturnTypes.isEmpty()) {
            List<KtTypeCodeFragment> fragments = ContainerUtil.map(possibleReturnTypes,
                                                                   t -> new KtPsiFactory(project).createTypeCodeFragment(
                                                                           PresentationUtilKt.render(t, context), context));
            DefaultComboBoxModel<KtTypeCodeFragment> returnTypeBoxModel =
                    new DefaultComboBoxModel<>(fragments.toArray(new KtTypeCodeFragment[0]));
            returnTypeBox.setModel(returnTypeBoxModel);
            returnTypeBox.setRenderer(
                    new DefaultListCellRenderer() {
                        @NotNull
                        @Override
                        public Component getListCellRendererComponent(
                                JList list,
                                Object value,
                                int index,
                                boolean isSelected,
                                boolean cellHasFocus
                        ) {
                            @NlsSafe
                            String text = ((KtTypeCodeFragment) value).getText();
                            setText(text);
                            return this;
                        }
                    }
            );
            returnTypeBox.addItemListener(
                    new ItemListener() {
                        @Override
                        public void itemStateChanged(@NotNull ItemEvent e) {
                            update();
                        }
                    }
            );
        } else {
            returnTypePanel.getParent().remove(returnTypePanel);
        }

        visibilityBox.setModel(new DefaultComboBoxModel(KtTokens.VISIBILITY_MODIFIERS.getTypes()));

        boolean enableVisibility = isVisibilitySectionAvailable();
        visibilityBox.setEnabled(enableVisibility);
        if (enableVisibility) {
            KtModifierKeywordToken defaultVisibility = extractableCodeDescriptor.getVisibility();
            visibilityBox.setSelectedItem(defaultVisibility);
        }
        visibilityBox.addItemListener(
                new ItemListener() {
                    @Override
                    public void itemStateChanged(@NotNull ItemEvent e) {
                        update();
                    }
                }
        );

        parameterTablePanel = new FirExtractFunctionParameterTablePanel() {
            @NotNull
            @Override
            public KtElement getContext() {
                return context;
            }

            @Override
            protected void updateSignature() {
                KotlinFirExtractFunctionDialog.this.update();
            }

            @Override
            protected void onEnterAction() {
                doOKAction();
            }

            @Override
            protected void onCancelAction() {
                doCancelAction();
            }
        };
        parameterTablePanel.init(extractableCodeDescriptor.getReceiverParameter(), extractableCodeDescriptor.getParameters());

        inputParametersPanel.setText(KotlinBundle.message("text.parameters"));
        inputParametersPanel.setLabelFor(parameterTablePanel.getTable());
        inputParametersPanel.add(parameterTablePanel);
    }
@Override
    protected void init()