mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
more SSR search result tweaks
This commit is contained in:
+18
-14
@@ -59,13 +59,15 @@ public class UsageViewContext {
|
||||
|
||||
public void configure(@NotNull UsageViewPresentation presentation) {
|
||||
final String pattern = myConfiguration.getMatchOptions().getSearchPattern();
|
||||
presentation.setScopeText(myConfiguration.getMatchOptions().getScope().getDisplayName());
|
||||
final String scopeText = myConfiguration.getMatchOptions().getScope().getDisplayName();
|
||||
presentation.setScopeText(scopeText);
|
||||
final String usagesString = SSRBundle.message("occurrences.of", pattern);
|
||||
presentation.setUsagesString(usagesString);
|
||||
presentation.setTabText(StringUtil.shortenTextWithEllipsis(usagesString, 60, 0, false));
|
||||
presentation.setUsagesWord(SSRBundle.message("occurrence"));
|
||||
presentation.setCodeUsagesString(SSRBundle.message("found.occurrences"));
|
||||
presentation.setCodeUsagesString(SSRBundle.message("found.occurrences", scopeText));
|
||||
presentation.setTargetsNodeText(SSRBundle.message("targets.node.text"));
|
||||
presentation.setCodeUsages(false);
|
||||
}
|
||||
|
||||
protected void configureActions() {}
|
||||
@@ -75,17 +77,7 @@ public class UsageViewContext {
|
||||
@NotNull
|
||||
@Override
|
||||
public String getPresentableText() {
|
||||
final MatchOptions matchOptions = myConfiguration.getMatchOptions();
|
||||
final String pattern = matchOptions.getSearchPattern();
|
||||
final String scope = matchOptions.getScope().getDisplayName();
|
||||
if (myConfiguration instanceof ReplaceConfiguration) {
|
||||
final ReplaceConfiguration replaceConfiguration = (ReplaceConfiguration)myConfiguration;
|
||||
final String replacement = replaceConfiguration.getOptions().getReplacement();
|
||||
return SSRBundle.message("replace.occurrences.of.0.with.1.in.2", pattern, replacement, scope);
|
||||
}
|
||||
else {
|
||||
return SSRBundle.message("occurrences.of.0.in.1", pattern, scope);
|
||||
}
|
||||
return myConfiguration.getMatchOptions().getSearchPattern();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -174,7 +166,19 @@ public class UsageViewContext {
|
||||
@NotNull
|
||||
@Override
|
||||
public String getLongDescriptiveName() {
|
||||
return StringUtil.shortenTextWithEllipsis(getPresentableText(), 150, 0, true);
|
||||
final MatchOptions matchOptions = myConfiguration.getMatchOptions();
|
||||
final String pattern = matchOptions.getSearchPattern();
|
||||
final String scope = matchOptions.getScope().getDisplayName();
|
||||
final String result;
|
||||
if (myConfiguration instanceof ReplaceConfiguration) {
|
||||
final ReplaceConfiguration replaceConfiguration = (ReplaceConfiguration)myConfiguration;
|
||||
final String replacement = replaceConfiguration.getOptions().getReplacement();
|
||||
result = SSRBundle.message("replace.occurrences.of.0.with.1.in.2", pattern, replacement, scope);
|
||||
}
|
||||
else {
|
||||
result = SSRBundle.message("occurrences.of.0.in.1", pattern, scope);
|
||||
}
|
||||
return StringUtil.shortenTextWithEllipsis(result, 150, 0, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user