From 848feaaf30762204cb4d9c7bf8b76fbb8bb675da Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Wed, 16 Nov 2016 11:19:09 +0200 Subject: Add HTML/Component support to Grid Footers Change-Id: Iaffe3214163f66c0617a5bea4b79f4ae39d0bc08 --- server/src/main/java/com/vaadin/ui/Grid.java | 48 ++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'server/src/main/java/com/vaadin/ui') diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index 42aab6a7e4..29c97af24a 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -1647,6 +1647,44 @@ public class Grid extends AbstractListing implements HasComponents { * the footer caption to set, not null */ public void setText(String text); + + /** + * Returns the HTML content displayed in this cell. + * + * @return the html + * + */ + public String getHtml(); + + /** + * Sets the HTML content displayed in this cell. + * + * @param html + * the html to set + */ + public void setHtml(String html); + + /** + * Returns the component displayed in this cell. + * + * @return the component + */ + public Component getComponent(); + + /** + * Sets the component displayed in this cell. + * + * @param component + * the component to set + */ + public void setComponent(Component component); + + /** + * Returns the type of content stored in this cell. + * + * @return cell content type + */ + public GridStaticCellType getCellType(); } private class HeaderImpl extends Header { @@ -1932,6 +1970,16 @@ public class Grid extends AbstractListing implements HasComponents { } }); } + Footer footer = getFooter(); + for (int i = 0; i < footer.getRowCount(); ++i) { + FooterRow row = footer.getRow(i); + getColumns().forEach(column -> { + FooterCell cell = row.getCell(column); + if (cell.getCellType() == GridStaticCellType.WIDGET) { + componentSet.add(cell.getComponent()); + } + }); + } return Collections.unmodifiableSet(componentSet).iterator(); } -- cgit v1.2.3