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


Java GeneralHighlightingPass类代码示例

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


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

示例1: createDomHighlighter

import com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass; //导入依赖的package包/类
@Override
public BackgroundEditorHighlighter createDomHighlighter(final Project project, final PerspectiveFileEditor editor, final DomElement element) {
  return new BackgroundEditorHighlighter() {
    @Override
    @NotNull
    public HighlightingPass[] createPassesForEditor() {
      if (!element.isValid()) return HighlightingPass.EMPTY_ARRAY;
      
      final XmlFile psiFile = DomUtil.getFile(element);

      final PsiDocumentManager psiDocumentManager = PsiDocumentManager.getInstance(project);
      final Document document = psiDocumentManager.getDocument(psiFile);
      if (document == null) return HighlightingPass.EMPTY_ARRAY;

      editor.commit();

      psiDocumentManager.commitAllDocuments();

      GeneralHighlightingPass ghp = new GeneralHighlightingPass(project, psiFile, document, 0, document.getTextLength(),
                                                                true, new ProperTextRange(0, document.getTextLength()), null, new DefaultHighlightInfoProcessor());
      LocalInspectionsPass lip = new LocalInspectionsPass(psiFile, document, 0,
                                                          document.getTextLength(), LocalInspectionsPass.EMPTY_PRIORITY_RANGE, true,
                                                          new DefaultHighlightInfoProcessor());
      return new HighlightingPass[]{ghp, lip};
    }

    @Override
    @NotNull
    public HighlightingPass[] createPassesForVisibleArea() {
      return createPassesForEditor();
    }
  };

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:DomUIFactoryImpl.java

示例2: createDomHighlighter

import com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass; //导入依赖的package包/类
public BackgroundEditorHighlighter createDomHighlighter(final Project project, final PerspectiveFileEditor editor, final DomElement element) {
  return new BackgroundEditorHighlighter() {
    @NotNull
    public HighlightingPass[] createPassesForEditor() {
      if (!element.isValid()) return HighlightingPass.EMPTY_ARRAY;
      
      final XmlFile psiFile = DomUtil.getFile(element);

      final PsiDocumentManager psiDocumentManager = PsiDocumentManager.getInstance(project);
      final Document document = psiDocumentManager.getDocument(psiFile);
      if (document == null) return HighlightingPass.EMPTY_ARRAY;

      editor.commit();

      psiDocumentManager.commitAllDocuments();

      GeneralHighlightingPass ghp = new GeneralHighlightingPass(project, psiFile, document, 0, document.getTextLength(), true);
      LocalInspectionsPass lip = new LocalInspectionsPass(psiFile, document, 0,
                                                          document.getTextLength(), LocalInspectionsPass.EMPTY_PRIORITY_RANGE, true);
      return new HighlightingPass[]{ghp, lip};
    }

    @NotNull
    public HighlightingPass[] createPassesForVisibleArea() {
      return createPassesForEditor();
    }
  };

}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:30,代码来源:DomUIFactoryImpl.java

示例3: createDomHighlighter

import com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass; //导入依赖的package包/类
public BackgroundEditorHighlighter createDomHighlighter(final Project project, final PerspectiveFileEditor editor, final DomElement element) {
  return new BackgroundEditorHighlighter() {
    @NotNull
    public HighlightingPass[] createPassesForEditor() {
      if (!element.isValid()) return HighlightingPass.EMPTY_ARRAY;

      final XmlFile psiFile = DomUtil.getFile(element);

      final PsiDocumentManager psiDocumentManager = PsiDocumentManager.getInstance(project);
      final Document document = psiDocumentManager.getDocument(psiFile);
      if (document == null) return HighlightingPass.EMPTY_ARRAY;

      editor.commit();

      psiDocumentManager.commitAllDocuments();

      GeneralHighlightingPass ghp = new GeneralHighlightingPass(project, psiFile, document, 0, document.getTextLength(),
                                                                true, new ProperTextRange(0, document.getTextLength()), null, new DefaultHighlightInfoProcessor());
      LocalInspectionsPass lip = new LocalInspectionsPass(psiFile, document, 0,
                                                          document.getTextLength(), LocalInspectionsPass.EMPTY_PRIORITY_RANGE, true,
                                                          HighlightInfoProcessor.getEmpty());
      return new HighlightingPass[]{ghp, lip};
    }

    @NotNull
    public HighlightingPass[] createPassesForVisibleArea() {
      return createPassesForEditor();
    }
  };

}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:32,代码来源:DomUIFactoryImpl.java


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