void (@NotNull Consumer<? super DocumentEvent> listener) { final TextFieldWithBrowseButton field = myLocationField; if (field == null) return; field.getTextField().getDocument().addDocumentListener(new DocumentAdapter() { @Override protected void textChanged(@NotNull DocumentEvent e) { listener.consume(e); } }); }