List of usage examples for com.google.gwt.core.client JavaScriptObject createObject
public static native JavaScriptObject createObject() ;
From source file:com.google.mobile.trippy.web.client.db.LocalDbManager.java
License:Apache License
public void updateTripItem(final TripItem tripItem) { JsoTripItem jsoTripItem = (JsoTripItem) JavaScriptObject.createObject(); jsoTripItem.setTripItem(tripItem);/* w w w .j a v a2s . co m*/ final String tripItemKey = KEY_LOCAL_STORE_TI_PREFIX + tripItem.getKey(); LocalDbService.makePersistent(tripItemKey, new JSONObject(jsoTripItem).toString()); eventBus.fireEvent(new TripItemUpdatedEvent(tripItem)); final Trip trip = getTrip(tripItem.getTripId()); final String tripItemStartDate = "Day " + tripItem.getStartDay(); final String latlng = tripItem.getLatitude() + "," + tripItem.getLongitude(); utils.addTripItem(tripItemStartDate, tripItem.getTripId(), tripItem.getKey(), tripItem.getName(), tripItem.getAddress() + ", " + trip.getLocation(), latlng, utils.getTripItemPosition(tripItem.getTripId(), tripItem.getKey(), tripItem.getStartDay())); }
From source file:com.google.mobile.trippy.web.client.db.LocalDbManager.java
License:Apache License
public void addComment(final Comment comment) { final JsoComment jsoComment = (JsoComment) JavaScriptObject.createObject(); jsoComment.setComment(comment);//from w ww. j a v a 2s. c o m final String commentKey = KEY_LOCAL_STORE_COMMENT_PREFIX + comment.getKey(); LocalDbService.makePersistent(commentKey, new JSONObject(jsoComment).toString()); final JsArrayString commentKeys = getIndexKeys( KEY_LOCAL_STORE_COMMENTS_PREFIX + comment.getTripId() + "_" + comment.getTripItemId()); for (int i = 0; i < commentKeys.length(); ++i) { if (commentKeys.get(i).equals(commentKey)) { return; } } commentKeys.push(commentKey); setIndexKeys(KEY_LOCAL_STORE_COMMENTS_PREFIX + comment.getTripId() + "_" + comment.getTripItemId(), commentKeys); eventBus.fireEvent(new CommentAddedEvent(comment)); }
From source file:com.google.speedtracer.client.model.WhitelistEntry.java
License:Apache License
public static WhitelistEntry create(String host, String port) { WhitelistEntry entry = JavaScriptObject.createObject().cast(); return entry.setHost(host).setPort(port); }
From source file:com.google.web.bindery.autobean.gwt.client.impl.JsniCreatorMap.java
License:Apache License
public static JsniCreatorMap createMap() { return JavaScriptObject.createObject().cast(); }
From source file:com.googlecode.gflot.client.Axes.java
License:Open Source License
/** * Creates a {@link Axes} * * @return a {@link Axes} */ public static Axes create() { return JavaScriptObject.createObject().cast(); }
From source file:com.googlecode.gflot.client.Axis.java
License:Open Source License
/** * Creates a {@link Axis} * * @return a {@link Axis} */ public static Axis create() { return JavaScriptObject.createObject().cast(); }
From source file:com.googlecode.gflot.client.event.PlotItem.java
License:Open Source License
public static final PlotItem create() { return JavaScriptObject.createObject().cast(); }
From source file:com.googlecode.gflot.client.event.PlotPosition.java
License:Open Source License
public static final PlotPosition create() { return JavaScriptObject.createObject().cast(); }
From source file:com.googlecode.gflot.client.LevelInfo.java
License:Open Source License
/** * Creates a {@link LevelInfo} * * @return a {@link LevelInfo} */ public static LevelInfo create() { return JavaScriptObject.createObject().cast(); }
From source file:com.googlecode.gflot.client.options.AxisOptions.java
License:Open Source License
/** * Creates a {@link AxisOptions} */ public static final AxisOptions create() { return JavaScriptObject.createObject().cast(); }