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


Java InspectionToolWrapper.getShortName方法代码示例

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


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

示例1: enableInspectionTool

import com.intellij.codeInspection.ex.InspectionToolWrapper; //导入方法依赖的package包/类
public static void enableInspectionTool(@NotNull final Project project, @NotNull final InspectionToolWrapper toolWrapper) {
  final InspectionProfile profile = InspectionProjectProfileManager.getInstance(project).getInspectionProfile();
  final String shortName = toolWrapper.getShortName();
  final HighlightDisplayKey key = HighlightDisplayKey.find(shortName);
  if (key == null) {
    HighlightDisplayKey.register(shortName, toolWrapper.getDisplayName(), toolWrapper.getID());
  }
  InspectionProfileImpl.initAndDo(new Computable() {
    @Override
    public Object compute() {
      InspectionProfileImpl impl = (InspectionProfileImpl)profile;
      InspectionToolWrapper existingWrapper = impl.getInspectionTool(shortName, project);
      if (existingWrapper == null || existingWrapper.isInitialized() != toolWrapper.isInitialized() || toolWrapper.isInitialized() && toolWrapper.getTool() != existingWrapper.getTool()) {
        impl.addTool(project, toolWrapper, new THashMap<String, List<String>>());
      }
      impl.enableTool(shortName, project);
      return null;
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:LightPlatformTestCase.java

示例2: getWorkedTools

import com.intellij.codeInspection.ex.InspectionToolWrapper; //导入方法依赖的package包/类
@NotNull
private Set<InspectionToolWrapper> getWorkedTools(@NotNull InspectionNode node) {
  final Set<InspectionToolWrapper> result = new HashSet<InspectionToolWrapper>();
  final InspectionToolWrapper wrapper = node.getToolWrapper();
  if (myView.getCurrentProfileName() != null){
    result.add(wrapper);
    return result;
  }
  final String shortName = wrapper.getShortName();
  final GlobalInspectionContextImpl context = myView.getGlobalInspectionContext();
  final Tools tools = context.getTools().get(shortName);
  if (tools != null) {   //dummy entry points tool
    for (ScopeToolState state : tools.getTools()) {
      InspectionToolWrapper toolWrapper = state.getTool();
      result.add(toolWrapper);
    }
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ExportHTMLAction.java

示例3: getInspectionShortNameByIssue

import com.intellij.codeInspection.ex.InspectionToolWrapper; //导入方法依赖的package包/类
public static String getInspectionShortNameByIssue(@NotNull Project project, @NotNull Issue issue) {
  synchronized (ISSUE_MAP_LOCK) {
    if (ourIssue2InspectionShortName == null) {
      ourIssue2InspectionShortName = new HashMap<Issue, String>();

      final InspectionProfile profile = InspectionProjectProfileManager.getInstance(project).getInspectionProfile();

      for (InspectionToolWrapper e : profile.getInspectionTools(null)) {
        final String shortName = e.getShortName();

        if (shortName.startsWith("AndroidLint")) {
          final InspectionProfileEntry entry = e.getTool();
          if (entry instanceof AndroidLintInspectionBase) {
            final Issue s = ((AndroidLintInspectionBase)entry).getIssue();
            ourIssue2InspectionShortName.put(s, shortName);
          }
        }
      }
    }
    return ourIssue2InspectionShortName.get(issue);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:AndroidLintInspectionBase.java

示例4: getWorkedTools

import com.intellij.codeInspection.ex.InspectionToolWrapper; //导入方法依赖的package包/类
@Nonnull
private Set<InspectionToolWrapper> getWorkedTools(@Nonnull InspectionNode node) {
  final Set<InspectionToolWrapper> result = new HashSet<InspectionToolWrapper>();
  final InspectionToolWrapper wrapper = node.getToolWrapper();
  if (myView.getCurrentProfileName() != null){
    result.add(wrapper);
    return result;
  }
  final String shortName = wrapper.getShortName();
  final GlobalInspectionContextImpl context = myView.getGlobalInspectionContext();
  final Tools tools = context.getTools().get(shortName);
  if (tools != null) {   //dummy entry points tool
    for (ScopeToolState state : tools.getTools()) {
      InspectionToolWrapper toolWrapper = state.getTool();
      result.add(toolWrapper);
    }
  }
  return result;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:ExportHTMLAction.java

示例5: exportHTML

import com.intellij.codeInspection.ex.InspectionToolWrapper; //导入方法依赖的package包/类
@RequiredReadAction
private void exportHTML(HTMLExportFrameMaker frameMaker, InspectionNode node) {
  final Set<InspectionToolWrapper> toolWrappers = getWorkedTools(node);
  final InspectionToolWrapper toolWrapper = node.getToolWrapper();

  final HTMLExporter exporter =
    new HTMLExporter(frameMaker.getRootFolder() + "/" + toolWrapper.getShortName(), myView.getGlobalInspectionContext().getPresentation(toolWrapper).getComposer());
  frameMaker.startInspection(toolWrapper);
  HTMLExportUtil.runExport(myView.getProject(), new ThrowableRunnable<IOException>() {
    @Override
    @RequiredReadAction
    public void run() throws IOException {
      exportHTML(toolWrappers, exporter);
      exporter.generateReferencedPages();
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:ExportHTMLAction.java

示例6: convertToShortName

import com.intellij.codeInspection.ex.InspectionToolWrapper; //导入方法依赖的package包/类
@Nullable
private static String convertToShortName(String displayName, InspectionToolWrapper[] tools) {
  if (displayName == null) return null;
  for (InspectionToolWrapper tool : tools) {
    if (displayName.equals(tool.getDisplayName())) {
      return tool.getShortName();
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:InspectionProfileConvertor.java

示例7: runTool

import com.intellij.codeInspection.ex.InspectionToolWrapper; //导入方法依赖的package包/类
public static void runTool(@NotNull InspectionToolWrapper toolWrapper,
                           @NotNull final AnalysisScope scope,
                           @NotNull final GlobalInspectionContextForTests globalContext) {
  final String shortName = toolWrapper.getShortName();
  final HighlightDisplayKey key = HighlightDisplayKey.find(shortName);
  if (key == null){
    HighlightDisplayKey.register(shortName);
  }

  globalContext.doInspections(scope);
  do {
    UIUtil.dispatchAllInvocationEvents();
  }
  while (!globalContext.isFinished());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:InspectionTestUtil.java

示例8: exportHTML

import com.intellij.codeInspection.ex.InspectionToolWrapper; //导入方法依赖的package包/类
private void exportHTML(HTMLExportFrameMaker frameMaker, InspectionNode node) {
  final Set<InspectionToolWrapper> toolWrappers = getWorkedTools(node);
  final InspectionToolWrapper toolWrapper = node.getToolWrapper();

  final HTMLExporter exporter =
    new HTMLExporter(frameMaker.getRootFolder() + "/" + toolWrapper.getShortName(), myView.getGlobalInspectionContext().getPresentation(toolWrapper).getComposer());
  frameMaker.startInspection(toolWrapper);
  HTMLExportUtil.runExport(myView.getProject(), new ThrowableRunnable<IOException>() {
    @Override
    public void run() throws IOException {
      exportHTML(toolWrappers, exporter);
      exporter.generateReferencedPages();
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:ExportHTMLAction.java

示例9: runTool

import com.intellij.codeInspection.ex.InspectionToolWrapper; //导入方法依赖的package包/类
public static void runTool(@NotNull InspectionToolWrapper toolWrapper,
                           @NotNull final AnalysisScope scope,
                           @NotNull final GlobalInspectionContextImpl globalContext,
                           @NotNull final InspectionManagerEx inspectionManager) {
  final String shortName = toolWrapper.getShortName();
  final HighlightDisplayKey key = HighlightDisplayKey.find(shortName);
  if (key == null){
    HighlightDisplayKey.register(shortName);
  }

  globalContext.doInspections(scope);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:InspectionTestUtil.java

示例10: runTool

import com.intellij.codeInspection.ex.InspectionToolWrapper; //导入方法依赖的package包/类
public static void runTool(@Nonnull InspectionToolWrapper toolWrapper,
                           @Nonnull final AnalysisScope scope,
                           @Nonnull final GlobalInspectionContextImpl globalContext,
                           @Nonnull final InspectionManagerEx inspectionManager) {
  final String shortName = toolWrapper.getShortName();
  final HighlightDisplayKey key = HighlightDisplayKey.find(shortName);
  if (key == null){
    HighlightDisplayKey.register(shortName);
  }

  globalContext.doInspections(scope);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:13,代码来源:InspectionTestUtil.java


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