Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


oracle.javatools.util
Class SwingClosure

java.lang.Object
  extended by oracle.javatools.util.SwingClosure


public abstract class SwingClosure
extends java.lang.Object

This class is intended to be used as a named or anonymous closure for code that must be run immediately on the Swing/AWT event thread while the caller blocks. The code to run on the Swing/AWT thread should be implemented in the runImpl() method.


Constructor Summary
SwingClosure()
          Creates a SwingClosure that will use SwingUtilities.invokeAndWait(..) if the current thread is not the Swing thread.
SwingClosure(boolean useInvokeLater)
           

 

Method Summary
 void run()
          This implementation ensures that the code in the runImpl(..) method is executed on the Swing/AWT event thread.
protected abstract  void runImpl()
          Subclasses should override this method to provide the closure implementation.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

SwingClosure

public SwingClosure()
Creates a SwingClosure that will use SwingUtilities.invokeAndWait(..) if the current thread is not the Swing thread.

SwingClosure

public SwingClosure(boolean useInvokeLater)
Parameters:
useInvokeLater - Specify true if SwingClosure should use SwingUtilities.invokeLater(..). Specify false if it should use SwingUtilities.invokeAndWait(..).

Method Detail

run

public final void run()
               throws ClosureException
This implementation ensures that the code in the runImpl(..) method is executed on the Swing/AWT event thread. Any exceptions will be propagated as ClosureException.
Throws:
ClosureException

runImpl

protected abstract void runImpl()
                         throws java.lang.Exception
Subclasses should override this method to provide the closure implementation. This method will be run on the Swing/AWT event thread. If any exception is thrown, it will be caught in SwingClosure and rethrown as ClosureException.
Throws:
java.lang.Exception

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


Copyright © 1997, 2012, Oracle. All rights reserved.