@NotNull private static UsageViewPresentation createPresentation( @NotNull PsiElement psiElement, @NotNull FindUsagesOptions findUsagesOptions, boolean toOpenInNewTab) { UsageViewPresentation presentation = new UsageViewPresentation(); String scopeString = findUsagesOptions.searchScope == null ? null : findUsagesOptions.searchScope.getDisplayName(); presentation.setScopeText(scopeString); String usagesString = generateUsagesString(findUsagesOptions); presentation.setUsagesString(usagesString); String title = scopeString == null ? FindBundle.message( "find.usages.of.element.panel.title", usagesString, UsageViewUtil.getLongName(psiElement)) : FindBundle.message( "find.usages.of.element.in.scope.panel.title", usagesString, UsageViewUtil.getLongName(psiElement), scopeString); presentation.setTabText(title); presentation.setTabName( FindBundle.message( "find.usages.of.element.tab.name", usagesString, UsageViewUtil.getShortName(psiElement))); presentation.setTargetsNodeText(StringUtil.capitalize(UsageViewUtil.getType(psiElement))); presentation.setOpenInNewTab(toOpenInNewTab); return presentation; }
private static String getNoUsagesFoundMessage(PsiElement psiElement) { String elementType = UsageViewUtil.getType(psiElement); String elementName = UsageViewUtil.getShortName(psiElement); return FindBundle.message( "find.usages.of.element_type.element_name.not.found.message", elementType, elementName); }