src/Pure/General/swing.scala
author haftmann
Tue, 03 Feb 2009 16:39:52 +0100
changeset 29782 02e76245e5af
parent 29649 8b0c1397868e
child 29777 f3284860004c
permissions -rw-r--r--
dropped global Nil/Append interpretation

/*  Title:      Pure/General/swing.scala
    Author:     Makarius

Swing utilities.
*/

package isabelle

import javax.swing.SwingUtilities

object Swing
{
  def now(body: => Unit) {
    if (SwingUtilities.isEventDispatchThread) body
    else SwingUtilities.invokeAndWait(new Runnable { def run = body })
  }

  def later(body: => Unit) {
    if (SwingUtilities.isEventDispatchThread) body
    else SwingUtilities.invokeLater(new Runnable { def run = body })
  }
}