diff options
Diffstat (limited to 'uitest/src/com/vaadin/tests/applicationcontext/UIRunSafelyThread.java')
-rw-r--r-- | uitest/src/com/vaadin/tests/applicationcontext/UIRunSafelyThread.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/applicationcontext/UIRunSafelyThread.java b/uitest/src/com/vaadin/tests/applicationcontext/UIRunSafelyThread.java new file mode 100644 index 0000000000..c9af2c000d --- /dev/null +++ b/uitest/src/com/vaadin/tests/applicationcontext/UIRunSafelyThread.java @@ -0,0 +1,24 @@ +package com.vaadin.tests.applicationcontext; + +import com.vaadin.ui.UI; + +public abstract class UIRunSafelyThread extends Thread { + private UI ui; + + public UIRunSafelyThread(UI ui) { + this.ui = ui; + } + + @Override + public void run() { + ui.accessSynchronously(new Runnable() { + + @Override + public void run() { + runSafely(); + } + }); + } + + protected abstract void runSafely(); +}
\ No newline at end of file |