import com.google.gwt.sample.dynatablerf.client.widgets.FavoritesWidget; //导入依赖的package包/类
/**
* 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()));
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. 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.");
}
}