public int getColumnsCountWithSpan() { if (columnsCountWithSpan == -1) { columnsCountWithSpan = 0; for (UIComponent kid : getChildren()) { if (kid.isRendered()) { if (kid instanceof Columns) { int dynamicColumnsCount = ((Columns) kid).getRowCount(); if (dynamicColumnsCount > 0) { columnsCountWithSpan += dynamicColumnsCount; } } else if (kid instanceof Column) { Column col = (Column) kid; if (col.isVisible()) { columnsCountWithSpan += col.getColspan(); } } else if (kid instanceof SubTable) { SubTable subTable = (SubTable) kid; for (UIComponent subTableKid : subTable.getChildren()) { if (subTableKid.isRendered() && subTableKid instanceof Column) { columnsCountWithSpan += ((Column) subTableKid).getColspan(); } } } } } } return columnsCountWithSpan; }
@Override public void encode(FacesContext context, Column column) throws IOException { ResponseWriter writer = context.getResponseWriter(); String style = column.getStyle(); String styleClass = column.getStyleClass(); styleClass = (styleClass == null) ? PanelGrid.CELL_CLASS : PanelGrid.CELL_CLASS + " " + styleClass; writer.startElement("td", null); writer.writeAttribute("role", "gridcell", null); writer.writeAttribute("class", styleClass, null); if (style != null) { writer.writeAttribute("style", style, null); } if (column.getColspan() > 1) { writer.writeAttribute("colspan", column.getColspan(), null); } if (column.getRowspan() > 1) { writer.writeAttribute("rowspan", column.getRowspan(), null); } renderChildren(context, column); writer.endElement("td"); }
@Override public void encode(FacesContext context, Column column) throws IOException { ResponseWriter writer = context.getResponseWriter(); String style = column.getStyle(); String styleClass = column.getStyleClass(); String defaultStyleClass = PanelGrid.CELL_CLASS + " ui-widget-header"; styleClass = (styleClass == null) ? defaultStyleClass : defaultStyleClass + " " + styleClass; writer.startElement("td", null); writer.writeAttribute("role", "columnheader", null); writer.writeAttribute("class", styleClass, null); if (style != null) { writer.writeAttribute("style", style, null); } if (column.getColspan() > 1) { writer.writeAttribute("colspan", column.getColspan(), null); } if (column.getRowspan() > 1) { writer.writeAttribute("rowspan", column.getRowspan(), null); } renderChildren(context, column); writer.endElement("td"); }
protected void encodeFacetColumn(FacesContext context, SubTable table, Column column, String facetName, String styleClass, String text) throws IOException { if (!column.isRendered()) { return; } ResponseWriter writer = context.getResponseWriter(); String style = column.getStyle(); String columnClass = column.getStyleClass(); columnClass = (columnClass == null) ? styleClass : styleClass + " " + columnClass; writer.startElement("td", null); writer.writeAttribute("class", columnClass, null); if (column.getRowspan() != 1) { writer.writeAttribute("rowspan", column.getRowspan(), null); } if (column.getColspan() != 1) { writer.writeAttribute("colspan", column.getColspan(), null); } if (style != null) { writer.writeAttribute("style", style, null); } // Footer content UIComponent facet = column.getFacet(facetName); if (facet != null) { facet.encodeAll(context); } else if (text != null) { writer.write(text); } writer.endElement("td"); }
@Override public void encodeEnd(FacesContext context, UIComponent component) throws IOException { SummaryRow row = (SummaryRow) component; ResponseWriter writer = context.getResponseWriter(); writer.startElement("tr", null); writer.writeAttribute("class", DataTable.SUMMARY_ROW_CLASS, null); for (UIComponent kid : row.getChildren()) { if (kid.isRendered() && kid instanceof Column) { Column column = (Column) kid; String style = column.getStyle(); String styleClass = column.getStyleClass(); writer.startElement("td", null); if (style != null) { writer.writeAttribute("style", style, null); } if (styleClass != null) { writer.writeAttribute("class", styleClass, null); } if (column.getRowspan() != 1) { writer.writeAttribute("rowspan", column.getRowspan(), null); } if (column.getColspan() != 1) { writer.writeAttribute("colspan", column.getColspan(), null); } column.encodeAll(context); writer.endElement("td"); } } writer.endElement("tr"); }
writer.writeAttribute("rowspan", column.getRowspan(), null); if (column.getColspan() != 1) { writer.writeAttribute("colspan", column.getColspan(), null);
writer.writeAttribute("style", column.getStyle(), null); if (column.getColspan() > 1) { writer.writeAttribute("colspan", column.getColspan(), null);
Column col = (Column) kid; if(col.isVisible()) { columnsCountWithSpan += col.getColspan(); for(UIComponent subTableKid : subTable.getChildren()) { if(subTableKid.isRendered() && subTableKid instanceof Column) { columnsCountWithSpan += ((Column) subTableKid).getColspan();
public void encode(FacesContext context, Column column) throws IOException { ResponseWriter writer = context.getResponseWriter(); String style = column.getStyle(); String styleClass = column.getStyleClass(); styleClass = (styleClass == null) ? PanelGrid.CELL_CLASS : PanelGrid.CELL_CLASS + " " + styleClass; writer.startElement("td", null); writer.writeAttribute("role", "gridcell", null); writer.writeAttribute("class", styleClass, null); if (style != null) writer.writeAttribute("style", style, null); if (column.getColspan() > 1) writer.writeAttribute("colspan", column.getColspan(), null); if (column.getRowspan() > 1) writer.writeAttribute("rowspan", column.getRowspan(), null); renderChildren(context, column); writer.endElement("td"); }
public void encode(FacesContext context, Column column) throws IOException { ResponseWriter writer = context.getResponseWriter(); String style = column.getStyle(); String styleClass = column.getStyleClass(); String defaultStyleClass = PanelGrid.CELL_CLASS + " ui-widget-header"; styleClass = (styleClass == null) ? defaultStyleClass : defaultStyleClass + " " + styleClass; writer.startElement("td", null); writer.writeAttribute("role", "columnheader", null); writer.writeAttribute("class", styleClass, null); if (style != null) writer.writeAttribute("style", style, null); if (column.getColspan() > 1) writer.writeAttribute("colspan", column.getColspan(), null); if (column.getRowspan() > 1) writer.writeAttribute("rowspan", column.getRowspan(), null); renderChildren(context, column); writer.endElement("td"); }
protected void encodeFacetColumn(FacesContext context, SubTable table, Column column, String facetName, String styleClass, String text) throws IOException { if (!column.isRendered()) { return; } ResponseWriter writer = context.getResponseWriter(); String style = column.getStyle(); String columnClass = column.getStyleClass(); columnClass = (columnClass == null) ? styleClass : styleClass + " " + columnClass; writer.startElement("td", null); writer.writeAttribute("class", columnClass, null); if (column.getRowspan() != 1) writer.writeAttribute("rowspan", column.getRowspan(), null); if (column.getColspan() != 1) writer.writeAttribute("colspan", column.getColspan(), null); if (style != null) writer.writeAttribute("style", style, null); // Footer content UIComponent facet = column.getFacet(facetName); if (facet != null) { facet.encodeAll(context); } else if (text != null) { writer.write(text); } writer.endElement("td"); }
@Override public void encodeEnd(FacesContext context, UIComponent component) throws IOException { SummaryRow row = (SummaryRow) component; ResponseWriter writer = context.getResponseWriter(); writer.startElement("tr", null); writer.writeAttribute("class", DataTable.SUMMARY_ROW_CLASS, null); for (UIComponent kid : row.getChildren()) { if (kid.isRendered() && kid instanceof Column) { Column column = (Column) kid; String style = column.getStyle(); String styleClass = column.getStyleClass(); writer.startElement("td", null); if (style != null) writer.writeAttribute("style", style, null); if (styleClass != null) writer.writeAttribute("class", styleClass, null); if (column.getRowspan() != 1) writer.writeAttribute("rowspan", column.getRowspan(), null); if (column.getColspan() != 1) writer.writeAttribute("colspan", column.getColspan(), null); column.encodeAll(context); writer.endElement("td"); } } writer.endElement("tr"); }
if (styleClass != null) writer.writeAttribute("class", styleClass, null); if (column.getRowspan() != 1) writer.writeAttribute("rowspan", column.getRowspan(), null); if (column.getColspan() != 1) writer.writeAttribute("colspan", column.getColspan(), null);
if (column.getColspan() > 1) writer.writeAttribute("colspan", column.getColspan(), null); if (column.getRowspan() > 1) writer.writeAttribute("rowspan", column.getRowspan(), null);