public static void setupViewPresentation(@NotNull UsageViewPresentation presentation, boolean toOpenInNewTab, @NotNull FindModel findModel) {
    String scope = getTitleForScope(findModel);
    String stringToFind = findModel.getStringToFind();
    String stringToReplace = findModel.getStringToReplace();
    presentation.setScopeText(scope);
    if (stringToFind.isEmpty()) {
      if (!scope.isEmpty()) {
        scope = Character.toLowerCase(scope.charAt(0)) + scope.substring(1);
      }
      presentation.setTabText(FindBundle.message("tab.title.files"));
      presentation.setToolwindowTitle(FindBundle.message("tab.title.files.in.scope", scope));
      presentation.setUsagesString(LangBundle.message("files"));
    }
    else {
      FindModel.SearchContext searchContext = findModel.getSearchContext();
      String contextText = "";
      if (searchContext != FindModel.SearchContext.ANY) {
        contextText = FindBundle.message("find.context.presentation.scope.label", getPresentableName(searchContext));
      }
      if (!findModel.isReplaceState()) {
        presentation.setTabText(FindBundle.message("find.usage.view.tab.text", stringToFind, contextText));
        presentation.setToolwindowTitle(FindBundle.message("find.usage.view.toolwindow.title", stringToFind, scope, contextText));
      }
      else {
        presentation.setTabText(FindBundle.message("replace.usage.view.tab.text", stringToFind, stringToReplace, contextText));
        presentation.setToolwindowTitle(FindBundle.message("replace.usage.view.toolwindow.title", stringToFind, stringToReplace, scope, contextText));
      }
      presentation.setSearchString(FindBundle.message("find.occurrences.search.string", stringToFind, searchContext.ordinal()));
      presentation.setCodeUsagesString(FindBundle.message("found.occurrences"));
    }
    presentation.setOpenInNewTab(toOpenInNewTab);
    presentation.setCodeUsages(false);
    presentation.setUsageTypeFilteringAvailable(true);
    if (findModel.isReplaceState() && findModel.isRegularExpressions()) {
      presentation.setSearchPattern(findModel.compileRegExp());
      presentation.setReplaceString(findModel.getStringToReplace());
    }
    else {
      presentation.setSearchPattern(null);
      presentation.setReplaceString(null);
    }
    presentation.setCaseSensitive(findModel.isCaseSensitive());
    presentation.setPreserveCase(findModel.isPreserveCase());
    presentation.setReplaceMode(findModel.isReplaceState());
  }
public static void setupViewPresentation(@NotNull UsageViewPresentation presentation, boolean toOpenInNewTab, @NotNull FindModel findModel)