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


Java Database类代码示例

本文整理汇总了Java中com.google.code.gwt.database.client.Database的典型用法代码示例。如果您正苦于以下问题:Java Database类的具体用法?Java Database怎么用?Java Database使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Database类属于com.google.code.gwt.database.client包,在下文中一共展示了Database类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildDisplay

import com.google.code.gwt.database.client.Database; //导入依赖的package包/类
private void buildDisplay(final ClientFactory clientFactory, final PhoneGap phoneGap) {
  	ViewPort viewPort = new MGWTSettings.ViewPort();
      viewPort.setUserScaleAble(false).setInitialScale(1.0).setMinimumScale(1.0).setMaximumScale(1.0);
  	Storage localStorage;
  	Place defaultPlace;

      MGWTSettings settings = new MGWTSettings();
      settings.setViewPort(viewPort);
      settings.setIconUrl("logo.png");
      settings.setFullscreen(true);
      settings.setFixIOS71BodyBug(true);
      settings.setPreventScrolling(true);

      MGWT.applySettings(settings);
      
      createLocalStorageDefaults();
      
// Create initial database tables if supported.
      if (Database.isSupported()) {
      	createDatabaseTables(clientFactory);
      } else {
      	GWT.log("WebSQL database not supported.");
      }

phoneGap.getEvent().getBackButton()
		.addBackButtonPressedHandler(new BackButtonPressedHandler() {

			@Override
			public void onBackButtonPressed(BackButtonPressedEvent event) {
				Place place = clientFactory.getPlaceController().getWhere();
				if (place instanceof SeattlePlace || place instanceof TacomaPlace) {
					phoneGap.exitApp();
				} else {
					History.back();
				}
			}
		});
      
      // Start PlaceHistoryHandler with our PlaceHistoryMapper
      AppPlaceHistoryMapper historyMapper = GWT.create(AppPlaceHistoryMapper.class);
      
      createPhoneDisplay(clientFactory);
      
  	localStorage = Storage.getLocalStorageIfSupported();
  	String currentMap = localStorage.getItem("KEY_CURRENT_MAP");
  	
  	if (currentMap.equalsIgnoreCase("seattle")) {
  		defaultPlace = new SeattlePlace(); 
  	} else {
  		defaultPlace = new TacomaPlace();
  	}

      AppHistoryObserver historyObserver = new AppHistoryObserver();
      MGWTPlaceHistoryHandler historyHandler = new MGWTPlaceHistoryHandler(historyMapper, historyObserver);
      historyHandler.register(clientFactory.getPlaceController(), clientFactory.getEventBus(), defaultPlace);
      historyHandler.handleCurrentHistory();
  }
 
开发者ID:waynedyck,项目名称:mgwt-traffic-flow,代码行数:58,代码来源:AppEntryPoint.java

示例2: onModuleLoad

import com.google.code.gwt.database.client.Database; //导入依赖的package包/类
@Override
public void onModuleLoad() {
    
	if (!Database.isSupported()) {
		Window.alert("HTML 5 Database is NOT supported in this browser!");

		return;
	}

	GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {

		@Override
		public void onUncaughtException(Throwable e) {
			// TODO put in my own meaninful handler
			Window.alert("uncaught: " + e.getMessage());
			e.printStackTrace();

		}
	});

	new Timer() {
		
		@Override
		public void run() {
			loadMapApi();

		}
		
	}.schedule(1);

}
 
开发者ID:WSDOT,项目名称:wsdot-mobile-app,代码行数:32,代码来源:MobileAppEntryPoint.java

示例3: getDatabase

import com.google.code.gwt.database.client.Database; //导入依赖的package包/类
public Database getDatabase() {return null;} 
开发者ID:Antokolos,项目名称:iambookmaster,代码行数:2,代码来源:IPhoneDBDataService.java


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