if (LogLevel.showDebug()) {
editMain.add(error);
editMain.add(fatal);
editMain.add(log);
// We need our own uncaught exception hander to make sure the error shout happens
GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
public void onUncaughtException(Throwable e) {
logUncaughtExceptions(e);
}
});
} else {
HTML spacer = new HTML();
editMain.add(spacer);
}
initWidget(editMain);
// Enable logging (important to do this after main is attached
// such that exceptions occurring before this can be handled by
// GWT's Default handler...)
if (LogLevel.showDebug()) {
DomLogger.enable(log.getElement());
lottaLogging();
}
KeyBindingRegistry keysRegistry = new KeyBindingRegistry();
extendKeyBindings(keysRegistry);
// Start editing
editor1.init(testEditorRegistries, keysRegistry, EditorSettings.DEFAULT);
editor2.init(testEditorRegistries, keysRegistry, EditorSettings.DEFAULT);
editor1.addUpdateListener(new EditorUpdateListener() {
@Override
public void onUpdate(EditorUpdateEvent event) {
outputBothEditorStates();
}
});
editor1.setOutputSink(editor1Sink);
editor2.setOutputSink(editor2Sink);
clearEditors();
editor1.setEditing(true);
editor2.setEditing(false);
toggleEditCheck2.setValue(false);
toggleEditCheck1.setValue(true);
// Output initial state
outputBothEditorStates();
outputOperation(null);
} catch (RuntimeException r) {
// Do we need this at all?
UncaughtExceptionHandler handler = GWT.getUncaughtExceptionHandler();
if (handler != null) {
handler.onUncaughtException(r);
} else {
logger.error().log(r);
}
throw r;
}