boolean (@NotNull SearchPopup.Type type, @NotNull CollectionListModel<Object> model, @Nullable String prefix, int caretPosition) { if (myPopup == null || myPopup.type != type || !myPopup.isValid()) { createPopup(type, model, caretPosition); } else { myPopup.model.replaceAll(model.getItems()); myPopup.callback.prefix = prefix; myPopup.caretPosition = caretPosition; myPopup.update(); return true; } return false; }