if (disp == null) {
return;
}
//Initialize an exception handler from the window class.
ExceptionHandler handler = ExceptionHandler.getInstance();
for (;;) {
try {
if (!disp.readAndDispatch()) {
break;
}
} catch (Throwable e) {//Handle the exception the same way as the workbench
handler.handleException(e);
break;
}
// Only run the event loop for so long.
// Otherwise, this would never return if some other thread was