void (@NotNull String searchQuery) { if (mySearchPopup != null) { // If there's a popup showing, we must let it handle selection, because // it also updates its own state (error / not error) in the process. mySearchPopup.updateSelection(findElement(searchQuery), searchQuery); } else { selectElement(findElement(searchQuery), searchQuery); } }