本文整理汇总了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();
}
示例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);
}
示例3: getDatabase
import com.google.code.gwt.database.client.Database; //导入依赖的package包/类
public Database getDatabase() {return null;}