org.csstudio.ui.util.thread
Class UIBundlingThread

java.lang.Object
  extended by org.csstudio.ui.util.thread.UIBundlingThread
All Implemented Interfaces:
java.lang.Runnable

public final class UIBundlingThread
extends java.lang.Object
implements java.lang.Runnable

A singleton back thread which will help to execute tasks in UI thread. This way we avoid slow downs, that occur on several operating systems, when Display.asyncExec() is called very often from background threads. This thread sleeps for a time, which is below the processing capacity of human eyes and brain - so the user will not feel any delay.

Author:
Sven Wende, Xihui Chen

Method Summary
 void addRunnable(Display display, java.lang.Runnable runnable)
          Adds the specified runnable to the queue.
 void addRunnable(java.lang.Runnable runnable)
          Adds the specified runnable to the queue.
static UIBundlingThread getInstance()
          Gets the singleton instance.
 void run()
          .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static UIBundlingThread getInstance()
Gets the singleton instance.

Returns:
the singleton instance

run

public void run()
.

Specified by:
run in interface java.lang.Runnable

addRunnable

public void addRunnable(java.lang.Runnable runnable)
Adds the specified runnable to the queue. Should not be used for RAP.

Parameters:
runnable - the runnable

addRunnable

public void addRunnable(Display display,
                        java.lang.Runnable runnable)
Adds the specified runnable to the queue. Fake method for adapting RAP.

Parameters:
runnable - the runnable