當前位置: 首頁>>代碼示例>>Java>>正文


Java XPathVariable類代碼示例

本文整理匯總了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();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:23,代碼來源:XsltVariableContext.java

示例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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:21,代碼來源:XsltRefactoringTest.java

示例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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:XsltVariableContext.java

示例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 "";
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:XsltLanguage.java

示例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);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:VariableInlineHandler.java

示例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";
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:XPathLanguage.java

示例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");
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:XsltRefactoringTest.java

示例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";
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:11,代碼來源:XPathLanguage.java

示例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);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:XsltVariableContext.java

示例10: isSafeDeleteAvailable

import org.intellij.lang.xpath.psi.XPathVariable; //導入依賴的package包/類
@Override
public boolean isSafeDeleteAvailable(@NotNull PsiElement element) {
  return element instanceof XPathVariable ||
          element instanceof XsltTemplate;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:6,代碼來源:XPathRefactoringSupportProvider.java

示例11: canFindUsagesFor

import org.intellij.lang.xpath.psi.XPathVariable; //導入依賴的package包/類
@Override
public boolean canFindUsagesFor(@NotNull PsiElement psiElement) {
    return psiElement instanceof XPathFunction || psiElement instanceof XPathVariable;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:XPathLanguage.java

示例12: resolve

import org.intellij.lang.xpath.psi.XPathVariable; //導入依賴的package包/類
public XPathVariable resolve(XPathVariableReference reference) {
    return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:SimpleVariableContext.java

示例13: resolve

import org.intellij.lang.xpath.psi.XPathVariable; //導入依賴的package包/類
@Nullable
XPathVariable resolve(XPathVariableReference reference);
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:3,代碼來源:VariableContext.java

示例14: getVariable

import org.intellij.lang.xpath.psi.XPathVariable; //導入依賴的package包/類
@Nullable
public XPathVariable getVariable() {
  return PsiTreeUtil.findChildOfType(this, XPathVariable.class);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:XPath2VariableDeclarationImpl.java

示例15: isSafeDeleteAvailable

import org.intellij.lang.xpath.psi.XPathVariable; //導入依賴的package包/類
@Override
public boolean isSafeDeleteAvailable(PsiElement element) {
  return element instanceof XPathVariable ||
          element instanceof XsltTemplate;
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:6,代碼來源:XPathRefactoringSupportProvider.java


注:本文中的org.intellij.lang.xpath.psi.XPathVariable類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。