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

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

Introduction

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

Prototype

public final native String getType() ;

Source Link

Document

Returns the type of the attribute.

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