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


Java InspectionProjectProfileManager.getInspectionProfile方法代码示例

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


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

示例1: addRemoveTestsScope

import com.intellij.profile.codeInspection.InspectionProjectProfileManager; //导入方法依赖的package包/类
private void addRemoveTestsScope(Project project, boolean add) {
  final InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(project);
  final InspectionProfileImpl profile = (InspectionProfileImpl)profileManager.getInspectionProfile();
  final String shortName = myInspection.getShortName();
  final InspectionToolWrapper tool = profile.getInspectionTool(shortName, project);
  if (tool == null) {
    return;
  }
  final NamedScope namedScope = NamedScopesHolder.getScope(project, "Tests");
  final HighlightDisplayKey key = HighlightDisplayKey.find(shortName);
  final HighlightDisplayLevel level = profile.getErrorLevel(key, namedScope, project);
  if (add) {
    profile.addScope(tool, namedScope, level, false, project);
  }
  else {
    profile.removeScope(shortName, 0, project);
  }
  profile.scopesChanged();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:SuppressForTestsScopeFix.java

示例2: invoke

import com.intellij.profile.codeInspection.InspectionProjectProfileManager; //导入方法依赖的package包/类
@Override
public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
  InspectionToolWrapper toolWrapper = getTool(project, file);
  if (toolWrapper == null) return;
  final InspectionProjectProfileManager projectProfileManager = InspectionProjectProfileManager.getInstance(project);
  final InspectionProfileImpl inspectionProfile = (InspectionProfileImpl)projectProfileManager.getInspectionProfile();
  EditInspectionToolsSettingsAction.editToolSettings(project, inspectionProfile, false, toolWrapper.getShortName());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:EditInspectionToolsSettingsInSuppressedPlaceIntention.java

示例3: isAvailable

import com.intellij.profile.codeInspection.InspectionProjectProfileManager; //导入方法依赖的package包/类
@Override
public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
  final InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(project);
  InspectionProfile inspectionProfile = profileManager.getInspectionProfile();
  InspectionToolWrapper toolWrapper = inspectionProfile.getInspectionTool(myToolId, project);
  return toolWrapper == null || toolWrapper.getDefaultLevel() != HighlightDisplayLevel.NON_SWITCHABLE_ERROR;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:DisableInspectionToolAction.java

示例4: applyFix

import com.intellij.profile.codeInspection.InspectionProjectProfileManager; //导入方法依赖的package包/类
@Override
public void applyFix(@NotNull Project project, PsiFile file, @Nullable Editor editor) {
  InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(project);
  InspectionProfile inspectionProfile = profileManager.getInspectionProfile();
  ModifiableModel model = inspectionProfile.getModifiableModel();
  model.disableTool(myToolId, file);
  try {
    model.commit();
  }
  catch (IOException e) {
    Messages.showErrorDialog(project, e.getMessage(), CommonBundle.getErrorTitle());
  }
  DaemonCodeAnalyzer.getInstance(project).restart();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:DisableInspectionToolAction.java

示例5: invoke

import com.intellij.profile.codeInspection.InspectionProjectProfileManager; //导入方法依赖的package包/类
@Override
public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
  final InspectionProjectProfileManager projectProfileManager = InspectionProjectProfileManager.getInstance(file.getProject());
  InspectionProfile inspectionProfile = projectProfileManager.getInspectionProfile();
  editToolSettings(project,
                   inspectionProfile, true,
                   myShortName);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:EditInspectionToolsSettingsAction.java

示例6: fillActions

import com.intellij.profile.codeInspection.InspectionProjectProfileManager; //导入方法依赖的package包/类
@Override
protected void fillActions(Project project, @NotNull DefaultActionGroup group, @NotNull DataContext dataContext) {
  final InspectionProjectProfileManager projectProfileManager = InspectionProjectProfileManager.getInstance(project);
  InspectionProfile current = projectProfileManager.getInspectionProfile();
  for (Profile profile : projectProfileManager.getProfiles()) {
    addScheme(group, projectProfileManager, current, profile);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:QuickChangeInspectionProfileAction.java

示例7: FormEditorErrorCollector

import com.intellij.profile.codeInspection.InspectionProjectProfileManager; //导入方法依赖的package包/类
public FormEditorErrorCollector(final GuiEditor editor, final RadComponent component) {
  myEditor = editor;
  myComponent = component;

  myFormPsiFile = PsiManager.getInstance(editor.getProject()).findFile(editor.getFile());
  InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(editor.getProject());
  myProfile = profileManager.getInspectionProfile();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:FormEditorErrorCollector.java

示例8: invoke

import com.intellij.profile.codeInspection.InspectionProjectProfileManager; //导入方法依赖的package包/类
@Override
public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
  final InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(file.getProject());
  InspectionProfile inspectionProfile = profileManager.getInspectionProfile();
  ModifiableModel model = inspectionProfile.getModifiableModel();
  model.disableTool(myToolId, file);
  try {
    model.commit();
  }
  catch (IOException e) {
    Messages.showErrorDialog(project, e.getMessage(), CommonBundle.getErrorTitle());
  }
  DaemonCodeAnalyzer.getInstance(project).restart();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:DisableInspectionToolAction.java

示例9: invoke

import com.intellij.profile.codeInspection.InspectionProjectProfileManager; //导入方法依赖的package包/类
@Override
public void invoke(@Nonnull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
  InspectionToolWrapper toolWrapper = getTool(project, file);
  if (toolWrapper == null) return;
  final InspectionProjectProfileManager projectProfileManager = InspectionProjectProfileManager.getInstance(project);
  final InspectionProfileImpl inspectionProfile = (InspectionProfileImpl)projectProfileManager.getInspectionProfile();
  EditInspectionToolsSettingsAction.editToolSettings(project, inspectionProfile, false, toolWrapper.getShortName());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:EditInspectionToolsSettingsInSuppressedPlaceIntention.java

示例10: invoke

import com.intellij.profile.codeInspection.InspectionProjectProfileManager; //导入方法依赖的package包/类
@Override
public void invoke(@Nonnull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
  final InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(file.getProject());
  InspectionProfile inspectionProfile = profileManager.getInspectionProfile();
  ModifiableModel model = inspectionProfile.getModifiableModel();
  model.disableTool(myToolId, file);
  try {
    model.commit();
  }
  catch (IOException e) {
    Messages.showErrorDialog(project, e.getMessage(), CommonBundle.getErrorTitle());
  }
  DaemonCodeAnalyzer.getInstance(project).restart();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:DisableInspectionToolAction.java

示例11: invoke

import com.intellij.profile.codeInspection.InspectionProjectProfileManager; //导入方法依赖的package包/类
@Override
public void invoke(@Nonnull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
  final InspectionProjectProfileManager projectProfileManager = InspectionProjectProfileManager.getInstance(file.getProject());
  InspectionProfile inspectionProfile = projectProfileManager.getInspectionProfile();
  editToolSettings(project,
                   inspectionProfile, true,
                   myShortName);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:EditInspectionToolsSettingsAction.java

示例12: isInspectionEnabled

import com.intellij.profile.codeInspection.InspectionProjectProfileManager; //导入方法依赖的package包/类
public static boolean isInspectionEnabled(@NonNls String shortName, PsiElement context)
{
	final InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(context.getProject());
	final InspectionProfileImpl profile = (InspectionProfileImpl) profileManager.getInspectionProfile();
	final HighlightDisplayKey key = HighlightDisplayKey.find(shortName);
	return profile.isToolEnabled(key, context);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:8,代码来源:BaseInspection.java

示例13: getTool

import com.intellij.profile.codeInspection.InspectionProjectProfileManager; //导入方法依赖的package包/类
@Nullable
private InspectionToolWrapper getTool(final Project project, final PsiFile file) {
  final InspectionProjectProfileManager projectProfileManager = InspectionProjectProfileManager.getInstance(project);
  final InspectionProfileImpl inspectionProfile = (InspectionProfileImpl)projectProfileManager.getInspectionProfile();
  return inspectionProfile.getToolById(myId, file);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:EditInspectionToolsSettingsInSuppressedPlaceIntention.java

示例14: isInspectionEnabled

import com.intellij.profile.codeInspection.InspectionProjectProfileManager; //导入方法依赖的package包/类
public static boolean isInspectionEnabled(@NonNls String shortName, PsiElement context) {
  final InspectionProjectProfileManager profileManager = InspectionProjectProfileManager.getInstance(context.getProject());
  final InspectionProfileImpl profile = (InspectionProfileImpl)profileManager.getInspectionProfile();
  final HighlightDisplayKey key = HighlightDisplayKey.find(shortName);
  return profile.isToolEnabled(key, context);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:BaseInspection.java


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