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

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

Introduction

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

Prototype

public final native String getThumbnailUrl() ;

Source Link

Document

Returns person's photo thumbnail URL, specified as a string.

Usage

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

License:Apache License

private Panel createPersonPanel(final Person p) {
    VerticalPanel panel = new VerticalPanel();
    panel.setPixelSize(cellSize, cellSize);
    panel.setStylePrimaryName("friend-cell");
    panel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

    String imgUrl = p.getThumbnailUrl();
    panel.add(new Image(imgUrl == null ? noPhotoUrl : imgUrl));
    panel.add(new Label(p.getDisplayName()));

    FocusPanel fPanel = new FocusPanel(panel);
    if (clickHandler != null) {
        fPanel.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                clickHandler.handle(p.getId());
            }//from  w w  w  .j  a va 2  s .co m
        });
    }
    return fPanel;
}