Example usage for com.google.gwt.gadgets.client.osapi.people Person THUMBNAIL_URL

List of usage examples for com.google.gwt.gadgets.client.osapi.people Person THUMBNAIL_URL

Introduction

In this page you can find the example usage for com.google.gwt.gadgets.client.osapi.people Person THUMBNAIL_URL.

Prototype

String THUMBNAIL_URL

To view the source code for com.google.gwt.gadgets.client.osapi.people Person THUMBNAIL_URL.

Click Source Link

Document

Field identifier for person's photo thumbnail URL.

Usage

From source file:com.google.gwt.gadgets.sample.traveler.client.PersonBrowser.java

License:Apache License

private void showItems() {
    if (friends != null && friends.getStartIndex() <= start
            && friends.getStartIndex() + friends.getItemsPerPage() >= start + pageSize) {
        // No request needed - this is implemented mainly for smooth resizing
        showImpl();//  w  w w . j a v  a2 s.  c om
    } else {
        people.newGetOwnersFriendsRequestBuilder().setCount(pageSize).setStartIndex(start)
                .setFields(Person.THUMBNAIL_URL, Person.ID, Person.DISPLAY_NAME).build()
                .execute(new Callback<OsapiCollection<Person>>() {

                    public void onFail(OsapiError error) {
                        friends = null;
                        friendsGrid.clear(true);
                        friendsGrid.resize(1, 1);
                        friendsGrid.setText(0, 0, error.getMessage());
                    }

                    public void onSuccess(OsapiCollection<Person> collection) {
                        friends = collection;
                        total = friends.getTotalResults();
                        showImpl();
                    }
                });
    }
}