dsto.dfc.util
Class RunnableEventCallback

java.lang.Object
  extended by dsto.dfc.util.RunnableEventCallback
All Implemented Interfaces:
Runnable

public class RunnableEventCallback
extends Object
implements Runnable

Used to deliver an event from a Runnable. This can be used to shunt an event from a non-UI thread to be re-delivered in the UI thread.

Example usage for SWT:

 public void propertyValueChanged (PropertyChangeEvent e)
 {
   Display display = table.getDisplay ();
      
   if (display.getThread () == Thread.currentThread ())
   {
     table.update (e.path.first (), null);
   } else
   {
     display.asyncExec (new RunnableEventCallback (this, "propertyValueChanged", e));
   }
 }
 

Author:
phillipm

Constructor Summary
RunnableEventCallback(Object target, String methodName, Object event)
          Create a new instance.
 
Method Summary
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RunnableEventCallback

public RunnableEventCallback(Object target,
                             String methodName,
                             Object event)
Create a new instance.

Parameters:
target - The target object to invoke the event on.
methodName - The name of the event handling method on target.
event - The event object.
Throws:
IllegalArgumentException - if method does not exist.
Method Detail

run

public void run()
Specified by:
run in interface Runnable


Copyright © 2008 Commonwealth of Australia