Example usage for com.google.gwt.gdata.client.maps FeatureEntry getPostalAddress

List of usage examples for com.google.gwt.gdata.client.maps FeatureEntry getPostalAddress

Introduction

In this page you can find the example usage for com.google.gwt.gdata.client.maps FeatureEntry getPostalAddress.

Prototype

public final native PostalAddress getPostalAddress() ;

Source Link

Document

Returns the postal address.

Usage

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

License:Apache License

/**
* Displays a set of Google Maps feature entries in a tabular 
* fashion with the help of a GWT FlexTable widget. The data fields 
* Title and Address are displayed./*from  w  w  w .ja v a2s .com*/
* 
* @param entries The Google Maps feature entries to display.
*/
private void showData(FeatureEntry[] entries) {
    mainPanel.clear();
    String[] labels = new String[] { "Title", "Address" };
    mainPanel.insertRow(0);
    for (int i = 0; i < labels.length; i++) {
        mainPanel.addCell(0);
        mainPanel.setWidget(0, i, new Label(labels[i]));
        mainPanel.getFlexCellFormatter().setStyleName(0, i, "hm-tableheader");
    }
    for (int i = 0; i < entries.length; i++) {
        FeatureEntry entry = entries[i];
        int row = mainPanel.insertRow(i + 1);
        mainPanel.addCell(row);
        mainPanel.setWidget(row, 0, new Label(entry.getTitle().getText()));
        mainPanel.addCell(row);
        String address = "";
        if (entry.getPostalAddress() != null) {
            address = entry.getPostalAddress().getValue();
        }
        mainPanel.setWidget(row, 1, new Label(address));
    }
}