merged
authorhaftmann
Wed, 28 Jan 2009 13:36:24 +0100
changeset 29658 f2584b0c76b5
parent 29649 8b0c1397868e (diff)
parent 29657 881f328dfbb3 (current diff)
child 29664 6146e275e8af
child 29665 2b956243d123
child 29674 3857d7eba390
merged
src/HOL/ex/Reflection.thy
src/HOL/ex/reflection.ML
src/HOL/ex/reflection_data.ML
--- a/src/Pure/General/swing.scala	Wed Jan 28 13:36:11 2009 +0100
+++ b/src/Pure/General/swing.scala	Wed Jan 28 13:36:24 2009 +0100
@@ -10,9 +10,13 @@
 
 object Swing
 {
-  def now(body: => Unit) =
-    SwingUtilities.invokeAndWait(new Runnable { def run = body })
+  def now(body: => Unit) {
+    if (SwingUtilities.isEventDispatchThread) body
+    else SwingUtilities.invokeAndWait(new Runnable { def run = body })
+  }
 
-  def later(body: => Unit) =
-    SwingUtilities.invokeLater(new Runnable { def run = body })
+  def later(body: => Unit) {
+    if (SwingUtilities.isEventDispatchThread) body
+    else SwingUtilities.invokeLater(new Runnable { def run = body })
+  }
 }