本文整理汇总了Java中com.intellij.xml.util.XmlUtil.findRealNamedElement方法的典型用法代码示例。如果您正苦于以下问题:Java XmlUtil.findRealNamedElement方法的具体用法?Java XmlUtil.findRealNamedElement怎么用?Java XmlUtil.findRealNamedElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.xml.util.XmlUtil
的用法示例。
在下文中一共展示了XmlUtil.findRealNamedElement方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: navigate
import com.intellij.xml.util.XmlUtil; //导入方法依赖的package包/类
@Override
public void navigate(final boolean requestFocus) {
if (isPhysical()) {
super.navigate(requestFocus);
return;
}
final PsiNamedElement psiNamedElement = XmlUtil.findRealNamedElement(this);
Navigatable navigatable = PsiNavigationSupport.getInstance().getDescriptor(psiNamedElement);
if (psiNamedElement instanceof XmlEntityDecl) {
navigatable = PsiNavigationSupport.getInstance().createNavigatable(
psiNamedElement.getProject(),
psiNamedElement.getContainingFile().getVirtualFile(),
psiNamedElement.getTextRange().getStartOffset() + psiNamedElement.getText().indexOf(getName())
);
}
if (navigatable != null) {
navigatable.navigate(requestFocus);
}
}
示例2: getOriginalElement
import com.intellij.xml.util.XmlUtil; //导入方法依赖的package包/类
@Override
public PsiElement getOriginalElement() {
if (isPhysical()) return super.getOriginalElement();
final PsiNamedElement element = XmlUtil.findRealNamedElement(this);
if (element != null) {
return element;
}
return this;
}
示例3: resolve
import com.intellij.xml.util.XmlUtil; //导入方法依赖的package包/类
@Override
@Nullable
public PsiElement resolve() {
XmlEntityDecl xmlEntityDecl = XmlEntityRefImpl.resolveEntity(
(XmlElement)myElement,
(myElement instanceof XmlEntityRef ? myElement.getLastChild():myElement).getText(),
myElement.getContainingFile()
);
if (xmlEntityDecl != null && !xmlEntityDecl.isPhysical()) {
PsiNamedElement element = XmlUtil.findRealNamedElement(xmlEntityDecl);
if (element != null) xmlEntityDecl = (XmlEntityDecl)element;
}
return xmlEntityDecl;
}
示例4: canNavigate
import com.intellij.xml.util.XmlUtil; //导入方法依赖的package包/类
@Override
public boolean canNavigate() {
if (isPhysical()) return super.canNavigate();
final PsiNamedElement psiNamedElement = XmlUtil.findRealNamedElement(this);
return psiNamedElement != null;
}
示例5: canNavigate
import com.intellij.xml.util.XmlUtil; //导入方法依赖的package包/类
@Override
public boolean canNavigate() {
if (isPhysical()) return super.canNavigate();
final PsiNamedElement psiNamedElement = XmlUtil.findRealNamedElement(this);
return psiNamedElement != null && psiNamedElement != this && ((Navigatable)psiNamedElement).canNavigate();
}