本文整理汇总了Java中com.google.code.gwt.database.client.service.DataServiceException类的典型用法代码示例。如果您正苦于以下问题:Java DataServiceException类的具体用法?Java DataServiceException怎么用?Java DataServiceException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DataServiceException类属于com.google.code.gwt.database.client.service包,在下文中一共展示了DataServiceException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadLastState
import com.google.code.gwt.database.client.service.DataServiceException; //导入依赖的package包/类
@Override
public void loadLastState(Model model, final ScalarCallback<String> callback) {
if (basePath==null) {
basePath = fileExchange.selectFolder("Выберите папку с квестами","Выбрать");
if (basePath==null) {
callback.onFailure(new DataServiceException("Отменено"));
return;
}
}
String state = fileExchange.loadFileByPath(basePath+STATE_FILE);
if (state == null) {
callback.onSuccess(null);
} else {
callback.onSuccess(state);
}
}
示例2: onStarButtonPressed
import com.google.code.gwt.database.client.service.DataServiceException; //导入依赖的package包/类
@Override
public void onStarButtonPressed() {
if (isStarred) {
travelTimesItems.get(0).setIsStarred(0);
isStarred = false;
} else {
travelTimesItems.get(0).setIsStarred(1);
isStarred = true;
}
dbService.updateStarredTravelTimes(travelTimesItems, new VoidCallback() {
@Override
public void onFailure(DataServiceException error) {
}
@Override
public void onSuccess() {
view.toggleStarButton(isStarred);
}
});
}
示例3: onLocationRemove
import com.google.code.gwt.database.client.service.DataServiceException; //导入依赖的package包/类
@Override
public void onLocationRemove(final int index) {
LocationItem item = locationItems.get(index);
dbService.removeLocation(item, new VoidCallback() {
@Override
public void onFailure(DataServiceException error) {}
@Override
public void onSuccess(){
// update view
locationItems.remove(index);
if (locationItems.size() == 0){
// TODO: Better way of displaying empty favorites when Location is only item
createFavoritesList();
}
view.renderLocations(locationItems);
}
});
}
示例4: onStarButtonPressed
import com.google.code.gwt.database.client.service.DataServiceException; //导入依赖的package包/类
@Override
public void onStarButtonPressed() {
if (isStarred) {
cameraItems.get(0).setIsStarred(0);
isStarred = false;
} else {
cameraItems.get(0).setIsStarred(1);
isStarred = true;
}
dbService.updateStarredCameras(cameraItems, new VoidCallback() {
@Override
public void onFailure(DataServiceException error) {
}
@Override
public void onSuccess() {
view.toggleStarButton(isStarred);
}
});
}
示例5: onStarButtonPressed
import com.google.code.gwt.database.client.service.DataServiceException; //导入依赖的package包/类
@Override
public void onStarButtonPressed() {
if (isStarred) {
ferriesRouteItems.get(0).setIsStarred(0);
isStarred = false;
} else {
ferriesRouteItems.get(0).setIsStarred(1);
isStarred = true;
}
dbService.updateStarredFerriesSchedules(ferriesRouteItems, new VoidCallback() {
@Override
public void onFailure(DataServiceException error) {
}
@Override
public void onSuccess() {
view.toggleStarButton(isStarred);
}
});
}
示例6: onStarButtonPressed
import com.google.code.gwt.database.client.service.DataServiceException; //导入依赖的package包/类
@Override
public void onStarButtonPressed() {
if (isStarred) {
mountainPassItems.get(0).setIsStarred(0);
isStarred = false;
} else {
mountainPassItems.get(0).setIsStarred(1);
isStarred = true;
}
dbService.updateStarredMountainPasses(mountainPassItems, new VoidCallback() {
@Override
public void onFailure(DataServiceException error) {
}
@Override
public void onSuccess() {
view.toggleStarButton(isStarred);
}
});
}
示例7: initCachesTable
import com.google.code.gwt.database.client.service.DataServiceException; //导入依赖的package包/类
private void initCachesTable(ClientFactory clientFactory) {
List<CacheItem> cacheItems = new ArrayList<CacheItem>();
cacheItems.add(new CacheItem("cameras", 0));
cacheItems.add(new CacheItem("highway_alerts", 0));
cacheItems.add(new CacheItem("mountain_passes", 0));
cacheItems.add(new CacheItem("travel_times", 0));
cacheItems.add(new CacheItem("ferries_schedules", 0));
cacheItems.add(new CacheItem("ferries_terminal_sailing_space", 0));
cacheItems.add(new CacheItem("border_wait", 0));
clientFactory.getDbService().initCachesTable(cacheItems, new RowIdListCallback() {
@Override
public void onFailure(DataServiceException error) {
}
@Override
public void onSuccess(List<Integer> rowIds) {
}
});
}
示例8: resetCachesTable
import com.google.code.gwt.database.client.service.DataServiceException; //导入依赖的package包/类
private void resetCachesTable(ClientFactory clientFactory) {
List<CacheItem> cacheItems = new ArrayList<CacheItem>();
cacheItems.add(new CacheItem("cameras", 0));
cacheItems.add(new CacheItem("highway_alerts", 0));
cacheItems.add(new CacheItem("mountain_passes", 0));
cacheItems.add(new CacheItem("travel_times", 0));
cacheItems.add(new CacheItem("ferries_schedules", 0));
cacheItems.add(new CacheItem("ferries_terminal_sailing_space", 0));
cacheItems.add(new CacheItem("border_wait", 0));
clientFactory.getDbService().updateCachesTable(cacheItems, new VoidCallback() {
@Override
public void onFailure(DataServiceException error) {
}
@Override
public void onSuccess() {
}
});
}
示例9: playFile
import com.google.code.gwt.database.client.service.DataServiceException; //导入依赖的package包/类
private void playFile(final String name) {
dataService.loadSingleFile(name,new ScalarCallback<String>() {
public void onFailure(DataServiceException error) {
Window.alert("onFailure: "+error.getMessage());
}
public void onSuccess(String result) {
player.play(result,canvas,true,name,null);
}
});
}
示例10: saveState
import com.google.code.gwt.database.client.service.DataServiceException; //导入依赖的package包/类
private void saveState(String location) {
stateSaved=true;
String nextFileName;
if (nextFileCounter>0) {
nextFileName = "_"+nextFileCounter+".sav";
} else {
nextFileName = ".sav";
}
int i = fileName.lastIndexOf('.');
if (i>0) {
nextFileName = fileName.substring(0,i)+nextFileName;
} else {
nextFileName = fileName+nextFileName;
}
i = fileName.lastIndexOf('/');
if (i<0) {
i = fileName.lastIndexOf('\\');
}
final String name = i>0 ? nextFileName.substring(i+1) : nextFileName;
dataService.storeState(storeGameState(location),nextFileName,new VoidCallback() {
public void onFailure(DataServiceException error) {
Window.alert("Ошибка сохранения "+error.getMessage());
}
public void onSuccess() {
nextFileCounter++;
Window.alert("Игра сохранена в "+name);
}
});
}
示例11: restore
import com.google.code.gwt.database.client.service.DataServiceException; //导入依赖的package包/类
/**
* This method is called from JavaScript
*/
private void restore(String status,boolean full,boolean cracked,boolean inAppAvailable){
linkedVersionPresent = full;
this.cracked = cracked;
this.inAppAvailable = inAppAvailable;
if (status==null || status.length()==0) {
callback.onFailure(new DataServiceException("No state"));
} else if (callback instanceof ScalarCallback) {
@SuppressWarnings("unchecked")
ScalarCallback<String> scalarCallback = (ScalarCallback<String>) callback;
scalarCallback.onSuccess(status);
}
}
示例12: sendError
import com.google.code.gwt.database.client.service.DataServiceException; //导入依赖的package包/类
private void sendError(Throwable e) {
e.printStackTrace();
if (callback==null) {
Window.alert("ERROR: "+e.getMessage());
} else {
callback.onFailure(new DataServiceException("ERROR: "+e.getMessage()));
}
}
示例13: selectAvailableFiles
import com.google.code.gwt.database.client.service.DataServiceException; //导入依赖的package包/类
@Override
public void selectAvailableFiles(String exention, final ListCallback<IPhoneFileBean> callback) {
if (basePath==null) {
basePath = fileExchange.selectFolder("Выберите папку с квестами","Выбрать");
if (basePath==null) {
callback.onFailure(new DataServiceException("Отменено"));
return;
}
}
String[] files = fileExchange.selectFilesByExtention(basePath,exention);
if (files != null) {
ArrayList<IPhoneFileBean> result = new ArrayList<IPhoneFileBean>(files.length);
for (String name : files) {
int i = name.lastIndexOf('/');
if (i<0) {
i = name.lastIndexOf('\\');
}
if (i>0) {
result.add(createFile(name.substring(i+1),name));
} else {
result.add(createFile(name,name));
}
}
callback.onSuccess(result);
} else {
callback.onFailure(new DataServiceException("Ошибка чтения папки "+basePath));
}
}
示例14: loadSingleFile
import com.google.code.gwt.database.client.service.DataServiceException; //导入依赖的package包/类
@Override
public void loadSingleFile(String name, ScalarCallback<String> callback) {
String data = fileExchange.loadFileByPath(name);
if (data==null) {
callback.onFailure(new DataServiceException("Canceled"));
} else {
callback.onSuccess(data);
}
}
示例15: storeState
import com.google.code.gwt.database.client.service.DataServiceException; //导入依赖的package包/类
@Override
public void storeState(String state, String fileName, VoidCallback callback) {
try {
fileExchange.writeFile(fileName,state);
callback.onSuccess();
} catch (IOException e) {
callback.onFailure(new DataServiceException(e.getMessage()));
}
}