Example usage for com.google.gwt.gdata.client Email setRel

List of usage examples for com.google.gwt.gdata.client Email setRel

Introduction

In this page you can find the example usage for com.google.gwt.gdata.client Email setRel.

Prototype

public final native void setRel(String rel) ;

Source Link

Document

Sets the email type.

Usage

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

License:Apache License

/**
 * Create a contact by inserting a contact entry into
 * a contacts feed./*from   w ww .  j  ava  2s . co m*/
 * Set the contact's title and contents to an arbitrary string. Here
 * we prefix the title with 'GWT-Contacts-Client' so that
 * we can identify which contacts were created by this demo.
 * On success and failure, display a status message.
 * 
 * @param contactFeedUri The uri of the contact feed into which to
 * insert the new contact entry
 */
private void createContact(String contactFeedUri) {
    showStatus("Creating contact...", false);
    ContactEntry entry = ContactEntry.newInstance();
    entry.setTitle(Text.newInstance());
    entry.getTitle().setText("GWT-Contacts-Client - Create Contact");
    entry.setContent(Text.newInstance());
    entry.getContent().setText("content info here");
    Email email = Email.newInstance();
    email.setAddress("GWT-Contacts-Client@domain.com");
    email.setPrimary(true);
    email.setRel(Email.REL_HOME);
    entry.setEmailAddresses(new Email[] { email });
    service.insertEntry(contactFeedUri, entry, new ContactEntryCallback() {
        public void onFailure(CallErrorException caught) {
            showStatus("An error occurred while creating a contact: " + caught.getMessage(), true);
        }

        public void onSuccess(ContactEntry result) {
            showStatus("Created a contact.", false);
        }
    });
}