private void updateUi() {
Display display = Display.getDefault();
try {
if (!isCanceled() && !display.isDisposed() && dialog.getShell() != null && !dialog.getShell().isDisposed()) {
display.readAndDispatch();
display.update();
}
}
/*
* Ensure to catch any Exception here and disable the update of the