Пример #1
0
 protected static Map<IProject, Collection<CLRAnnotatedSourceFile>> groupByProject(
     Collection<CLRAnnotatedSourceFile> files) {
   Map<IProject, Collection<CLRAnnotatedSourceFile>> result =
       new HashMap<IProject, Collection<CLRAnnotatedSourceFile>>();
   for (CLRAnnotatedSourceFile file : files) {
     IProject project = file.getProject();
     Collection<CLRAnnotatedSourceFile> projectFiles = result.get(project);
     if (projectFiles == null) {
       projectFiles = new HashSet<CLRAnnotatedSourceFile>();
       result.put(project, projectFiles);
     }
     projectFiles.add(file);
   }
   return result;
 }
Пример #2
0
  /** do not call from within a job */
  public void recheckFiles(List<CLRAnnotatedSourceFile> files) {
    HashMap<IProject, List<CLRAnnotatedSourceFile>> orderedFiles =
        new HashMap<IProject, List<CLRAnnotatedSourceFile>>();
    for (CLRAnnotatedSourceFile file : files) {
      List<CLRAnnotatedSourceFile> projectFiles = orderedFiles.get(file.getResource().getProject());
      if (projectFiles == null) {
        projectFiles = new ArrayList<CLRAnnotatedSourceFile>();
        orderedFiles.put(file.getResource().getProject(), projectFiles);
      }
      projectFiles.add(file);
    }

    for (Entry<IProject, List<CLRAnnotatedSourceFile>> fileSet : orderedFiles.entrySet()) {
      WorkspaceJob op = new TypecheckFilesJob(fileSet.getKey(), fileSet.getValue(), this);
      op.setUser(true);
      op.schedule();
    }
  }