Example usage for com.google.gwt.gdata.client.gbase Attribute getValue

List of usage examples for com.google.gwt.gdata.client.gbase Attribute getValue

Introduction

In this page you can find the example usage for com.google.gwt.gdata.client.gbase Attribute getValue.

Prototype

public final native String getValue() ;

Source Link

Document

Returns the value.

Usage

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

License:Apache License

/**
* Displays a set of Google Base item attributes in a tabular 
* fashion with the help of a GWT FlexTable widget. The data fields 
* Name, Type and Value are displayed./*from   ww w . ja v a 2  s .co  m*/
* 
* @param entries The Google Base item attributes to display.
*/
private void showData(MapAttribute attributes) {
    mainPanel.clear();
    String[] labels = new String[] { "Name", "Type", "Value" };
    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");
    }
    String[] attributeNames = attributes.keys();
    for (int i = 0; i < attributeNames.length; i++) {
        String attributeName = attributeNames[i];
        Attribute attribute = attributes.get(attributeName)[0];
        int row = mainPanel.insertRow(i + 1);
        mainPanel.addCell(row);
        mainPanel.setWidget(row, 0, new Label(attributeName));
        mainPanel.addCell(row);
        mainPanel.setWidget(row, 1, new Label(attribute.getType()));
        mainPanel.addCell(row);
        mainPanel.setWidget(row, 2, new Label(attribute.getValue()));
    }
}