Esempio n. 1
0
 /**
  * Run the given runnable, waiting until the end to perform a refresh
  *
  * @param runnable
  * @param monitor
  */
 public void run(IRunnableWithProgress runnable, IProgressMonitor monitor)
     throws InvocationTargetException, InterruptedException {
   try {
     notificationLevel++;
     runnable.run(monitor);
   } finally {
     notificationLevel = Math.max(0, notificationLevel - 1);
     if (notificationLevel == 0) {
       try {
         Collection roots = changedRepositories.values();
         broadcastRepositoriesChanged(
             (ICVSRepositoryLocation[]) roots.toArray(new ICVSRepositoryLocation[roots.size()]));
       } finally {
         changedRepositories.clear();
       }
     }
   }
 }