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


Java FileLevelIntentionComponent类代码示例

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


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

示例1: addFileLevelHighlight

import com.intellij.codeInsight.intention.impl.FileLevelIntentionComponent; //导入依赖的package包/类
@Override
public void addFileLevelHighlight(@NotNull final Project project,
                                  final int group,
                                  @NotNull final HighlightInfo info,
                                  @NotNull final PsiFile psiFile) {
  VirtualFile vFile = psiFile.getViewProvider().getVirtualFile();
  final FileEditorManager manager = FileEditorManager.getInstance(project);
  for (FileEditor fileEditor : manager.getEditors(vFile)) {
    if (fileEditor instanceof TextEditor) {
      FileLevelIntentionComponent component = new FileLevelIntentionComponent(info.getDescription(), info.getSeverity(),
                                                                              info.getGutterIconRenderer(), info.quickFixActionRanges,
                                                                              project, psiFile, ((TextEditor)fileEditor).getEditor());
      manager.addTopComponent(fileEditor, component);
      List<HighlightInfo> fileLevelInfos = fileEditor.getUserData(FILE_LEVEL_HIGHLIGHTS);
      if (fileLevelInfos == null) {
        fileLevelInfos = new ArrayList<HighlightInfo>();
        fileEditor.putUserData(FILE_LEVEL_HIGHLIGHTS, fileLevelInfos);
      }
      info.fileLevelComponent = component;
      info.setGroup(group);
      fileLevelInfos.add(info);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:DaemonCodeAnalyzerImpl.java

示例2: addFileLevelHighlight

import com.intellij.codeInsight.intention.impl.FileLevelIntentionComponent; //导入依赖的package包/类
private static void addFileLevelHighlight(@NotNull final Project project, final int group, @NotNull final HighlightInfo info, @NotNull final PsiFile psiFile) {
  VirtualFile vFile = psiFile.getViewProvider().getVirtualFile();
  final FileEditorManager manager = FileEditorManager.getInstance(project);
  for (FileEditor fileEditor : manager.getEditors(vFile)) {
    if (fileEditor instanceof TextEditor) {
      FileLevelIntentionComponent component = new FileLevelIntentionComponent(info.getDescription(), info.getSeverity(), info.quickFixActionRanges,
                                                                              project, psiFile, ((TextEditor)fileEditor).getEditor());
      manager.addTopComponent(fileEditor, component);
      List<HighlightInfo> fileLevelInfos = fileEditor.getUserData(FILE_LEVEL_HIGHLIGHTS);
      if (fileLevelInfos == null) {
        fileLevelInfos = new ArrayList<HighlightInfo>();
        fileEditor.putUserData(FILE_LEVEL_HIGHLIGHTS, fileLevelInfos);
      }
      info.fileLevelComponent = component;
      info.setGroup(group);
      fileLevelInfos.add(info);
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:UpdateHighlightersUtil.java

示例3: addFileLevelHighlight

import com.intellij.codeInsight.intention.impl.FileLevelIntentionComponent; //导入依赖的package包/类
@Override
public void addFileLevelHighlight(@Nonnull final Project project,
                                  final int group,
                                  @Nonnull final HighlightInfo info,
                                  @Nonnull final PsiFile psiFile) {
  VirtualFile vFile = psiFile.getViewProvider().getVirtualFile();
  final FileEditorManager manager = FileEditorManager.getInstance(project);
  for (FileEditor fileEditor : manager.getEditors(vFile)) {
    if (fileEditor instanceof TextEditor) {
      FileLevelIntentionComponent component = new FileLevelIntentionComponent(info.getDescription(), info.getSeverity(),
                                                                              info.getGutterIconRenderer(), info.quickFixActionRanges,
                                                                              project, psiFile, ((TextEditor)fileEditor).getEditor(), info.getToolTip());
      manager.addTopComponent(fileEditor, component);
      List<HighlightInfo> fileLevelInfos = fileEditor.getUserData(FILE_LEVEL_HIGHLIGHTS);
      if (fileLevelInfos == null) {
        fileLevelInfos = new ArrayList<>();
        fileEditor.putUserData(FILE_LEVEL_HIGHLIGHTS, fileLevelInfos);
      }
      info.fileLevelComponent = component;
      info.setGroup(group);
      fileLevelInfos.add(info);
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:25,代码来源:DaemonCodeAnalyzerImpl.java


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