本文整理汇总了Java中org.intellij.lang.xpath.completion.FunctionLookup类的典型用法代码示例。如果您正苦于以下问题:Java FunctionLookup类的具体用法?Java FunctionLookup怎么用?Java FunctionLookup使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FunctionLookup类属于org.intellij.lang.xpath.completion包,在下文中一共展示了FunctionLookup类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDocumentationElementForLookupItem
import org.intellij.lang.xpath.completion.FunctionLookup; //导入依赖的package包/类
@Nullable
public PsiElement getDocumentationElementForLookupItem(PsiManager mgr, Object object, PsiElement psiElement) {
if (object instanceof String) {
if (psiElement instanceof XmlElement) {
final XmlTag tag = PsiTreeUtil.getParentOfType(psiElement, XmlTag.class);
if (tag != null && XsltSupport.XSLT_NS.equals(tag.getNamespace())) {
final String prefix = tag.getNamespacePrefix();
if (prefix.length() == 0) {
return new DocElement(mgr, psiElement, "element", (String)object);
} else if (StringUtil.startsWithConcatenation(((String)object), prefix, ":")) {
return new DocElement(mgr, psiElement, "element", ((String)object).substring(prefix.length() + 1));
}
}
}
}
if (object instanceof FunctionLookup) {
final FunctionLookup lookup = ((FunctionLookup)object);
return new DocElement(mgr, psiElement, "function", lookup.getName());
} else if (object instanceof ElementProvider) {
return ((ElementProvider)object).getElement();
} if (object instanceof XsltElement) {
return (PsiElement)object;
}
return null;
}