SearchTextField (JPanel root) { final SearchTextField field = new SearchTextField(getDimensionKey() + ".searchHistory"); field.addDocumentListener(new DocumentAdapter() { @Override protected void textChanged(@NotNull DocumentEvent e) { scheduleRevisionsUpdate(m -> { m.setFilter(field.getText()); ApplicationManager.getApplication().invokeLater(() -> { if (!isDisposed()) { field.addCurrentTextToHistory(); } }); }); } }); DumbAwareAction.create(e -> field.requestFocusInWindow()) .registerCustomShortcutSet(CommonShortcuts.getFind(), root, this); return field; }