Example usage for com.google.gwt.gdata.client.gbase ItemsEntry getHtmlLink

List of usage examples for com.google.gwt.gdata.client.gbase ItemsEntry getHtmlLink

Introduction

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

Prototype

public final native com.google.gwt.gdata.client.atom.Link getHtmlLink() ;

Source Link

Document

Returns the link that provides the URI of an alternate format of the entry's or feed's contents.

Usage

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

License:Apache License

/**
* Displays a set of Google Base item entries in a tabular 
* fashion with the help of a GWT FlexTable widget. The data fields 
* Title, URL and Published are displayed.
* 
* @param entries The Google Base item entries to display.
*//*from w  ww . j a  v  a 2s. co  m*/
private void showData(ItemsEntry[] entries) {
    mainPanel.clear();
    String[] labels = new String[] { "Title", "URL", "Published" };
    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++) {
        ItemsEntry entry = entries[i];
        int row = mainPanel.insertRow(i + 1);
        mainPanel.addCell(row);
        mainPanel.setWidget(row, 0, new Label(entry.getTitle().getText()));
        mainPanel.addCell(row);
        if (entry.getHtmlLink() == null) {
            mainPanel.setWidget(row, 1, new Label("Not available"));
        } else {
            String link = entry.getHtmlLink().getHref();
            mainPanel.setWidget(row, 1,
                    new HTML("<a href=\"" + link + "\" target=\"_blank\">" + link + "</a>"));
            mainPanel.addCell(row);
            mainPanel.setWidget(row, 2, new Label(entry.getPublished().getValue().getDate().toString()));
        }
    }
}