patch for JAL-542
[jalview.git] / src / jalview / gui / DasSourceBrowser.java
index 4bd31bd..0487c56 100755 (executable)
@@ -59,8 +59,9 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
     return registry;\r
   }\r
 \r
-  public DasSourceBrowser()\r
+  public DasSourceBrowser(FeatureSettings featureSettings)\r
   {\r
+    fs = featureSettings;\r
     String registry = getDasRegistryURL();\r
 \r
     registryURL.setText(registry);\r
@@ -106,6 +107,11 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
       init();\r
     }\r
   }\r
+  FeatureSettings fs = null;\r
+  public DasSourceBrowser()\r
+  {\r
+    this(null);\r
+  }\r
 \r
   public void paintComponent(java.awt.Graphics g)\r
   {\r
@@ -271,16 +277,27 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
     refresh.setVisible(false);\r
     progressBar.setVisible(true);\r
     progressBar.setIndeterminate(true);\r
+    setParentGuiEnabled(false);\r
     // Refresh the source list.\r
     dasSources = null;\r
     getDASSource();\r
 \r
     init();\r
 \r
+    setParentGuiEnabled(true);\r
     loadingDasSources = false;\r
 \r
   }\r
 \r
+  private void setParentGuiEnabled(boolean b)\r
+  {\r
+    if (fs!=null)\r
+    {\r
+      fs.fetchDAS.setEnabled(b);\r
+      fs.saveDAS.setEnabled(b);\r
+    }\r
+  }\r
+\r
   public Vector getSelectedSources()\r
   {\r
     // wait around if we're still loading.\r
@@ -931,4 +948,14 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
     }\r
     return resolved;\r
   }\r
+\r
+  /**\r
+   * disable or enable the buttons on the source browser\r
+   * @param b\r
+   */\r
+  public void setGuiEnabled(boolean b)\r
+  {\r
+    refresh.setEnabled(b);\r
+    addLocal.setEnabled(b);\r
+  }\r
 }\r