removed beforeRootsChanged/rootsChanged so frequently abused, use makeRootsChange...
authorAlexey Kudravtsev <cdr@intellij.com>
Fri, 14 May 2010 09:15:09 +0000 (13:15 +0400)
committerAlexey Kudravtsev <cdr@intellij.com>
Fri, 14 May 2010 10:15:27 +0000 (14:15 +0400)
platform/lang-impl/src/com/intellij/openapi/roots/ex/ProjectRootManagerEx.java
platform/lang-impl/src/com/intellij/openapi/roots/impl/ProjectRootManagerImpl.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectsProcessorArtifactsDownloadingTask.java

index 2b3c6d39ae42e1eb7cfd61f8f1f14306995aecf5..5202d8e39ba570f4587604b7ef47a292ffb99f19 100644 (file)
@@ -42,9 +42,7 @@ public abstract class ProjectRootManagerEx extends ProjectRootManager {
 
   public abstract void removeProjectJdkListener(ProjectJdkListener listener);
 
-  public abstract void beforeRootsChange(boolean filetypes);
-
-  public abstract void rootsChanged(boolean filetypes);
+  // invokes runnable surrounded by beforeRootsChage()/rootsChanged() callbacks
   public abstract void makeRootsChange(@NotNull Runnable runnable, boolean filetypes, boolean fireEvents);
 
   public abstract void mergeRootsChangesDuring(@NotNull Runnable runnable);
index e960825525a6e89fd9718a4f6176a82de79619c5..0aa6f9647c5312b907db2e5d7af015efac2fba61 100644 (file)
@@ -454,7 +454,7 @@ public class ProjectRootManagerImpl extends ProjectRootManagerEx implements Proj
     }
   }
 
-  public void beforeRootsChange(boolean filetypes) {
+  private void beforeRootsChange(boolean filetypes) {
     if (myProject.isDisposed()) return;
     getBatchSession(filetypes).beforeRootsChanged();
   }
@@ -471,7 +471,7 @@ public class ProjectRootManagerImpl extends ProjectRootManagerEx implements Proj
     }
   }
 
-  public void rootsChanged(boolean filetypes) {
+  private void rootsChanged(boolean filetypes) {
     getBatchSession(filetypes).rootsChanged(false);
   }
 
index 50ccc1c005a1de5ecd5d7951b8d0499cf15e4956..53460c30b4a1e55be198f5570f12638e44b435b0 100644 (file)
@@ -17,8 +17,9 @@ package org.jetbrains.idea.maven.project;
 
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.project.Project;
-import com.intellij.openapi.roots.impl.ProjectRootManagerImpl;
+import com.intellij.openapi.roots.ex.ProjectRootManagerEx;
 import com.intellij.openapi.util.AsyncResult;
+import com.intellij.openapi.util.EmptyRunnable;
 import org.jetbrains.idea.maven.embedder.MavenConsole;
 import org.jetbrains.idea.maven.utils.MavenProcessCanceledException;
 import org.jetbrains.idea.maven.utils.MavenProgressIndicator;
@@ -59,8 +60,7 @@ public class MavenProjectsProcessorArtifactsDownloadingTask implements MavenProj
       public void run() {
         ApplicationManager.getApplication().runWriteAction(new Runnable() {
           public void run() {
-            ProjectRootManagerImpl.getInstanceImpl(project).beforeRootsChange(false);
-            ProjectRootManagerImpl.getInstanceImpl(project).rootsChanged(false);
+            ProjectRootManagerEx.getInstanceEx(project).makeRootsChange(EmptyRunnable.getInstance(), false, true);
           }
         });
       }