本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
示例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()));
}
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}