mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
XPath search results textual improvements
This commit is contained in:
@@ -299,13 +299,20 @@ public class XPathEvalAction extends XPathAction {
|
||||
|
||||
public static void showUsageView(@NotNull final Project project, MyUsageTarget usageTarget, Factory<UsageSearcher> searcherFactory, final EditExpressionAction editAction) {
|
||||
final UsageViewPresentation presentation = new UsageViewPresentation();
|
||||
presentation.setTargetsNodeText("Expression");
|
||||
presentation.setTargetsNodeText("XPath Expression");
|
||||
presentation.setCodeUsages(false);
|
||||
presentation.setCodeUsagesString("Result");
|
||||
presentation.setCodeUsagesString("Found Matches");
|
||||
presentation.setNonCodeUsagesString("Result");
|
||||
presentation.setUsagesString("XPath Result");
|
||||
presentation.setUsagesWord("match");
|
||||
presentation.setTabText("XPath");
|
||||
final ItemPresentation targetPresentation = usageTarget.getPresentation();
|
||||
if (targetPresentation != null) {
|
||||
presentation
|
||||
.setTabText(StringUtil.shortenTextWithEllipsis("XPath '" + targetPresentation.getPresentableText() + '\'', 60, 0, true));
|
||||
}
|
||||
else {
|
||||
presentation.setTabText("XPath");
|
||||
}
|
||||
presentation.setScopeText("XML Files");
|
||||
|
||||
presentation.setOpenInNewTab(XPathAppComponent.getInstance().getConfig().OPEN_NEW_TAB);
|
||||
|
||||
+5
-4
@@ -25,6 +25,7 @@ import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.Factory;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.usages.*;
|
||||
import org.intellij.plugins.xpathView.Config;
|
||||
import org.intellij.plugins.xpathView.XPathAppComponent;
|
||||
@@ -78,13 +79,13 @@ public class FindByXPathAction extends AnAction {
|
||||
}
|
||||
|
||||
final UsageViewPresentation presentation = new UsageViewPresentation();
|
||||
presentation.setTargetsNodeText(settings.MATCH_RECURSIVELY ? "Pattern" : "Expression");
|
||||
presentation.setTargetsNodeText(settings.MATCH_RECURSIVELY ? "XPath Pattern" : "XPath Expression");
|
||||
presentation.setCodeUsages(false);
|
||||
presentation.setCodeUsagesString("Result");
|
||||
presentation.setCodeUsagesString("Found Matches in " + scope.getName());
|
||||
presentation.setNonCodeUsagesString("Result");
|
||||
presentation.setUsagesString("XPath Result");
|
||||
presentation.setUsagesString("results matching '" + expression + '\'');
|
||||
presentation.setUsagesWord("match");
|
||||
presentation.setTabText("XPath");
|
||||
presentation.setTabText(StringUtil.shortenTextWithEllipsis("XPath '" + expression + '\'', 60, 0, true));
|
||||
presentation.setScopeText(scope.getName());
|
||||
|
||||
presentation.setOpenInNewTab(settings.OPEN_NEW_TAB);
|
||||
|
||||
@@ -92,7 +92,7 @@ public final class SearchScope {
|
||||
case DIRECTORY:
|
||||
return "Directory '" + getPath() + "'";
|
||||
case CUSTOM:
|
||||
return "Scope '" + getScopeName() + "'";
|
||||
return getScopeName();
|
||||
}
|
||||
assert false;
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user