void () { final DocumentListener adapter = new DocumentListener() { @Override public void documentChanged(@NotNull com.intellij.openapi.editor.event.DocumentEvent e) { validateButtons(); } }; myPackageTextField = new PackageNameReferenceEditorCombo(((PsiJavaFile)myConstructors[0].getContainingFile()).getPackageName(), myProject, RECENT_KEYS, RefactoringBundle.message("choose.destination.package")); myPackageTextField.getChildComponent().getDocument().addDocumentListener(adapter); myDestinationCb = new DestinationFolderComboBox() { @Override public String getTargetPackage() { return myPackageTextField.getText().trim(); } }; ((DestinationFolderComboBox)myDestinationCb).setData(myProject, myConstructors[0].getContainingFile().getContainingDirectory(), myPackageTextField.getChildComponent()); myExistentClassTF = new ReferenceEditorComboWithBrowseButton(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final TreeClassChooser chooser = TreeClassChooserFactory.getInstance(getProject()) .createWithInnerClassesScopeChooser( JavaRefactoringBundle.message("replace.constructor.builder.select.builder.class.chooser.title"), GlobalSearchScope.projectScope(myProject), null, null); final String classText = myExistentClassTF.getText(); final PsiClass currentClass = JavaPsiFacade.getInstance(myProject).findClass(classText, GlobalSearchScope.allScope(myProject)); if (currentClass != null) { chooser.select(currentClass); } chooser.showDialog(); final PsiClass selectedClass = chooser.getSelected(); if (selectedClass != null) { myExistentClassTF.setText(selectedClass.getQualifiedName()); } } }, "", myProject, true, RECENT_KEYS); myExistentClassTF.getChildComponent().getDocument().addDocumentListener(adapter); }