//
// $Id$

package com.samskivert.util;

/**
 * An interface for a service that queues up execution of Runnables.
 */
public interface RunQueue
{
    /**
     * Post the specified Runnable to be run on the RunQueue.
     */
    public void postRunnable (Runnable r);

    /**
     * @return true if the calling thread is the RunQueue dispatch thread.
     */
    public boolean isDispatchThread ();
}

@@ -35,16 +35,45 @@
 .util;%0A%0A
+import java.awt.EventQueue;%0A%0A
 /**%0A * A
@@ -169,16 +169,386 @@
 Queue%0A%7B%0A
+    /**%0A     * A useful RunQueue that uses the AWT dispatch thread.%0A     */%0A    public static final RunQueue AWT = new RunQueue()%0A    %7B%0A        public void postRunnable (Runnable r)%0A        %7B%0A            return EventQueue.invokeLater(r);%0A        %7D%0A%0A        public boolean isDispatchThread ()%0A        %7B%0A            return EventQueue.isDispatchThread();%0A        %7D%0A    %7D;%0A%0A
     /**%0A

Define a handy-dandy public static RunQueue implementation that posts Runnables to the AWT dispatch thread.