本文整理匯總了Java中org.intellij.lang.xpath.psi.XPathVariable類的典型用法代碼示例。如果您正苦於以下問題:Java XPathVariable類的具體用法?Java XPathVariable怎麽用?Java XPathVariable使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
XPathVariable類屬於org.intellij.lang.xpath.psi包,在下文中一共展示了XPathVariable類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: resolveInner
import org.intellij.lang.xpath.psi.XPathVariable; //導入依賴的package包/類
@Nullable
private XPathVariable resolveInner(XPathVariableReference reference) {
final XmlTag context = getContextTagImpl(reference);
final VariableResolveProcessor processor = new VariableResolveProcessor(reference.getReferencedName(), context);
final XPathVariable variable = (XPathVariable)ResolveUtil.treeWalkUp(processor, context);
if (variable != null) {
return variable;
}
if (!processForwardGlobals(context, processor)) {
final XmlFile file = PsiTreeUtil.getParentOfType(context, XmlFile.class, true);
if (file != null) {
XsltIncludeIndex.processBackwardDependencies(file, new Processor<XmlFile>() {
public boolean process(XmlFile xmlFile) {
processor.processExternalFile(xmlFile, context);
return processor.shouldContinue();
}
});
}
}
return (XPathVariable)processor.getResult();
}
示例2: findVariable
import org.intellij.lang.xpath.psi.XPathVariable; //導入依賴的package包/類
@Nullable
private XPathVariable findVariable() {
final PsiElement elementAtCaret = myFixture.getElementAtCaret();
XPathVariableReference ref = PsiTreeUtil.getParentOfType(elementAtCaret, XPathVariableReference.class, false);
if (ref != null) {
return ref.resolve();
}
XPathVariable variable = PsiTreeUtil.getParentOfType(elementAtCaret, XPathVariable.class, false);
if (variable != null) {
return variable;
}
final PsiReference[] references = elementAtCaret.getReferences();
for (PsiReference reference : references) {
final PsiElement var = reference.resolve();
if (var instanceof XPathVariable) {
return (XPathVariable)var;
}
}
return null;
}
示例3: isReferenceTo
import org.intellij.lang.xpath.psi.XPathVariable; //導入依賴的package包/類
public boolean isReferenceTo(PsiElement element, XPathVariableReference reference) {
if (element instanceof XsltParameter) {
final XsltTemplate template = XsltCodeInsightUtil.getTemplate(element, false);
if (template == null || template.getMatchExpression() == null) return false;
final XPathVariable t = reference.resolve();
final PsiReference[] references = element.getReferences();
for (PsiReference r : references) {
if (r.isReferenceTo(t)) return true;
}
}
return false;
}
示例4: getType
import org.intellij.lang.xpath.psi.XPathVariable; //導入依賴的package包/類
@NotNull
public String getType(@NotNull PsiElement element) {
if (element instanceof XsltParameter) {
return getParameterType((XsltParameter)element);
}
if (element instanceof XPathVariable) return "variable";
if (element instanceof XsltTemplate) return "template";
if (element instanceof XPathFunction) return "function";
if (element instanceof ImplicitModeElement) return "mode";
return "";
}
示例5: inlineElement
import org.intellij.lang.xpath.psi.XPathVariable; //導入依賴的package包/類
@Override
public void inlineElement(Project project, Editor editor, PsiElement element) {
final XPathVariableReference reference = PsiTreeUtil.getParentOfType(element, XPathVariableReference.class, false);
if (reference != null) {
final XPathVariable variable = reference.resolve();
if (variable != null && canInline(variable)) {
invoke(variable, editor);
}
}
if (canInline(element)) {
invoke((XPathVariable)element, editor);
}
}
示例6: getType
import org.intellij.lang.xpath.psi.XPathVariable; //導入依賴的package包/類
@Override
@NotNull
public String getType(@NotNull PsiElement element) {
if (element instanceof XPathFunction) {
return "function";
} else if (element instanceof XPathVariable) {
return "variable";
} else {
return "unknown";
}
}
示例7: doInlineVariable
import org.intellij.lang.xpath.psi.XPathVariable; //導入依賴的package包/類
private void doInlineVariable() throws Throwable {
myFixture.configureByFile(getTestFileName() + ".xsl");
final XPathVariable variable = findVariable();
assertNotNull(variable);
VariableInlineHandler.invoke(variable, myFixture.getEditor());
myFixture.checkResultByFile(getTestFileName() + "_after.xsl");
}
示例8: getType
import org.intellij.lang.xpath.psi.XPathVariable; //導入依賴的package包/類
@NotNull
public String getType(@NotNull PsiElement element) {
if (element instanceof XPathFunction) {
return "function";
} else if (element instanceof XPathVariable) {
return "variable";
} else {
return "unknown";
}
}
示例9: resolve
import org.intellij.lang.xpath.psi.XPathVariable; //導入依賴的package包/類
public XPathVariable resolve(final XPathVariableReference reference) {
return (XPathVariable) ResolveCache.getInstance(reference.getProject()).resolveWithCaching(reference, RESOLVER, false, false);
}
示例10: isSafeDeleteAvailable
import org.intellij.lang.xpath.psi.XPathVariable; //導入依賴的package包/類
@Override
public boolean isSafeDeleteAvailable(@NotNull PsiElement element) {
return element instanceof XPathVariable ||
element instanceof XsltTemplate;
}
示例11: canFindUsagesFor
import org.intellij.lang.xpath.psi.XPathVariable; //導入依賴的package包/類
@Override
public boolean canFindUsagesFor(@NotNull PsiElement psiElement) {
return psiElement instanceof XPathFunction || psiElement instanceof XPathVariable;
}
示例12: resolve
import org.intellij.lang.xpath.psi.XPathVariable; //導入依賴的package包/類
public XPathVariable resolve(XPathVariableReference reference) {
return null;
}
示例13: resolve
import org.intellij.lang.xpath.psi.XPathVariable; //導入依賴的package包/類
@Nullable
XPathVariable resolve(XPathVariableReference reference);
示例14: getVariable
import org.intellij.lang.xpath.psi.XPathVariable; //導入依賴的package包/類
@Nullable
public XPathVariable getVariable() {
return PsiTreeUtil.findChildOfType(this, XPathVariable.class);
}
示例15: isSafeDeleteAvailable
import org.intellij.lang.xpath.psi.XPathVariable; //導入依賴的package包/類
@Override
public boolean isSafeDeleteAvailable(PsiElement element) {
return element instanceof XPathVariable ||
element instanceof XsltTemplate;
}