Java 类com.google.gwt.core.client.GWT.UncaughtExceptionHandler 实例源码

项目:forplay    文件:FlashGame.java   
@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();
//      }

//    });
  }
项目:forplay    文件:HtmlGame.java   
@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();
    }

  });
}
项目:qafe-platform    文件:QAFEMGwtEntryPoint.java   
@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();
}
项目:iambookmaster    文件:IPhoneViewerBook.java   
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);
    }
项目:unitimes    文件:Client.java   
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();
        }
    });
}
项目:che    文件:AbstractWorker.java   
/**
 * 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);
  }
}
项目:che    文件:MessagePort.java   
/**
 * 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);
  }
}
项目:che    文件:Worker.java   
/**
 * 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);
  }
}
项目:unitime    文件:Client.java   
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();
        }
    });
}
项目:ahome-touch    文件:InitHandler.java   
private final void fireOnEvent() {
    UncaughtExceptionHandler handler = GWT.getUncaughtExceptionHandler();
    if (handler != null) {
        fireOnEventAndCatch(handler);
    } else {
        onInit();
    }
}
项目:ahome-touch    文件:InitHandler.java   
private void fireOnEventAndCatch(UncaughtExceptionHandler handler) {
    try {
        onInit();
    } catch (Throwable e) {
        handler.onUncaughtException(e);
    }
}
项目:iambookmaster    文件:IPhoneIURQ.java   
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);
}
项目:iambookmaster    文件:IPhoneViewerOldBookSkin.java   
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);
}
项目:iambookmaster    文件:IPhoneViewerOldBookSkinCopy.java   
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);
}
项目:touch4j    文件:ActiveItemChangeHandler.java   
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);
    }
}
项目:touch4j    文件:TopChangeHandler.java   
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);
    }
}
项目:touch4j    文件:BeforeOrientationChangeHandler.java   
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);
    }
}
项目:xapi    文件:AsyncProxy.java   
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);
  }
}
项目:touch4j    文件:RenderChangeHandler.java   
private void fireOnEventAndCatch(Container container, Object item, boolean rendered, Object eOpts,
                UncaughtExceptionHandler handler) {
    try {
        onRenderChange(container, item, rendered, eOpts);
    } catch (Throwable e) {
        handler.onUncaughtException(e);
    }
}
项目:touch4j    文件:ActiveItemChangeHandler.java   
private final void fireOnEvent(Container container, Container value, Container oldValue, Object eOpts) {
    UncaughtExceptionHandler handler = GWT.getUncaughtExceptionHandler();
    if (handler != null) {
        fireOnEventAndCatch(container, value, oldValue, eOpts, handler);
    } else {
        onActiveItemChange(container, value, oldValue, eOpts);
    }
}
项目:touch4j    文件:ImageTapHandler.java   
private void fireOnEventAndCatch(Image image, EventObject eventObject, Object eOpts,
                UncaughtExceptionHandler handler) {
    try {
        onTap(image, eventObject, eOpts);
    } catch (Throwable e) {
        handler.onUncaughtException(e);
    }
}
项目:touch4j    文件:BeforeOrientationChangeHandler.java   
private void fireOnEventAndCatch(Panel panel, String orientation, double width, double height,
                UncaughtExceptionHandler handler) {
    try {
        onBeforeOrientationChange(panel, orientation, width, height);
    } catch (Throwable e) {
        handler.onUncaughtException(e);
    }
}
项目:swarm    文件:DynaTableRf.java   
/**
 * This method sets up the top-level services used by the application.
 */
public void onModuleLoad() {
  GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
    public void onUncaughtException(Throwable e) {
      log.log(Level.SEVERE, e.getMessage(), e);
    }
  });

  final DynaTableRequestFactory requests = GWT.create(DynaTableRequestFactory.class);
  requests.initialize(eventBus);

  // Add remote logging handler
  RequestFactoryLogHandler.LoggingRequestProvider provider = new RequestFactoryLogHandler.LoggingRequestProvider() {
    public LoggingRequest getLoggingRequest() {
      return requests.loggingRequest();
    }
  };
  Logger.getLogger("").addHandler(new ErrorDialog().getHandler());
  Logger.getLogger("").addHandler(
      new RequestFactoryLogHandler(provider, Level.WARNING,
          new ArrayList<String>()));
  FavoritesManager manager = new FavoritesManager(requests);
  PersonEditorWorkflow.register(eventBus, requests, manager);

  calendar = new SummaryWidget(eventBus, requests, 15);
  favorites = new FavoritesWidget(eventBus, requests, manager);
  filter = new DayFilterWidget(eventBus);

  RootLayoutPanel.get().add(
      GWT.<Binder> create(Binder.class).createAndBindUi(this));

  // Fast test to see if the sample is not being run from devmode
  if (GWT.getHostPageBaseURL().startsWith("file:")) {
    log.log(Level.SEVERE, "The DynaTableRf sample cannot be run without its"
        + " server component.  If you are running the sample from a"
        + " GWT distribution, use the 'ant devmode' target to launch"
        + " the DTRF server.");
  }
}
项目:touch4j    文件:ResizeHandler.java   
private final void fireOnEvent(Component component, Object eOpts) {
    UncaughtExceptionHandler handler = GWT.getUncaughtExceptionHandler();
    if (handler != null) {
        fireOnEventAndCatch(component, eOpts, handler);
    } else {
        onResize(component, eOpts);
    }
}
项目:touch4j    文件:SubmitFormHandler.java   
private final void fireOnEvent(FormPanel panel, Object result, EventObject event, Object eOpts) {
    UncaughtExceptionHandler handler = GWT.getUncaughtExceptionHandler();
    if (handler != null) {
        fireOnEventAndCatch(panel, result, event, eOpts, handler);
    } else {
        onSubmit(panel, result, event, eOpts);
    }
}
项目:touch4j    文件:TapHandler.java   
private void fireOnEventAndCatch(Button btn, EventObject event, UncaughtExceptionHandler handler) {
  try {
    onTap(btn, event);
  } catch (Throwable e) {
    handler.onUncaughtException(e);
  }
}
项目:touch4j    文件:BottomChangeHandler.java   
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 {
        onBottomChange(component, existingValue, newValue, eOpts);
    }
}
项目:touch4j    文件:BeforeSubmitFormHandler.java   
private void fireOnEventAndCatch(FormPanel panel, Object values, Object options, Object eOpts,
                UncaughtExceptionHandler handler) {
    try {
        onBeforeSubmit(panel, values, options, eOpts);
    } catch (Throwable e) {
        handler.onUncaughtException(e);
    }
}
项目:touch4j    文件:DeactivateHandler.java   
private final void fireOnEvent(Component comp) {
  UncaughtExceptionHandler handler = GWT.getUncaughtExceptionHandler();
  if (handler != null) {
    fireOnEventAndCatch(comp, handler);
  } else {
    onDeactive(comp);
  }
}
项目:touch4j    文件:CenteredChangeHandler.java   
private final void fireOnEvent(Component component, boolean existingValue, boolean newValue, Object eOpts) {
    UncaughtExceptionHandler handler = GWT.getUncaughtExceptionHandler();
    if (handler != null) {
        fireOnEventAndCatch(component, existingValue, newValue, eOpts, handler);
    } else {
        onCenteredChange(component, existingValue, newValue, eOpts);
    }
}
项目:touch4j    文件:RightChangeHandler.java   
private void fireOnEventAndCatch(Component component, Object existingValue, Object newValue, Object eOpts,
                UncaughtExceptionHandler handler) {
    try {
        onRightChange(component, existingValue, newValue, eOpts);
    } catch (Throwable e) {
        handler.onUncaughtException(e);
    }
}
项目:touch4j    文件:TopChangeHandler.java   
private void fireOnEventAndCatch(Component component, Object existingValue, Object newValue, Object eOpts,
                UncaughtExceptionHandler handler) {
    try {
        onTopChange(component, existingValue, newValue, eOpts);
    } catch (Throwable e) {
        handler.onUncaughtException(e);
    }
}
项目:touch4j    文件:DeactivateHandler.java   
private void fireOnEventAndCatch(Component comp, UncaughtExceptionHandler handler) {
  try {
    onDeactive(comp);
  } catch (Throwable e) {
    handler.onUncaughtException(e);
  }
}
项目:touch4j    文件:DataViewDoSelectHandler.java   
private void fireOnEventAndCatch(DataView dataView, BaseModel record, Boolean supressed, Object eOpts,
                UncaughtExceptionHandler handler) {
    try {
        onDoSelect(dataView, record, supressed, eOpts);
    } catch (Throwable e) {
        handler.onUncaughtException(e);
    }
}
项目:touch4j    文件:DataViewItemTouchStartHandler.java   
private final void fireOnEvent(DataView dataView, double index, Element element, EventObject eventObject,
                Object eOpts) {
    UncaughtExceptionHandler handler = GWT.getUncaughtExceptionHandler();
    if (handler != null) {
        fireOnEventAndCatch(dataView, index, element, eventObject, eOpts, handler);
    } else {
        onItemTouchStart(dataView, index, element, eventObject, eOpts);
    }
}
项目:touch4j    文件:DataViewItemTouchStartHandler.java   
private void fireOnEventAndCatch(DataView dataView, double index, Element element, EventObject eventObject,
                Object eOpts, UncaughtExceptionHandler handler) {
    try {
        onItemTouchStart(dataView, index, element, eventObject, eOpts);
    } catch (Throwable e) {
        handler.onUncaughtException(e);
    }
}
项目:touch4j    文件:DataViewRefreshHandler.java   
private final void fireOnEvent(DataView dataView, Object eOpts) {
    UncaughtExceptionHandler handler = GWT.getUncaughtExceptionHandler();
    if (handler != null) {
        fireOnEventAndCatch(dataView, eOpts, handler);
    } else {
        onRefresh(dataView, eOpts);
    }
}
项目:touch4j    文件:DataViewRefreshHandler.java   
private void fireOnEventAndCatch(DataView dataView, Object eOpts, UncaughtExceptionHandler handler) {
    try {
        onRefresh(dataView, eOpts);
    } catch (Throwable e) {
        handler.onUncaughtException(e);
    }
}
项目:touch4j    文件:RenderHandler.java   
private final void fireOnEvent(Component comp) {
  UncaughtExceptionHandler handler = GWT.getUncaughtExceptionHandler();
  if (handler != null) {
    fireOnEventAndCatch(comp, handler);
  } else {
    onRender(comp);
  }
}
项目:touch4j    文件:DataViewSelectHandler.java   
private void fireOnEventAndCatch(DataView dataView, BaseModel record, Object eOpts, UncaughtExceptionHandler handler) {
    try {
        onSelect(dataView, record, eOpts);
    } catch (Throwable e) {
        handler.onUncaughtException(e);
    }
}