void (int[] indexes, int modifiers) { stopSearching(); if (indexes.length == 1 && myListModel.isMoreElement(indexes[0])) { SearchEverywhereContributor contributor = myListModel.getContributorForIndex(indexes[0]); showMoreElements(contributor); return; } indexes = Arrays.stream(indexes) .filter(i -> !myListModel.isMoreElement(i)) .toArray(); String searchText = getSearchPattern(); if (searchText.startsWith(SearchTopHitProvider.getTopHitAccelerator()) && searchText.contains(" ")) { SearchEverywhereUsageTriggerCollector.COMMAND_USED.log(myProject); } boolean closePopup = false; List<Object> selectedItems = new ArrayList<>(); for (int i : indexes) { SearchEverywhereContributor<Object> contributor = myListModel.getContributorForIndex(i); Object value = myListModel.getElementAt(i); selectedItems.add(value); String selectedTabContributorID = myHeader.getSelectedTab().getReportableID(); //noinspection ConstantConditions String reportableContributorID = getReportableContributorID(contributor); List<EventPair<?>> data = new ArrayList<>(); data.add(SearchEverywhereUsageTriggerCollector.CONTRIBUTOR_ID_FIELD.with(reportableContributorID)); if (selectedTabContributorID != null) { data.add(SearchEverywhereUsageTriggerCollector.CURRENT_TAB_FIELD.with(selectedTabContributorID)); } data.add(SearchEverywhereUsageTriggerCollector.SELECTED_ITEM_NUMBER.with(i)); PsiElement psi = toPsi(value); if (psi != null) { data.add(EventFields.Language.with(psi.getLanguage())); } SearchEverywhereUsageTriggerCollector.CONTRIBUTOR_ITEM_SELECTED.log(myProject, data); closePopup |= contributor.processSelectedItem(value, modifiers, searchText); } if (myMlService != null) { var tabId = myHeader.getSelectedTab().getID(); myMlService.onItemSelected(myProject, tabId, indexes, selectedItems, () -> myListModel.getFoundElementsInfo(), closePopup); } if (closePopup) { closePopup(); } else { ApplicationManager.getApplication().invokeLater(() -> myResultsList.repaint()); } }