void (String text) { EditorSearchSession editorSearchSession = getEditorSearchComponent(); assertNotNull(editorSearchSession); JTextComponent searchField = editorSearchSession.getComponent().getSearchTextComponent(); assertNotNull(searchField); for (int i = 0; i <= text.length(); i++) { searchField.setText(text.substring(0, i)); // emulate typing chars one by one UIUtil.dispatchAllInvocationEvents(); } }