JPanel () { final JPanel defaultValuePanel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 4, 2, true, false)); final Document doc = PsiDocumentManager.getInstance(getProject()).getDocument(item.defaultValueCodeFragment); myDefaultValueEditor = new EditorTextField(doc, getProject(), getFileType()); final JBLabel defaultValueLabel = new JBLabel(RefactoringBundle.message("changeSignature.default.value.label"), UIUtil.ComponentStyle.SMALL); defaultValuePanel.add(defaultValueLabel); defaultValuePanel.add(myDefaultValueEditor); myDefaultValueEditor.setPreferredWidth(getTable().getWidth() / 2); myDefaultValueEditor.setFont(EditorUtil.getEditorFont()); // The corresponding PyParameterInfo field can't be updated by just RowEditorChangeListener(1) // because the corresponding column value is not String but Pair<PsiCodeFragment, Boolean>. myDefaultValueEditor.addDocumentListener(new DocumentListener() { @Override public void documentChanged(@NotNull DocumentEvent event) { item.parameter.setDefaultValue(myDefaultValueEditor.getText().trim()); } }); myDefaultValueEditor.addDocumentListener(mySignatureUpdater); return defaultValuePanel; }