Example usage for com.google.gwt.gdata.client.analytics AccountEntry getPropertyValue

List of usage examples for com.google.gwt.gdata.client.analytics AccountEntry getPropertyValue

Introduction

In this page you can find the example usage for com.google.gwt.gdata.client.analytics AccountEntry getPropertyValue.

Prototype

public final native String getPropertyValue(String name) ;

Source Link

Document

Gets the value of the named account property.

Usage

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

License:Apache License

/**
* Displays a set of Analytics data entries in a tabular fashion with
* the help of a GWT FlexTable widget. The data fields Account Name,
* Profile Name, Profile Id and Table Id are displayed.
* 
* @param entries The Analytics data entries to display.
*///from w w w.  j a  va2s .c  o m
private void showData(AccountEntry[] entries) {
    mainPanel.clear();
    String[] labels = new String[] { "Account Name", "Profile Name", "Profile Id", "Table Id" };
    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++) {
        AccountEntry entry = entries[i];
        int row = mainPanel.insertRow(i + 1);
        mainPanel.addCell(row);
        mainPanel.setWidget(row, 0, new Label(entry.getPropertyValue("ga:AccountName")));
        mainPanel.addCell(row);
        mainPanel.setWidget(row, 1, new Label(entry.getTitle().getText()));
        mainPanel.addCell(row);
        mainPanel.setWidget(row, 2, new Label(entry.getPropertyValue("ga:ProfileId")));
        mainPanel.addCell(row);
        mainPanel.setWidget(row, 3, new Label(entry.getTableId().getValue()));
    }
}