Example usage for com.google.gwt.gdata.client.contacts ContactGroupEntry updateEntry

List of usage examples for com.google.gwt.gdata.client.contacts ContactGroupEntry updateEntry

Introduction

In this page you can find the example usage for com.google.gwt.gdata.client.contacts ContactGroupEntry 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.ContactsUpdateContactGroupDemo.java

License:Apache License

/**
 * Update a contact group by making use of the updateEntry
 * method of the Entry class.//from  www.j  a v  a2  s.  c o  m
 * Set the group's title to an arbitrary string. Here
 * we prefix the title with 'GWT-Contacts-Client' so that
 * we can identify which groups were updated by this demo.
 * On success and failure, display a status message.
 * 
 * @param targetGroup The contact group entry which to update
 */
private void updateContactGroup(ContactGroupEntry targetGroup) {
    showStatus("Updating a contact group...", false);
    targetGroup.setTitle(Text.newInstance());
    targetGroup.getTitle().setText("GWT-Contacts-Client - updated group");
    targetGroup.updateEntry(new ContactGroupEntryCallback() {
        public void onFailure(CallErrorException caught) {
            showStatus("An error occurred while updating a contact group: " + caught.getMessage(), true);
        }

        public void onSuccess(ContactGroupEntry result) {
            showStatus("Updated a contact group.", false);
        }
    });
}