Example usage for com.google.gwt.gdata.client.calendar CalendarEventEntry updateEntry

List of usage examples for com.google.gwt.gdata.client.calendar CalendarEventEntry updateEntry

Introduction

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

License:Apache License

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

        public void onSuccess(EventEntry result) {
            showStatus("Updated a Calendar event.", false);
        }
    });
}