LOG.finer("ComponentRegistry initialized after " + (System.currentTimeMillis() - startTime));
processCommandLine(args, componentRegistry);
// create the main window using dependency injection
MainWindow mainWindow = componentRegistry.getMainWindow();
LOG.fine("Startup time: " + (System.currentTimeMillis() - startTime));
while (!mainWindow.isDisposed()) {
try {
if (!display.readAndDispatch())
display.sleep();
}
catch (Throwable e) {
if (e instanceof SWTException && e.getCause() != null)
e = e.getCause();
// display a nice error message
String localizedMessage = getLocalizedMessage(e);
Shell parent = display.getActiveShell();
showMessage(parent != null ? parent : mainWindow.getShell(),
e instanceof UserErrorException ? SWT.ICON_WARNING : SWT.ICON_ERROR,
Labels.getLabel(e instanceof UserErrorException ? "text.userError" : "text.error"), localizedMessage);
}
}