org.fuin.apps4swing
Class EDTInvoker<RESULT>

java.lang.Object
  extended by org.fuin.apps4swing.EDTInvoker<RESULT>
Type Parameters:
RESULT - Type of result returned by the target method.

public final class EDTInvoker<RESULT>
extends Object

Calls a method on a target object in the EDT thread.


Constructor Summary
EDTInvoker(EDTGetter<RESULT> target)
          Constructor with target object.
 
Method Summary
 RESULT invoke()
          Calls the EDTGetter.get() using SwingUtilities.invokeAndWait(Runnable).
static void invokeAndWait(Runnable runnable)
          Executes a runnable using SwingUtilities.invokeAndWait(Runnable).
static void invokeLater(Runnable runnable)
          Executes a runnable using SwingUtilities.invokeLater(Runnable).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EDTInvoker

public EDTInvoker(EDTGetter<RESULT> target)
Constructor with target object.

Parameters:
target - Object's EDTGetter.get() method is called in the EDT thread.
Method Detail

invoke

public final RESULT invoke()
Calls the EDTGetter.get() using SwingUtilities.invokeAndWait(Runnable).

Returns:
Result of the method call.

invokeAndWait

public static void invokeAndWait(Runnable runnable)
Executes a runnable using SwingUtilities.invokeAndWait(Runnable).

Parameters:
runnable - Runnable to run.

invokeLater

public static void invokeLater(Runnable runnable)
Executes a runnable using SwingUtilities.invokeLater(Runnable).

Parameters:
runnable - Runnable to run.


Copyright © 2011 Future Invent Informationsmanagement GmbH. All Rights Reserved.