• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java RncElement类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.intellij.plugins.relaxNG.compact.psi.RncElement的典型用法代码示例。如果您正苦于以下问题:Java RncElement类的具体用法?Java RncElement怎么用?Java RncElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RncElement类属于org.intellij.plugins.relaxNG.compact.psi包,在下文中一共展示了RncElement类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: generateDoc

import org.intellij.plugins.relaxNG.compact.psi.RncElement; //导入依赖的package包/类
@Override
@Nullable
public String generateDoc(PsiElement element, PsiElement originalElement) {
  if (element instanceof RncElement) {
    PsiElement comment = element.getPrevSibling();
    while (comment instanceof PsiWhiteSpace) {
      comment = comment.getPrevSibling();
    }
    if (comment instanceof PsiComment) {
      final StringBuilder sb = new StringBuilder();
      do {
        sb.insert(0, EscapeUtil.unescapeText(comment).replaceAll("\n?##?", "") + "<br>");
        comment = comment.getPrevSibling();
      } while (comment instanceof PsiComment);

      if (element instanceof RncDefine) {
        sb.insert(0, "Define: <b>" + ((RncDefine)element).getName() + "</b><br>");
      }

      return sb.toString();
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:RngCompactLanguage.java


示例2: generateDoc

import org.intellij.plugins.relaxNG.compact.psi.RncElement; //导入依赖的package包/类
@Nullable
public String generateDoc(PsiElement element, PsiElement originalElement) {
  if (element instanceof RncElement) {
    PsiElement comment = element.getPrevSibling();
    while (comment instanceof PsiWhiteSpace) {
      comment = comment.getPrevSibling();
    }
    if (comment instanceof PsiComment) {
      final StringBuilder sb = new StringBuilder();
      do {
        sb.insert(0, EscapeUtil.unescapeText(comment).replaceAll("\n?##?", "") + "<br>");
        comment = comment.getPrevSibling();
      } while (comment instanceof PsiComment);

      if (element instanceof RncDefine) {
        sb.insert(0, "Define: <b>" + ((RncDefine)element).getName() + "</b><br>");
      }

      return sb.toString();
    }
  }
  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:RngCompactLanguage.java


示例3: RncCompletionData

import org.intellij.plugins.relaxNG.compact.psi.RncElement; //导入依赖的package包/类
public RncCompletionData() {
  declareFinalScope(RncElement.class);

  final CompletionVariant variant = new CompletionVariant(new AndFilter(
          new ElementFilter() {
            @Override
            public boolean isAcceptable(Object element, PsiElement context) {
              return true;
            }

            @Override
            public boolean isClassAcceptable(Class hintClass) {
              return PsiElement.class.isAssignableFrom(hintClass);
            }
          },
          new PatternFilter(or(
                  psiElement().afterLeaf(psiElement(RncTokenTypes.KEYWORD_DEFAULT)),
                  not(
                          or(
                                  psiElement().inside(psiElement(RncTokenTypes.LITERAL)),
                                  psiElement().afterLeaf(psiElement().withElementType(RncTokenTypes.KEYWORDS))
                          )
                  )
          ))
  ));

  variant.includeScopeClass(LeafPsiElement.class, true);

  variant.addCompletion(new KeywordGetter());

  registerVariant(variant);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:RncCompletionData.java


示例4: getIncludeInfos

import org.intellij.plugins.relaxNG.compact.psi.RncElement; //导入依赖的package包/类
@NotNull
@Override
public FileIncludeInfo[] getIncludeInfos(FileContent content) {
  final ArrayList<FileIncludeInfo> infos;

  if (content.getFileType() == XmlFileType.INSTANCE) {
    CharSequence inputDataContentAsText = content.getContentAsText();
    if (CharArrayUtil.indexOf(inputDataContentAsText, ApplicationLoader.RNG_NAMESPACE, 0) == -1) return FileIncludeInfo.EMPTY;
    infos = new ArrayList<FileIncludeInfo>();
    NanoXmlUtil.parse(CharArrayUtil.readerFromCharSequence(content.getContentAsText()), new RngBuilderAdapter(infos));
  } else if (content.getFileType() == RncFileType.getInstance()) {
    infos = new ArrayList<FileIncludeInfo>();
    content.getPsiFile().acceptChildren(new RncElementVisitor() {
      @Override
      public void visitElement(RncElement element) {
        element.acceptChildren(this);
      }

      @Override
      public void visitInclude(RncInclude include) {
        final String path = include.getFileReference();
        if (path != null) {
          infos.add(new FileIncludeInfo(path));
        }
      }
    });
  } else {
    return FileIncludeInfo.EMPTY;
  }
  return infos.toArray(new FileIncludeInfo[infos.size()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:RelaxIncludeProvider.java


示例5: RncCompletionData

import org.intellij.plugins.relaxNG.compact.psi.RncElement; //导入依赖的package包/类
public RncCompletionData() {
  declareFinalScope(RncElement.class);

  final CompletionVariant variant = new CompletionVariant(new AndFilter(
          new ElementFilter() {
            public boolean isAcceptable(Object element, PsiElement context) {
              return true;
            }

            public boolean isClassAcceptable(Class hintClass) {
              return PsiElement.class.isAssignableFrom(hintClass);
            }
          },
          new PatternFilter(or(
                  psiElement().afterLeaf(psiElement(RncTokenTypes.KEYWORD_DEFAULT)),
                  not(
                          or(
                                  psiElement().inside(psiElement(RncTokenTypes.LITERAL)),
                                  psiElement().afterLeaf(psiElement().withElementType(RncTokenTypes.KEYWORDS))
                          )
                  )
          ))
  ));

  variant.includeScopeClass(LeafPsiElement.class, true);

  variant.addCompletion(new KeywordGetter());

  registerVariant(variant);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:31,代码来源:RncCompletionData.java


示例6: getIncludeInfos

import org.intellij.plugins.relaxNG.compact.psi.RncElement; //导入依赖的package包/类
@NotNull
@Override
public FileIncludeInfo[] getIncludeInfos(FileContent content) {
  final ArrayList<FileIncludeInfo> infos;

  if (content.getFileType() == XmlFileType.INSTANCE) {
    CharSequence inputDataContentAsText = content.getContentAsText();
    if (CharArrayUtil.indexOf(inputDataContentAsText, ApplicationLoader.RNG_NAMESPACE, 0) == -1) return FileIncludeInfo.EMPTY;
    infos = new ArrayList<>();
    NanoXmlUtil.parse(CharArrayUtil.readerFromCharSequence(content.getContentAsText()), new RngBuilderAdapter(infos));
  } else if (content.getFileType() == RncFileType.getInstance()) {
    infos = new ArrayList<>();
    content.getPsiFile().acceptChildren(new RncElementVisitor() {
      @Override
      public void visitElement(RncElement element) {
        element.acceptChildren(this);
      }

      @Override
      public void visitInclude(RncInclude include) {
        final String path = include.getFileReference();
        if (path != null) {
          infos.add(new FileIncludeInfo(path));
        }
      }
    });
  } else {
    return FileIncludeInfo.EMPTY;
  }
  return infos.toArray(new FileIncludeInfo[infos.size()]);
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:32,代码来源:RelaxIncludeProvider.java


示例7: isSuppressedAt

import org.intellij.plugins.relaxNG.compact.psi.RncElement; //导入依赖的package包/类
@SuppressWarnings({ "SSBasedInspection" })
private boolean isSuppressedAt(RncElement location) {
  PsiElement prev = location.getPrevSibling();
  while (prev instanceof PsiWhiteSpace || prev instanceof PsiComment) {
    if (prev instanceof PsiComment) {
      @NonNls String text = prev.getText();
      if (text.matches("\n*#\\s*suppress\\s.+") && (text.contains(getID()) || "ALL".equals(text))) return true;
    }
    prev = prev.getPrevSibling();
  }
  return false;
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:13,代码来源:BaseInspection.java


示例8: getPsiElement

import org.intellij.plugins.relaxNG.compact.psi.RncElement; //导入依赖的package包/类
@Override
public RncElement getPsiElement() {
  return this;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:RncElementImpl.java


示例9: getPsiElement

import org.intellij.plugins.relaxNG.compact.psi.RncElement; //导入依赖的package包/类
public RncElement getPsiElement() {
  return this;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:4,代码来源:RncElementImpl.java



注:本文中的org.intellij.plugins.relaxNG.compact.psi.RncElement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DescribeKeyResult类代码示例发布时间:2022-05-16
下一篇:
Java DataUpdateRequest类代码示例发布时间:2022-05-16
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap