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

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

Introduction

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

Prototype

public final native String getDisplayName() ;

Source Link

Document

Returns the name of this Person, suitable for display to end-users.

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  av  a 2 s.c o  m
        });
    }
    return fPanel;
}