SearchEverywhereContributor<Object> (String id, int fixedPriority, String... items) { return new SearchEverywhereContributor<>() { @NotNull @Override public String getSearchProviderId() { return id; } @NotNull @Override public String getGroupName() { return id; } @Override public int getSortWeight() { return 0; } @Override public boolean showInFindResults() { return false; } @Override public int getElementPriority(@NotNull Object element, @NotNull String searchPattern) { return fixedPriority; } @Override public void fetchElements(@NotNull String pattern, @NotNull ProgressIndicator progressIndicator, @NotNull Processor<? super Object> consumer) { boolean flag = true; Iterator<String> iterator = Arrays.asList(items).iterator(); while (flag && iterator.hasNext()) { String next = iterator.next(); flag = consumer.process(next); } } @Override public boolean processSelectedItem(@NotNull Object selected, int modifiers, @NotNull String searchText) { return false; } @NotNull @Override public ListCellRenderer<? super Object> getElementsRenderer() { throw new UnsupportedOperationException(); } @Override public Object getDataForItem(@NotNull Object element, @NotNull String dataId) { return null; } }; }