当前位置: 首页>>代码示例>>Java>>正文


Java UncaughtExceptionHandler类代码示例

本文整理汇总了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();
//      }

//    });
  }
 
开发者ID:fredsa,项目名称:forplay,代码行数:27,代码来源:FlashGame.java

示例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();
    }

  });
}
 
开发者ID:fredsa,项目名称:forplay,代码行数:21,代码来源:HtmlGame.java

示例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();
}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:22,代码来源:QAFEMGwtEntryPoint.java

示例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);
	}
 
开发者ID:Antokolos,项目名称:iambookmaster,代码行数:22,代码来源:IPhoneViewerBook.java

示例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();
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:16,代码来源:Client.java

示例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);
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:19,代码来源:AbstractWorker.java

示例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);
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:19,代码来源:MessagePort.java

示例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();
    }
}
 
开发者ID:ahome-it,项目名称:ahome-touch,代码行数:9,代码来源:InitHandler.java

示例9: fireOnEventAndCatch

import com.google.gwt.core.client.GWT.UncaughtExceptionHandler; //导入依赖的package包/类
private void fireOnEventAndCatch(UncaughtExceptionHandler handler) {
    try {
        onInit();
    } catch (Throwable e) {
        handler.onUncaughtException(e);
    }
}
 
开发者ID:ahome-it,项目名称:ahome-touch,代码行数:8,代码来源:InitHandler.java

示例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);
}
 
开发者ID:Antokolos,项目名称:iambookmaster,代码行数:14,代码来源:IPhoneIURQ.java

示例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);
}
 
开发者ID:Antokolos,项目名称:iambookmaster,代码行数:14,代码来源:IPhoneViewerOldBookSkin.java

示例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);
    }
}
 
开发者ID:paulvi,项目名称:touch4j,代码行数:9,代码来源:ActiveItemChangeHandler.java

示例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);
    }
}
 
开发者ID:paulvi,项目名称:touch4j,代码行数:9,代码来源:TopChangeHandler.java

示例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);
    }
}
 
开发者ID:paulvi,项目名称:touch4j,代码行数:9,代码来源:BeforeOrientationChangeHandler.java

示例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);
  }
}
 
开发者ID:WeTheInternet,项目名称:xapi,代码行数:12,代码来源:AsyncProxy.java


注:本文中的com.google.gwt.core.client.GWT.UncaughtExceptionHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。