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

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

Introduction

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

Prototype

public final native String getId() ;

Source Link

Document

Returns a string Id that can be permanently associated with this person.

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());
            }//  w w w .j a v a  2  s  .  c o  m
        });
    }
    return fPanel;
}