1 19 20 package org.openide.awt; 21 22 25 final class AWTTask extends org.openide.util.Task { 26 private boolean executed; 27 28 public AWTTask (Runnable r) { 29 super (r); 30 org.openide.util.Mutex.EVENT.readAccess (this); 31 } 32 33 public void run () { 34 if (!executed) { 35 super.run (); 36 executed = true; 37 } 38 } 39 40 public void waitFinished () { 41 if (javax.swing.SwingUtilities.isEventDispatchThread ()) { 42 run (); 43 } else { 44 super.waitFinished (); 45 } 46 } 47 } 48 | Popular Tags |