예제 #1
0
파일: UIUtils.java 프로젝트: ralic/dbeaver
 public static void runInUI(@Nullable Shell shell, @NotNull Runnable runnable) {
   final Display display =
       shell == null || shell.isDisposed() ? Display.getDefault() : shell.getDisplay();
   if (display.getThread() != Thread.currentThread()) {
     display.syncExec(runnable);
   } else {
     runnable.run();
   }
 }
예제 #2
0
파일: UIUtils.java 프로젝트: ralic/dbeaver
 public static void runInDetachedUI(@Nullable Shell shell, @NotNull Runnable runnable) {
   if (shell == null) {
     Display.getDefault().asyncExec(runnable);
   } else {
     try {
       shell.getDisplay().asyncExec(runnable);
     } catch (SWTException e) {
       // DF: Widget has been disposed, too late for some processing then..
     }
   }
 }