}
public Set<String> getActiveInspectionProfiles() {
Set<String> result = new HashSet<String>();
if (myType == PROJECT || myType == CUSTOM){
final ProjectProfileManager profileManager = ProjectProfileManager.getProjectProfileManager(myProject, Profile.INSPECTION);
LOG.assertTrue(profileManager != null);
if (profileManager.useProjectLevelProfileSettings()) {
result.addAll(profileManager.getProfilesUsedInProject().values());
result.add(profileManager.getProjectProfile());
} else {
final ApplicationProfileManager applicationProfileManager = ApplicationProfileManager.getProfileManager(Profile.INSPECTION);
LOG.assertTrue(applicationProfileManager != null);
result.add(applicationProfileManager.getRootProfile().getName());
}
} else if (myType == MODULE){
processModule(result, myModule);
} else if (myType == MODULES){
for (Module module : myModules) {
processModule(result, module);
}
} else if (myType == FILE){
final ProjectProfileManager profileManager = ProjectProfileManager.getProjectProfileManager(myElement.getProject(), Profile.INSPECTION);
LOG.assertTrue(profileManager != null);
result.add(profileManager.getProfileName((PsiFile)myElement));
} else if (myType == DIRECTORY) {
final ProjectProfileManager profileManager = ProjectProfileManager.getProjectProfileManager(myElement.getProject(), Profile.INSPECTION);
LOG.assertTrue(profileManager != null);
processDirectories(new PsiDirectory[]{(PsiDirectory)myElement}, result, profileManager);
} else if (myType == PACKAGE){
final ProjectProfileManager profileManager = ProjectProfileManager.getProjectProfileManager(myElement.getProject(), Profile.INSPECTION);
LOG.assertTrue(profileManager != null);
final PsiDirectory[] psiDirectories = ((PsiPackage)myElement).getDirectories();
processDirectories(psiDirectories, result, profileManager);
} else if (myType == VIRTUAL_FILES){
final ProjectProfileManager profileManager = ProjectProfileManager.getProjectProfileManager(myProject, Profile.INSPECTION);
final PsiManager psiManager = PsiManager.getInstance(myProject);
LOG.assertTrue(profileManager != null);
for (final VirtualFile file : myFilesSet) {
final PsiFile psiFile = getPsiFileInReadAction(psiManager, file);
if (psiFile != null && psiFile.isValid()) {
result.add(profileManager.getProfileName(psiFile));
}
}
}
return result;
}