Merge branch 'patch/JAL-4196_structure_viewer_synchronising' into develop
[jalview.git] / src / jalview / gui / Desktop.java
index 99c394b..b901ae4 100644 (file)
@@ -3627,4 +3627,24 @@ public class Desktop extends jalview.jbgui.GDesktop
       Desktop.instance = null;
     }
   }
+
+  /**
+   * checks if any progress bars are being displayed in any of the windows managed by the desktop
+   * @return
+   */
+  public boolean operationsAreInProgress()
+  {
+    JInternalFrame[] frames = getAllFrames();
+    for (JInternalFrame frame:frames)
+    {
+      if (frame instanceof IProgressIndicator)
+      {
+        if (((IProgressIndicator)frame).operationInProgress())
+        {
+          return true;
+        }
+      }
+    }
+    return operationInProgress();
+  }
 }