JPanel () { final JPanel namePanel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 4, 2, true, false)); myNameEditor = new EditorTextField(item.parameter.getName(), getProject(), getFileType()); final JBLabel nameLabel = new JBLabel(PyBundle.message("refactoring.change.signature.dialog.name.label"), UIUtil.ComponentStyle.SMALL); namePanel.add(nameLabel); namePanel.add(myNameEditor); myNameEditor.setPreferredWidth(getTable().getWidth() / 2); myNameEditor.setFont(EditorUtil.getEditorFont()); myNameEditor.addDocumentListener(new RowEditorChangeListener(0)); myNameEditor.addDocumentListener(new DocumentListener() { @Override public void documentChanged(@NotNull DocumentEvent event) { final boolean couldHaveDefaultValue = ParamHelper.couldHaveDefaultValue(myNameEditor.getText()); myDefaultValueEditor.setEnabled(couldHaveDefaultValue); myDefaultInSignature.setEnabled(couldHaveDefaultValue); } }); myNameEditor.addDocumentListener(mySignatureUpdater); return namePanel; }