本文整理汇总了Java中com.google.gwt.core.client.GWT.UncaughtExceptionHandler类的典型用法代码示例。如果您正苦于以下问题:Java UncaughtExceptionHandler类的具体用法?Java UncaughtExceptionHandler怎么用?Java UncaughtExceptionHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UncaughtExceptionHandler类属于com.google.gwt.core.client.GWT包,在下文中一共展示了UncaughtExceptionHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onModuleLoad
import com.google.gwt.core.client.GWT.UncaughtExceptionHandler; //导入依赖的package包/类
@Override
public final void onModuleLoad() {
GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
@Override
public void onUncaughtException(Throwable e) {
// TODO Auto-generated method stub
String msg = e.toString();
for (StackTraceElement elt : e.getStackTrace()) {
msg += "\n in " + elt.getMethodName() + "("+elt.getFileName()+":"+elt.getLineNumber()+")";
}
alert(msg);
}
});
// Need to do everything else in a deferred command, so that
// The uncaut exception handler has taken effect
// Scheduler.get().scheduleDeferred(new ScheduledCommand() {
// @Override
// public void execute() {
start();
// }
// });
}
示例2: onModuleLoad
import com.google.gwt.core.client.GWT.UncaughtExceptionHandler; //导入依赖的package包/类
@Override
public final void onModuleLoad() {
GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
@Override
public void onUncaughtException(Throwable e) {
ForPlay.log().error("Uncaught Exception: ", e);
}
});
// Need to do everything else in a deferred command, so that
// the uncaught exception handler has taken effect
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
start();
}
});
}
示例3: onModuleLoad
import com.google.gwt.core.client.GWT.UncaughtExceptionHandler; //导入依赖的package包/类
@Override
public void onModuleLoad() {
GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
@Override
public void onUncaughtException(Throwable e) {
Window.alert("uncaught: " + e.getMessage());
String s = buildStackTrace(e, "RuntimeException:\n");
Window.alert(s);
e.printStackTrace();
}
});
new Timer() {
@Override
public void run() {
initialize();
}
}.schedule(1);
alertSomeStuff();
}
示例4: load
import com.google.gwt.core.client.GWT.UncaughtExceptionHandler; //导入依赖的package包/类
public void load() {
RootPanel rootPanel = RootPanel.get();
rootPanel.setSize("100%", "100%");
// IPhoneTouchListener phoneTouchListener = new IPhoneTouchListener() {
// @Override
// public boolean event(JavaScriptObject source, String name, int[] x, int[] y, JavaScriptObject target) {
// return superEvent(source, name, x, y, target);
// }
// };
// phoneTouchListener.addListener(rootPanel.getElement(),IPhoneTouchListener.TOUCHSTART,false);
// phoneTouchListener.addListener(rootPanel.getElement(),IPhoneTouchListener.TOUCHMOVE,false);
if (GWT.isScript()) {
GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler(){
public void onUncaughtException(Throwable e) {
IPhoneConsole.showError(e);
}
});
}
load(true);
rootPanel.add(layout);
}
示例5: onModuleLoad
import com.google.gwt.core.client.GWT.UncaughtExceptionHandler; //导入依赖的package包/类
public void onModuleLoad() {
GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
@Override
public void onUncaughtException(Throwable e) {
Throwable u = ToolBox.unwrap(e);
sLogger.log(Level.WARNING, MESSAGES.failedUncaughtException(u.getMessage()), u);
}
});
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
onModuleLoadDeferred();
}
});
}
示例6: onErrorImpl
import com.google.gwt.core.client.GWT.UncaughtExceptionHandler; //导入依赖的package包/类
/**
* Takes care of reporting exceptions to the console in hosted mode.
*
* @param listener the listener object to call back.
* @param port argument from the callback.
*/
private static void onErrorImpl(ErrorHandler errorHandler, ErrorEvent event) {
UncaughtExceptionHandler ueh = GWT.getUncaughtExceptionHandler();
if (ueh != null) {
try {
errorHandler.onError(event);
} catch (Exception ex) {
ueh.onUncaughtException(ex);
}
} else {
errorHandler.onError(event);
}
}
示例7: onMessageImpl
import com.google.gwt.core.client.GWT.UncaughtExceptionHandler; //导入依赖的package包/类
/**
* Takes care of reporting exceptions to the console in hosted mode.
*
* @param listener the listener object to call back.
* @param port argument from the callback.
*/
private static void onMessageImpl(MessageHandler messageHandler, MessageEvent event) {
UncaughtExceptionHandler ueh = GWT.getUncaughtExceptionHandler();
if (ueh != null) {
try {
messageHandler.onMessage(event);
} catch (Exception ex) {
ueh.onUncaughtException(ex);
}
} else {
messageHandler.onMessage(event);
}
}
示例8: fireOnEvent
import com.google.gwt.core.client.GWT.UncaughtExceptionHandler; //导入依赖的package包/类
private final void fireOnEvent() {
UncaughtExceptionHandler handler = GWT.getUncaughtExceptionHandler();
if (handler != null) {
fireOnEventAndCatch(handler);
} else {
onInit();
}
}
示例9: fireOnEventAndCatch
import com.google.gwt.core.client.GWT.UncaughtExceptionHandler; //导入依赖的package包/类
private void fireOnEventAndCatch(UncaughtExceptionHandler handler) {
try {
onInit();
} catch (Throwable e) {
handler.onUncaughtException(e);
}
}
示例10: onModuleLoad
import com.google.gwt.core.client.GWT.UncaughtExceptionHandler; //导入依赖的package包/类
public void onModuleLoad() {
RootPanel rootPanel = RootPanel.get();
rootPanel.setSize("100%", "100%");
if (GWT.isScript()) {
GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler(){
public void onUncaughtException(Throwable e) {
IPhoneConsole.showError(e);
}
});
}
load(true);
rootPanel.add(layout);
}
示例11: load
import com.google.gwt.core.client.GWT.UncaughtExceptionHandler; //导入依赖的package包/类
public void load() {
RootPanel rootPanel = RootPanel.get();
rootPanel.setSize("100%", "100%");
if (GWT.isScript()) {
GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler(){
public void onUncaughtException(Throwable e) {
IPhoneConsole.showError(e);
}
});
}
load(true);
rootPanel.add(layout);
}
示例12: fireOnEventAndCatch
import com.google.gwt.core.client.GWT.UncaughtExceptionHandler; //导入依赖的package包/类
private void fireOnEventAndCatch(Container container, Container value, Container oldValue, Object eOpts,
UncaughtExceptionHandler handler) {
try {
onActiveItemChange(container, value, oldValue, eOpts);
} catch (Throwable e) {
handler.onUncaughtException(e);
}
}
示例13: fireOnEvent
import com.google.gwt.core.client.GWT.UncaughtExceptionHandler; //导入依赖的package包/类
private final void fireOnEvent(Component component, Object existingValue, Object newValue, Object eOpts) {
UncaughtExceptionHandler handler = GWT.getUncaughtExceptionHandler();
if (handler != null) {
fireOnEventAndCatch(component, existingValue, newValue, eOpts, handler);
} else {
onTopChange(component, existingValue, newValue, eOpts);
}
}
示例14: fireOnEvent
import com.google.gwt.core.client.GWT.UncaughtExceptionHandler; //导入依赖的package包/类
private final void fireOnEvent(Panel panel, String orientation, double width, double height) {
UncaughtExceptionHandler handler = GWT.getUncaughtExceptionHandler();
if (handler != null) {
fireOnEventAndCatch(panel, orientation, width, height, handler);
} else {
onBeforeOrientationChange(panel, orientation, width, height);
}
}
示例15: onFailure
import com.google.gwt.core.client.GWT.UncaughtExceptionHandler; //导入依赖的package包/类
public final void onFailure(Throwable reason) {
reason.printStackTrace();
GWT.log("Run async failure", reason);
if (tries-->0){
dispatch();
}else{
UncaughtExceptionHandler handler = GWT.getUncaughtExceptionHandler();
if (handler != null)
handler.onUncaughtException(reason);
}
}