Ejemplo n.º 1
0
  protected Map<
          ModuleDescriptor, Map<File, List<FacetDetectionProcessor.DetectedInWizardFacetInfo>>>
      calculate() {
    myLastRoots = getRoots();

    ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator();

    Map<ModuleDescriptor, Map<File, List<FacetDetectionProcessor.DetectedInWizardFacetInfo>>>
        result =
            new HashMap<
                ModuleDescriptor,
                Map<File, List<FacetDetectionProcessor.DetectedInWizardFacetInfo>>>();
    for (ModuleDescriptor moduleDescriptor : getModuleDescriptors()) {

      Map<File, List<FacetDetectionProcessor.DetectedInWizardFacetInfo>> root2Facets =
          new HashMap<File, List<FacetDetectionProcessor.DetectedInWizardFacetInfo>>();
      for (File root : moduleDescriptor.getContentRoots()) {
        FacetDetectionProcessor processor =
            new FacetDetectionProcessor(progressIndicator, myModuleType);
        processor.process(root);
        List<FacetDetectionProcessor.DetectedInWizardFacetInfo> facets =
            processor.getDetectedFacetsInfos();
        if (!facets.isEmpty()) {
          root2Facets.put(root, facets);
        }
      }

      if (!root2Facets.isEmpty()) {
        result.put(moduleDescriptor, root2Facets);
      }
    }

    return result;
  }
Ejemplo n.º 2
0
 private List<File> getRoots() {
   List<File> roots = new ArrayList<File>();
   for (ModuleDescriptor moduleDescriptor : getModuleDescriptors()) {
     roots.addAll(moduleDescriptor.getContentRoots());
   }
   return roots;
 }