Revision: 18679
          http://sourceforge.net/p/gate/code/18679
Author:   markagreenwood
Date:     2015-05-11 17:35:52 +0000 (Mon, 11 May 2015)
Log Message:
-----------
Change the action Hide All in the main view to wait for the user interface to 
finish all its updates in order to prevent hanging. From Thomas Heitz

Modified Paths:
--------------
    gate/trunk/src/main/gate/gui/MainFrame.java

Modified: gate/trunk/src/main/gate/gui/MainFrame.java
===================================================================
--- gate/trunk/src/main/gate/gui/MainFrame.java 2015-05-11 10:34:17 UTC (rev 
18678)
+++ gate/trunk/src/main/gate/gui/MainFrame.java 2015-05-11 17:35:52 UTC (rev 
18679)
@@ -3811,22 +3811,30 @@
 
     @Override
     public void actionPerformed(ActionEvent e) {
-      // for each element in the tree look if it is in the tab panel
-      // if yes, remove it from the tab panel
-      Enumeration<?> nodesEnum = resourcesTreeRoot.preorderEnumeration();
-      DefaultMutableTreeNode node;
-      while(nodesEnum.hasMoreElements()) {
-        node = (DefaultMutableTreeNode)nodesEnum.nextElement();
-        if ((node.getUserObject() instanceof Handle)
-         && (mainTabbedPane.indexOfComponent(
-            ((Handle)node.getUserObject()).getLargeView()) != -1)) {
-          final Handle handle = (Handle)node.getUserObject();
-          SwingUtilities.invokeLater(new Runnable() { @Override
-          public void run() {
-            (new CloseViewAction(handle)).actionPerformed(null);
-          }});
+      Runnable runner = new Runnable() {
+        @Override
+        public void run() {
+          // for each element in the tree look if it is in the tab panel
+          // if yes, remove it from the tab panel
+          Enumeration<?> nodesEnum = resourcesTreeRoot.preorderEnumeration();
+          DefaultMutableTreeNode node;
+          while(nodesEnum.hasMoreElements()) {
+            node = (DefaultMutableTreeNode)nodesEnum.nextElement();
+            if ((node.getUserObject() instanceof Handle)
+             && (mainTabbedPane.indexOfComponent(
+                ((Handle)node.getUserObject()).getLargeView()) != -1)) {
+              final Handle handle = (Handle)node.getUserObject();
+              SwingUtilities.invokeLater(new Runnable() { @Override
+              public void run() {
+                (new CloseViewAction(handle)).actionPerformed(null);
+              }});
+            }
+          }
         }
-      }
+      };
+      Thread thread = new Thread(runner, "HideAllAction");
+      thread.setPriority(Thread.MIN_PRIORITY);
+      thread.start();
     }
   }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to