JComponent () { myClassChooser.getTextField().getDocument().addDocumentListener(new DocumentAdapter() { @Override public void textChanged(@NotNull DocumentEvent event) { updateUI(); } }); myClassChooser.addActionListener(e -> { PsiClass currentClass = getSelectedClass(); TreeClassChooser chooser = TreeClassChooserFactory.getInstance(myProject).createAllProjectScopeChooser( KotlinDebuggerCoreBundle.message("property.watchpoint.add.dialog.choose.owner.class.title")); if (currentClass != null) { PsiFile containingFile = currentClass.getContainingFile(); if (containingFile != null) { PsiDirectory containingDirectory = containingFile.getContainingDirectory(); if (containingDirectory != null) { chooser.selectDirectory(containingDirectory); } } } chooser.showDialog(); PsiClass selectedClass = chooser.getSelected(); if (selectedClass != null) { myClassChooser.setText(selectedClass.getQualifiedName()); } }); myFieldChooser.addActionListener(e -> { PsiClass selectedClass = getSelectedClass(); if (selectedClass != null) { showFieldChooser(selectedClass); } }); myFieldChooser.setEnabled(false); return myPanel; }