A TLink callback which is executed asynchronously on the AWT event dispatching thread. More...
Public Member Functions | |
final void | callback (TLink link) |
The original TINE callback method. | |
final void | run () |
Called from the AWT event thread. | |
final int | getLinkStatus () |
Returns the link status. More... | |
final String | getErrorString () |
Returns the error string. | |
abstract void | onCallback (TLink link) |
Replaces TLinkCallback.callback(). More... | |
A TLink callback which is executed asynchronously on the AWT event dispatching thread.
This callback is useful for programs with an AWT or Swing GUI. It is not advisable to make any GUI modifications directly from TLinkCallback.callback(), since different threads are involved. An indirection via the AWT event queue has to be implemented.
This class simplifies GUI callbacks for client programmers. The programmer simply replaces TLinkCallback with TAwtSyncCallback and implements onCallback() instead of callback. From onCallback(), GUI components can be accessed safely.
In this class, the inherited TINE callback() method calls SwingUtilities.invokeLater() and returns. The AWT event dispatcher calls onCallback() later.
Warning: onCallback() has the original TLink as a parameter. It cannot be guaranteed that TLink is still in its original state when this method is called. If this is required, better use TAwtSyncCallback. However, the original link status and error message are saved and can be accessed with the methods getLinkStatus() and getErrorString().
final int de.desy.tine.client.TAwtAsyncCallback.getLinkStatus | ( | ) |
Returns the link status.
|
abstract |
Replaces TLinkCallback.callback().
This method to be implemented by derived classes.
link | The TLink which fired this callback. |
Referenced by de.desy.tine.client.TAwtAsyncCallback.run().