editable paths list for Python interpreter (PY-1201)
authorDmitry Jemerov <yole@jetbrains.com>
Wed, 7 Jul 2010 17:56:49 +0000 (21:56 +0400)
committerDmitry Jemerov <yole@jetbrains.com>
Wed, 7 Jul 2010 18:11:18 +0000 (22:11 +0400)
java/idea-ui/src/com/intellij/openapi/projectRoots/ui/SdkEditor.java
platform/lang-impl/src/com/intellij/openapi/projectRoots/ui/PathEditor.java

index f10493bb9d828cfb96ad09e09cacbaf85d703054..82b82d45f5de0522b2ed45ec6a5fb8d8ccdedd49 100644 (file)
@@ -215,7 +215,7 @@ public class SdkEditor implements Configurable, Place.Navigator {
     else{
       final SdkModificator sdkModificator = mySdk.getSdkModificator();
       for (OrderRootType type : myPathEditors.keySet()) {
-        myPathEditors.get(type).reset(sdkModificator.getRoots(type));
+        myPathEditors.get(type).reset(sdkModificator);
       }
       sdkModificator.commitChanges();
       setHomePathValue(mySdk.getHomePath().replace('/', File.separatorChar));
index 766bf3590f812ce0370ea93f66db1a06d023c051..d57d4838b94c7d57bc557defcb0d472776245f21 100644 (file)
@@ -38,6 +38,7 @@ import com.intellij.util.Icons;
 import com.intellij.util.containers.HashSet;
 import com.intellij.util.ui.UIUtil;
 import gnu.trove.TIntArrayList;
+import org.jetbrains.annotations.Nullable;
 
 import javax.swing.*;
 import javax.swing.event.ListSelectionEvent;
@@ -121,11 +122,12 @@ public class PathEditor {
     return roots;
   }
 
-  public void reset(VirtualFile[] files) {
+  public void reset(@Nullable SdkModificator modificator) {
     keepSelectionState();
     clearList();
-    myEnabled = files != null;
+    myEnabled = modificator != null;
     if(myEnabled){
+      VirtualFile[] files = modificator.getRoots(myOrderRootType);
       for (VirtualFile file : files) {
         addElement(file);
       }