当前位置: 首页>>代码示例>>Java>>正文


Java XsltChecker.LanguageLevel方法代码示例

本文整理汇总了Java中org.intellij.lang.xpath.xslt.impl.XsltChecker.LanguageLevel方法的典型用法代码示例。如果您正苦于以下问题:Java XsltChecker.LanguageLevel方法的具体用法?Java XsltChecker.LanguageLevel怎么用?Java XsltChecker.LanguageLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.intellij.lang.xpath.xslt.impl.XsltChecker的用法示例。


在下文中一共展示了XsltChecker.LanguageLevel方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getEditorsProvider

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入方法依赖的package包/类
@Override
public XDebuggerEditorsProvider getEditorsProvider(@NotNull XLineBreakpoint<XBreakpointProperties> breakpoint, @NotNull Project project) {
  final XSourcePosition position = breakpoint.getSourcePosition();
  if (position == null) {
    return null;
  }

  final PsiFile file = PsiManager.getInstance(project).findFile(position.getFile());
  if (file == null) {
    return null;
  }

  final XsltChecker.LanguageLevel level = XsltSupport.getXsltLanguageLevel(file);
  if (level == XsltChecker.LanguageLevel.V1) {
    return myMyEditorsProvider1;
  } else if (level == XsltChecker.LanguageLevel.V2) {
    return myMyEditorsProvider2;
  }

  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:XsltBreakpointType.java

示例2: isXPathAttribute

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入方法依赖的package包/类
public static boolean isXPathAttribute(@NotNull XmlAttribute attribute) {
  if (attribute.getValueElement() == null) return false;

  final String name = attribute.getName();
  if (isXsltAttribute(attribute)) {
    final String tagName = attribute.getParent().getLocalName();
    final String s = XPATH_ATTR_MAP.get(name);
    if ((s == null || s.length() > 0) && !tagName.equals(s)) {
      if (!isAttributeValueTemplate(attribute, true)) {
        return false;
      }
    }
  }
  else {
    if (!isAttributeValueTemplate(attribute, false)) {
      return false;
    }
  }

  final PsiFile file = attribute.getContainingFile();
  if (file != null) {
    XsltChecker.LanguageLevel level = getXsltLanguageLevel(file);
    if (level != XsltChecker.LanguageLevel.NONE) {
      return true;
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:XsltSupport.java

示例3: isXsltFile

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入方法依赖的package包/类
public static boolean isXsltFile(@NotNull PsiFile psiFile) {
  if (psiFile.getFileType() != StdFileTypes.XML) return false;

  if (!(psiFile instanceof XmlFile)) return false;

  final XsltChecker.LanguageLevel level = getXsltLanguageLevel(psiFile);
  return level != XsltChecker.LanguageLevel.NONE;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:XsltSupport.java

示例4: compute

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入方法依赖的package包/类
public CachedValueProvider.Result<XsltChecker.LanguageLevel> compute(PsiFile psiFile) {
  if (!(psiFile instanceof XmlFile)) {
    return CachedValueProvider.Result.create(XsltChecker.LanguageLevel.NONE, PsiModificationTracker.MODIFICATION_COUNT);
  }

  final XmlFile xmlFile = (XmlFile)psiFile;
  if (psiFile instanceof PsiFileEx) {
    if (((PsiFileEx)psiFile).isContentsLoaded()) {
      final XmlDocument doc = xmlFile.getDocument();
      if (doc != null) {
        final XmlTag rootTag = doc.getRootTag();
        if (rootTag != null) {
          XmlAttribute v;
          XsltChecker.LanguageLevel level;
          if (isXsltRootTag(rootTag)) {
            v = rootTag.getAttribute("version");
            level = v != null ? XsltChecker.getLanguageLevel(v.getValue()) : XsltChecker.LanguageLevel.NONE;
          }
          else {
            v = rootTag.getAttribute("version", XSLT_NS);
            level = v != null ? XsltChecker.getLanguageLevel(v.getValue()) : XsltChecker.LanguageLevel.NONE;
          }
          return CachedValueProvider.Result.create(level, rootTag);
        }
      }
    }
  }

  final XsltChecker xsltChecker = new XsltChecker();
  NanoXmlUtil.parseFile(psiFile, xsltChecker);
  return CachedValueProvider.Result.create(xsltChecker.getLanguageLevel(), psiFile);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:XsltSupport.java

示例5: doTestXsltSupport

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入方法依赖的package包/类
private void doTestXsltSupport() throws Throwable {
  configure();

  final XsltChecker.LanguageLevel level = XsltSupport.getXsltLanguageLevel(myFixture.getFile());
  if (level != XsltChecker.LanguageLevel.NONE) {
    assertTrue(getName().contains("Supported"));
    assertTrue(XsltSupport.isXsltFile(myFixture.getFile()));
  } else {
    assertTrue(getName().contains("Unsupported"));
    assertFalse(XsltSupport.isXsltFile(myFixture.getFile()));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:XsltBasicTest.java

示例6: XsltDebugProcess

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入方法依赖的package包/类
public XsltDebugProcess(XDebugSession session, ExecutionResult executionResult, XsltChecker.LanguageLevel data) {
  super(session);
  myProcessHandler = executionResult.getProcessHandler();
  myProcessHandler.putUserData(KEY, this);
  myExecutionConsole = executionResult.getExecutionConsole();
  myEditorsProvider = new XsltDebuggerEditorsProvider(data);
  Disposer.register(myExecutionConsole, this);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:XsltDebugProcess.java

示例7: compute

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入方法依赖的package包/类
public CachedValueProvider.Result<XsltChecker.LanguageLevel> compute(PsiFile psiFile) {
  if (!(psiFile instanceof XmlFile)) {
    return CachedValueProvider.Result.create(XsltChecker.LanguageLevel.NONE);
  }

  final XmlFile xmlFile = (XmlFile)psiFile;
  if (psiFile instanceof PsiFileEx) {
    if (((PsiFileEx)psiFile).isContentsLoaded()) {
      final XmlDocument doc = xmlFile.getDocument();
      if (doc != null) {
        final XmlTag rootTag = doc.getRootTag();
        if (rootTag != null) {
          XmlAttribute v;
          XsltChecker.LanguageLevel level;
          if (isXsltRootTag(rootTag)) {
            v = rootTag.getAttribute("version");
            level = v != null ? XsltChecker.getLanguageLevel(v.getValue()) : XsltChecker.LanguageLevel.NONE;
          }
          else {
            v = rootTag.getAttribute("version", XSLT_NS);
            level = v != null ? XsltChecker.getLanguageLevel(v.getValue()) : XsltChecker.LanguageLevel.NONE;
          }
          return CachedValueProvider.Result.create(level, rootTag);
        }
      }
    }
  }

  final XsltChecker xsltChecker = new XsltChecker();
  NanoXmlUtil.parseFile(psiFile, xsltChecker);
  return CachedValueProvider.Result.create(xsltChecker.getLanguageLevel(), psiFile);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:33,代码来源:XsltSupport.java

示例8: isXPathAttribute

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入方法依赖的package包/类
public static boolean isXPathAttribute(@NotNull XmlAttribute attribute) {
    if (attribute.getValueElement() == null) return false;

    final String name = attribute.getName();
    if (isXsltAttribute(attribute)) {
        final String tagName = attribute.getParent().getLocalName();
        final String s = XPATH_ATTR_MAP.get(name);
        if ((s == null || s.length() > 0) && !tagName.equals(s)) {
            if (!isAttributeValueTemplate(attribute, true)) {
                return false;
            }
        }
    } else {
        if (!isAttributeValueTemplate(attribute, false)) {
            return false;
        }
    }

    final PsiFile file = attribute.getContainingFile();
    if (file != null) {
      XsltChecker.LanguageLevel level = getXsltLanguageLevel(file);
      if (level != XsltChecker.LanguageLevel.NONE) {
        return true;
      }
    }
  return false;
}
 
开发者ID:consulo,项目名称:consulo-xslt,代码行数:28,代码来源:XsltSupport.java

示例9: isXsltFile

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入方法依赖的package包/类
public static boolean isXsltFile(@NotNull PsiFile psiFile) {
    if (psiFile.getFileType() != XmlFileType.INSTANCE) return false;

    if (!(psiFile instanceof XmlFile)) return false;

    final XsltChecker.LanguageLevel level = getXsltLanguageLevel(psiFile);
    return level != XsltChecker.LanguageLevel.NONE;
}
 
开发者ID:consulo,项目名称:consulo-xslt,代码行数:9,代码来源:XsltSupport.java

示例10: compute

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入方法依赖的package包/类
public CachedValueProvider.Result<XsltChecker.LanguageLevel> compute(PsiFile psiFile) {
  if (!(psiFile instanceof XmlFile)) {
    return CachedValueProvider.Result.create(XsltChecker.LanguageLevel.NONE);
  }

  final XmlFile xmlFile = (XmlFile)psiFile;
  if (psiFile instanceof PsiFileEx) {
    if (((PsiFileEx)psiFile).isContentsLoaded()) {
      final XmlDocument doc = xmlFile.getDocument();
      if (doc != null) {
        final XmlTag rootTag = doc.getRootTag();
        if (rootTag != null) {
          XmlAttribute v;
          XsltChecker.LanguageLevel level;
          if (isXsltRootTag(rootTag)) {
            v = rootTag.getAttribute("version");
            level = v != null ? XsltChecker.getLanguageLevel(v.getValue()) : XsltChecker.LanguageLevel.NONE;
          } else {
            v = rootTag.getAttribute("version", XSLT_NS);
            level = v != null ? XsltChecker.getLanguageLevel(v.getValue()) : XsltChecker.LanguageLevel.NONE;
          }
          return CachedValueProvider.Result.create(level, rootTag);
        }
      }
    }
  }

  final XsltChecker xsltChecker = new XsltChecker();
  NanoXmlUtil.parseFile(psiFile, xsltChecker);
  return CachedValueProvider.Result.create(xsltChecker.getLanguageLevel(), psiFile);
}
 
开发者ID:consulo,项目名称:consulo-xslt,代码行数:32,代码来源:XsltSupport.java

示例11: getEditorsProvider

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入方法依赖的package包/类
@Override
public XDebuggerEditorsProvider getEditorsProvider(@NotNull XLineBreakpoint<XBreakpointProperties> breakpoint, @NotNull Project project)
{
	final XSourcePosition position = breakpoint.getSourcePosition();
	if(position == null)
	{
		return null;
	}

	final PsiFile file = PsiManager.getInstance(project).findFile(position.getFile());
	if(file == null)
	{
		return null;
	}

	final XsltChecker.LanguageLevel level = XsltSupport.getXsltLanguageLevel(file);
	if(level == XsltChecker.LanguageLevel.V1)
	{
		return myMyEditorsProvider1;
	}
	else if(level == XsltChecker.LanguageLevel.V2)
	{
		return myMyEditorsProvider2;
	}

	return null;
}
 
开发者ID:consulo,项目名称:consulo-xslt,代码行数:28,代码来源:XsltBreakpointType.java

示例12: getXsltLanguageLevel

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入方法依赖的package包/类
public static XsltChecker.LanguageLevel getXsltLanguageLevel(@NotNull PsiFile psiFile) {
  final CachedValuesManager mgr = CachedValuesManager.getManager(psiFile.getProject());
  return mgr.getParameterizedCachedValue(psiFile, FORCE_XSLT_KEY, XsltSupportProvider.INSTANCE, false, psiFile);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:XsltSupport.java

示例13: XsltDebuggerEditorsProvider

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入方法依赖的package包/类
public XsltDebuggerEditorsProvider(XsltChecker.LanguageLevel level) {
  myFileType = level == XsltChecker.LanguageLevel.V2 ? XPathFileType.XPATH2 : XPathFileType.XPATH;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:XsltDebuggerEditorsProvider.java

示例14: getXsltLanguageLevel

import org.intellij.lang.xpath.xslt.impl.XsltChecker; //导入方法依赖的package包/类
public static XsltChecker.LanguageLevel getXsltLanguageLevel(@NotNull PsiFile psiFile) {
    final CachedValuesManager mgr = CachedValuesManager.getManager(psiFile.getProject());
    return mgr.getParameterizedCachedValue(psiFile, FORCE_XSLT_KEY, XsltSupportProvider.INSTANCE, false, psiFile);
}
 
开发者ID:consulo,项目名称:consulo-xslt,代码行数:5,代码来源:XsltSupport.java


注:本文中的org.intellij.lang.xpath.xslt.impl.XsltChecker.LanguageLevel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。