Package com.intellij.profile

Examples of com.intellij.profile.ProjectProfileManager


  }

  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;
  }
View Full Code Here


    }
  }

  private static void processModule(final Set<String> result, final Module module) {
    final Project project = module.getProject();
    final ProjectProfileManager profileManager = ProjectProfileManager.getProjectProfileManager(project, Profile.INSPECTION);
    LOG.assertTrue(profileManager != null);
    final VirtualFile[] files = ModuleRootManager.getInstance(module).getContentRoots();
    final PsiDirectory[] dirs = new PsiDirectory[files.length];
    final PsiManager psiManager = PsiManager.getInstance(project);
    int i = 0;
View Full Code Here

TOP

Related Classes of com.intellij.profile.ProjectProfileManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.