Example usage for com.google.gwt.gdata.client.maps MapEntry updateEntry

List of usage examples for com.google.gwt.gdata.client.maps MapEntry updateEntry

Introduction

In this page you can find the example usage for com.google.gwt.gdata.client.maps MapEntry updateEntry.

Prototype

public final native void updateEntry(Callback<E> callback) ;

Source Link

Document

Updates the entry in the feed by sending the representation of this entry.

Usage

From source file:com.google.gwt.gdata.sample.hellogdata.client.MapsUpdateMapDemo.java

License:Apache License

/**
 * Update a map by making use of the updateEntry
 * method of the Entry class.//from  ww  w. j a  va 2  s .c om
 * Set the map's title to an arbitrary string. Here
 * we prefix the title with 'GWT-Maps-Client' so that
 * we can identify which maps were updated by this demo.
 * On success and failure, display a status message.
 * 
 * @param targetMap The map entry which to update
 */
private void updateMap(MapEntry targetMap) {
    showStatus("Updating map...", false);
    targetMap.setTitle(Text.newInstance());
    targetMap.getTitle().setText("GWT-Maps-Client - updated map");
    targetMap.updateEntry(new MapEntryCallback() {
        public void onFailure(CallErrorException caught) {
            showStatus("An error occurred while updating a map: " + caught.getMessage(), true);
        }

        public void onSuccess(MapEntry result) {
            showStatus("Updated a map.", false);
        }
    });
}