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

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

Introduction

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

Prototype

public final native Text getTitle() ;

Source Link

Document

Returns the title.

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.
*///ww w .  j  a v a2 s  . c om
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()));
    }
}