diff --git a/projects/samskivert/src/java/com/samskivert/util/RunQueue.java b/projects/samskivert/src/java/com/samskivert/util/RunQueue.java index 451b96c3..66c9031c 100644 --- a/projects/samskivert/src/java/com/samskivert/util/RunQueue.java +++ b/projects/samskivert/src/java/com/samskivert/util/RunQueue.java @@ -3,11 +3,29 @@ package com.samskivert.util; +import java.awt.EventQueue; + /** * An interface for a service that queues up execution of Runnables. */ public interface RunQueue { + /** + * A useful RunQueue that uses the AWT dispatch thread. + */ + public static final RunQueue AWT = new RunQueue() + { + public void postRunnable (Runnable r) + { + return EventQueue.invokeLater(r); + } + + public boolean isDispatchThread () + { + return EventQueue.isDispatchThread(); + } + }; + /** * Post the specified Runnable to be run on the RunQueue. */