aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/applicationcontext/UIRunSafelyThread.java
blob: ddc0f28664780db3f0783accc8ebec30f4be5389 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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.access(new Runnable() {

            @Override
            public void run() {
                runSafely();
            }
        });
    }

    protected abstract void runSafely();
}