refs #7131
Change-Id: I0fa2072895253cf0fcf80f3de48efe536004c6b8
public class SWTThread implements IThreadWorkQueue, Executor {
public class SWTThread implements IThreadWorkQueue, Executor {
+ private final Display display;
+ private final boolean executeAsync;
+
+ public static IThreadWorkQueue getThreadAccess(Display display, boolean executeAsync)
+ {
+ return new SWTThread(display, executeAsync);
+ }
public static IThreadWorkQueue getThreadAccess(Display display)
{
public static IThreadWorkQueue getThreadAccess(Display display)
{
- return new SWTThread(display);
+ return getThreadAccess(display, false);
}
public static IThreadWorkQueue getThreadAccess(Widget widget)
{
}
public static IThreadWorkQueue getThreadAccess(Widget widget)
{
- return new SWTThread(widget.getDisplay());
+ return new SWTThread(widget.getDisplay(), false);
}
public static IThreadWorkQueue getThreadAccess() {
}
public static IThreadWorkQueue getThreadAccess() {
- return new SWTThread(Display.getDefault());
+ return new SWTThread(Display.getDefault(), false);
- SWTThread(Display display)
+ SWTThread(Display display, boolean executeAsync)
{
this.display = display;
{
this.display = display;
+ this.executeAsync = executeAsync;
@Override
public void execute(Runnable command) {
@Override
public void execute(Runnable command) {
+ if (executeAsync) asyncExec(command);
+ else syncExec(command);