void (@NlsContexts.StatusText @NotNull String message) { StatusText emptyText = myResultsPreviewTable.getEmptyText(); emptyText.clear(); FindModel model = myHelper.getModel(); boolean dotAdded = false; if (StringUtil.isEmpty(model.getStringToFind()) && model.getFileFilter() == null) { emptyText.setText(FindBundle.message("message.type.search.query")); return; } else { emptyText.setText(message); } if (mySelectedScope == FindPopupScopeUIImpl.DIRECTORY && !model.isWithSubdirectories()) { emptyText.appendText("."); dotAdded = true; emptyText.appendSecondaryText(FindBundle.message("find.recursively.hint"), LINK_PLAIN_ATTRIBUTES, e -> { model.setWithSubdirectories(true); scheduleResultsUpdate(); }); } List<Object> usedOptions = new SmartList<>(); if (model.isCaseSensitive() && isEnabled(myCaseSensitiveAction)) { usedOptions.add(myCaseSensitiveAction); } if (model.isWholeWordsOnly() && isEnabled(myWholeWordsAction)) { usedOptions.add(myWholeWordsAction); } if (model.isRegularExpressions() && isEnabled(myRegexAction)) { usedOptions.add(myRegexAction); } boolean couldBeRegexp = false; if (mySuggestRegexHintForEmptyResults) { String stringToFind = model.getStringToFind(); if (!model.isRegularExpressions() && isEnabled(myRegexAction)) { String regexSymbols = ".$|()[]{}^?*+\\"; for (int i = 0; i < stringToFind.length(); i++) { if (regexSymbols.indexOf(stringToFind.charAt(i)) != -1) { couldBeRegexp = true; break; } } } if (couldBeRegexp) { try { Pattern.compile(stringToFind); usedOptions.add(myRegexAction); } catch (Exception e) { couldBeRegexp = false; } } } if (FindInProjectUtil.createFileMaskCondition(model.getFileFilter()) != Conditions.<CharSequence>alwaysTrue()) { usedOptions.add(header.cbFileFilter); } if (model.isInCommentsOnly() || model.isInStringLiteralsOnly() || model.isExceptComments() || model.isExceptStringLiterals() || model.isExceptCommentsAndStringLiterals()) { usedOptions.add(model); } if (!usedOptions.isEmpty()) { if (!dotAdded) emptyText.appendText("."); emptyText.appendLine(" "); if (couldBeRegexp) { emptyText.appendLine(FindBundle.message("message.nothingFound.search.with.regex"), LINK_PLAIN_ATTRIBUTES, __ -> { toggleOption(myRegexAction); mySuggestRegexHintForEmptyResults = false; }).appendText(" " + KeymapUtil.getFirstKeyboardShortcutText(myRegexAction.getShortcutSet())); } else if (usedOptions.size() > 1) { emptyText.appendLine(FindBundle.message("message.nothingFound.used.options")); @NlsSafe StringBuilder sb = new StringBuilder(); for (Object option : usedOptions) { if (!sb.isEmpty()) sb.append(" "); String optionText = getOptionText(option, true); if (optionText == null) continue; sb.append(optionText); } emptyText.appendLine(sb.toString()); emptyText.appendLine(FindBundle.message("message.nothingFound.clearAll"), LINK_PLAIN_ATTRIBUTES, __ -> resetAllFilters()).appendText(" " + getOptionText(myResetFiltersAction, true)); } else { Object option = usedOptions.get(0); emptyText.appendLine(FindBundle.message("message.nothingFound.used.option", getOptionText(option, false))); emptyText.appendLine(FindBundle.message("message.nothingFound.clearOption"), LINK_PLAIN_ATTRIBUTES, __ -> resetAllFilters()).appendText(" " + getOptionText(myResetFiltersAction, true)); } } }