Example usage for com.google.gwt.gdata.client.gbase GmAttribute getName

List of usage examples for com.google.gwt.gdata.client.gbase GmAttribute getName

Introduction

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

Prototype

public final native String getName() ;

Source Link

Document

Returns the name.

Usage

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

License:Apache License

/**
* Displays a set of Google Base attribute entries in a tabular 
* fashion with the help of a GWT FlexTable widget. The data fields 
* Name, Type and Common Values are displayed.
* 
* @param entries The Google Base attribute entries to display.
*///from w  ww . j  ava2s .  co  m
private void showData(AttributesEntry[] attributes) {
    mainPanel.clear();
    String[] labels = new String[] { "Name", "Type", "Common Values" };
    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 < attributes.length; i++) {
        AttributesEntry attribute = attributes[i];
        GmAttribute attributeInfo = attribute.getAttribute();
        int row = mainPanel.insertRow(i + 1);
        mainPanel.addCell(row);
        mainPanel.setWidget(row, 0, new Label(attributeInfo.getName()));
        mainPanel.addCell(row);
        mainPanel.setWidget(row, 1, new Label(attributeInfo.getType()));
        mainPanel.addCell(row);
        String commonValues = "";
        for (GmValue value : attributeInfo.getValues()) {
            commonValues += value.getValue() + "\n";
        }
        mainPanel.setWidget(row, 2, new Label(commonValues));
    }
}