XPath search results textual improvements

This commit is contained in:
Bas Leijdekkers
2014-10-02 19:19:59 +02:00
parent 50687a42b5
commit b634b8a50d
3 changed files with 16 additions and 8 deletions
@@ -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);
@@ -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;