for (LocalInspectionTool tool : localInspectionTools) {
_enableInspectionTool(tool, availableToolsMap, availableLocalTools);
}
final InspectionProfileImpl profile = new InspectionProfileImpl("Configurable") {
public InspectionProfileEntry[] getInspectionTools() {
if (availableLocalTools != null){
final Collection<LocalInspectionToolWrapper> tools = availableLocalTools.values();
return tools.toArray(new LocalInspectionToolWrapper[tools.size()]);
}
return new InspectionProfileEntry[0];
}
public boolean isToolEnabled(HighlightDisplayKey key) {
return key != null && availableToolsMap.containsKey(key.toString());
}
public HighlightDisplayLevel getErrorLevel(HighlightDisplayKey key) {
final LocalInspectionTool localInspectionTool = availableToolsMap.get(key.toString());
return localInspectionTool != null ? localInspectionTool.getDefaultLevel() : HighlightDisplayLevel.WARNING;
}
public InspectionTool getInspectionTool(String shortName) {
if (availableToolsMap.containsKey(shortName)) {
return new LocalInspectionToolWrapper(availableToolsMap.get(shortName));
}
return null;
}
};
final InspectionProfileManager inspectionProfileManager = InspectionProfileManager.getInstance();
inspectionProfileManager.addProfile(profile);
inspectionProfileManager.setRootProfile(profile.getName());
InspectionProjectProfileManager.getInstance(getProject()).updateProfile(profile);
assertFalse(getPsiManager().isDisposed());
CodeStyleSettingsManager.getInstance(getProject()).setTemporarySettings(new CodeStyleSettings());