private void updateEmptyText(String pattern) {
      StatusText emptyStatus = myResultsList.getEmptyText();
      emptyStatus.clear();

      if (pattern.isEmpty()) return;
      boolean showResetScope = myHeader.canResetScope();

      SearchEverywhereEmptyTextProvider provider = StreamEx.of(myHeader.getSelectedTab().getContributors())
        .select(SearchEverywhereEmptyTextProvider.class)
        .findFirst()
        .orElse(null);

      if (provider != null) {
        provider.updateEmptyStatus(emptyStatus, () -> {
          scheduleRebuildList(SearchRestartReason.TAB_CHANGED);
          return Unit.INSTANCE;
        });

        if (showResetScope) {
          emptyStatus.appendLine("");
          emptyStatus.appendText(IdeBundle.message("searcheverywhere.try.to.reset.scope"));
          emptyStatus.appendText(" " + StringUtil.toLowerCase(EverythingGlobalScope.getNameText()),
                                 SimpleTextAttributes.LINK_PLAIN_ATTRIBUTES, e -> myHeader.resetScope());
        }

        return;
      }

      boolean showFindInFilesAction =
        ContainerUtil.exists(myHeader.getSelectedTab().getContributors(), contributor -> contributor.showInFindResults());
      boolean showResetFilter = myHeader.getSelectedTab().canClearFilter();
      boolean anyActionAllowed = showFindInFilesAction || showResetScope || showResetFilter;

      final AtomicBoolean firstPartAdded = new AtomicBoolean();
      final AtomicInteger actionsPrinted = new AtomicInteger(0);
      if (showResetScope) {
        ActionListener resetScopeListener = e -> myHeader.resetScope();
        emptyStatus.appendText(IdeBundle.message("searcheverywhere.try.to.reset.scope"));
        emptyStatus.appendText(" " + StringUtil.toLowerCase(EverythingGlobalScope.getNameText()),
                               SimpleTextAttributes.LINK_PLAIN_ATTRIBUTES, resetScopeListener);
        firstPartAdded.set(true);
        actionsPrinted.incrementAndGet();
      }

      if (showResetFilter) {
        ActionListener clearFiltersAction = e -> {
          myHeader.getSelectedTab().clearFilter();
          scheduleRebuildList(SearchRestartReason.TAB_CHANGED);
        };
        if (firstPartAdded.get()) emptyStatus.appendText(", ");
        String resetFilterMessage = IdeBundle.message("searcheverywhere.reset.filters");
        emptyStatus.appendText(firstPartAdded.get() ? Strings.toLowerCase(resetFilterMessage) : resetFilterMessage,
                               SimpleTextAttributes.LINK_PLAIN_ATTRIBUTES, clearFiltersAction);
        firstPartAdded.set(true);

        if (actionsPrinted.incrementAndGet() >= 2) {
          emptyStatus.appendLine("");
          actionsPrinted.set(0);
        }
      }

      if (showFindInFilesAction && myProject != null) {
        FindInProjectManager manager = FindInProjectManager.getInstance(myProject);
        if (manager != null && manager.isEnabled()) {
          DataContext context = DataManager.getInstance().getDataContext(SearchEverywhereUI.this);
          ActionListener findInFilesAction = e -> manager.findInProject(context, null);
          emptyStatus.appendText((firstPartAdded.get() ? " " + IdeBundle.message("searcheverywhere.use.optional")
                                                       : IdeBundle.message("searcheverywhere.use.main")) + " ");
          emptyStatus.appendText(IdeBundle.message("searcheverywhere.try.to.find.in.files"),
                                 SimpleTextAttributes.LINK_PLAIN_ATTRIBUTES, findInFilesAction);
          String findInFilesShortcut = KeymapUtil.getFirstKeyboardShortcutText("FindInPath");
          if (!StringUtil.isEmpty(findInFilesShortcut)) {
            emptyStatus.appendText(" (" + findInFilesShortcut + ")");
          }

          if (actionsPrinted.incrementAndGet() >= 2) {
            emptyStatus.appendLine("");
            actionsPrinted.set(0);
          }

          emptyStatus.appendText(" " + IdeBundle.message("searcheverywhere.to.perform.fulltext.search"));
        }
      }

      if (anyActionAllowed) {
        emptyStatus.appendText(".");
      }
    }
private void updateEmptyText(String pattern)