List of usage examples for com.google.gwt.gdata.client.blogger PostEntry getPublished
public final native Published getPublished() ;
From source file:com.google.gwt.gdata.sample.hellogdata.client.BloggerQueryBlogPostsDemo.java
License:Apache License
/** * Displays a set of Blogger post entries in a tabular fashion with * the help of a GWT FlexTable widget. The data fields Title, URL * and Published are displayed./* ww w . java 2 s .com*/ * * @param entries The Blogger post entries to display. */ private void showData(PostEntry[] 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++) { PostEntry 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())); } }
From source file:com.google.gwt.gdata.sample.hellogdata.client.BloggerRetrieveSpecificBlogPostDemo.java
License:Apache License
/** * Displays a Blogger post entry in a tabular fashion with * the help of a GWT FlexTable widget. The data fields Title, * Author, Published and Contents are displayed. * * @param entry The Blogger post entry to display. *//*from ww w . j a v a 2 s . c om*/ private void showData(PostEntry entry) { mainPanel.clear(); mainPanel.insertRow(0); mainPanel.addCell(0); mainPanel.setWidget(0, 0, new HTML("<h2>" + entry.getTitle().getText() + "</h2>")); mainPanel.insertRow(1); mainPanel.addCell(1); mainPanel.setWidget(1, 0, new HTML("<i>By " + entry.getAuthors()[0].getName().getValue() + " on " + entry.getPublished().getValue().getDate().toString() + "</i>")); mainPanel.insertRow(2); mainPanel.addCell(2); mainPanel.setWidget(2, 0, new Label(entry.getContent().getText())); }