/** * Returns a <code>TableMetaInfo</code> object containing details such * as row and column classes, columns, and a mechanism for scrolling through * the row/column classes. * @param context the <code>FacesContext</code> for the current request * @param table the table that's being rendered * @return the <code>TableMetaInfo</code> for provided table */ protected TableRenderer.TableMetaInfo getMetaInfo(FacesContext context, UIComponent table) { String key = createKey(table); Map<Object,Object> attributes = context.getAttributes(); TableRenderer.TableMetaInfo info = (TableRenderer.TableMetaInfo) attributes.get(key); if (info == null) { info = new TableRenderer.TableMetaInfo(table); attributes.put(key, info); } return info; }
public TableMetaInfo(UIComponent table) { rowClasses = getRowClasses(table); columnClasses = getColumnClasses(table); columns = getColumns(table); columnCount = columns.size(); hasHeaderFacets = hasFacet("header", columns); hasFooterFacets = hasFacet("footer", columns); }
info.newRow(); for (UIColumn column : info.columns) { final String tableColumnStyleClass = info.getCurrentColumnClass(); final String columnStyleClass = (String) column.getAttributes().get("styleClass");
info.newRow(); for (UIColumn column : info.columns) { final String tableColumnStyleClass = info.getCurrentColumnClass(); final String columnStyleClass = (String) column.getAttributes().get("styleClass");
rowRendered = true; open = true; info.newRow();
info.newRow(); for (UIColumn column : info.columns) { final String tableColumnStyleClass = info.getCurrentColumnClass(); final String columnStyleClass = (String) column.getAttributes().get("styleClass");
rowRendered = true; open = true; info.newRow();
rowRendered = true; open = true; info.newRow();
rowRendered = true; open = true; info.newRow();
info.newRow(); for (UIColumn column : info.columns) { String columnClass = info.getCurrentColumnClass(); if (columnClass != null) { writer.writeAttribute("class",
writer.startElement("tr", table); final String tableRowClass = info.rowClasses.length > 0 ? info.getCurrentRowClass() : null; final String rowClass = (String) table.getAttributes().get("rowClass");
writer.startElement("tr", table); final String tableRowClass = info.rowClasses.length > 0 ? info.getCurrentRowClass() : null; final String rowClass = (String) table.getAttributes().get("rowClass");
writer.startElement("tr", table); final String tableRowClass = info.rowClasses.length > 0 ? info.getCurrentRowClass() : null; final String rowClass = (String) table.getAttributes().get("rowClass");
protected void renderRow(FacesContext context, UIComponent table, UIComponent child, ResponseWriter writer) throws IOException { // Iterate over the child UIColumn components for each row TableMetaInfo info = getMetaInfo(context, table); info.newRow(); for (UIColumn column : info.columns) { // Render the beginning of this cell writer.startElement("td", column); String columnClass = info.getCurrentColumnClass(); if (columnClass != null) { writer.writeAttribute("class", columnClass, "columnClasses"); } // Render the contents of this cell by iterating over // the kids of our kids for (Iterator<UIComponent> gkids = getChildren(column); gkids.hasNext();) { encodeRecursive(context, gkids.next()); } // Render the ending of this cell writer.endElement("td"); writer.writeText("\n", table, null); } }
/** * Returns a <code>TableMetaInfo</code> object containing details such * as row and column classes, columns, and a mechanism for scrolling through * the row/column classes. * @param context the <code>FacesContext</code> for the current request * @param table the table that's being rendered * @return the <code>TableMetaInfo</code> for provided table */ protected TableRenderer.TableMetaInfo getMetaInfo(FacesContext context, UIComponent table) { String key = createKey(table); Map<Object,Object> attributes = context.getAttributes(); TableRenderer.TableMetaInfo info = (TableRenderer.TableMetaInfo) attributes.get(key); if (info == null) { info = new TableRenderer.TableMetaInfo(table); attributes.put(key, info); } return info; }
/** * Renders the starting <code>tr</code> element applying any values * from the <code>rowClasses</code> attribute. * @param context the <code>FacesContext</code> for the current request * @param table the table that's being rendered * @param writer the current writer * @throws IOException if content cannot be written */ protected void renderRowStart(FacesContext context, UIComponent table, ResponseWriter writer) throws IOException { TableMetaInfo info = getMetaInfo(context, table); writer.startElement("tr", table); if (info.rowClasses.length > 0) { writer.writeAttribute("class", info.getCurrentRowClass(), "rowClasses"); } writer.writeText("\n", table, null); }
/** * Renders the starting <code>tr</code> element applying any values * from the <code>rowClasses</code> attribute. * @param context the <code>FacesContext</code> for the current request * @param table the table that's being rendered * @param writer the current writer * @throws IOException if content cannot be written */ protected void renderRowStart(FacesContext context, UIComponent table, ResponseWriter writer) throws IOException { TableMetaInfo info = getMetaInfo(context, table); writer.startElement("tr", table); if (info.rowClasses.length > 0) { writer.writeAttribute("class", info.getCurrentRowClass(), "rowClasses"); } writer.writeText("\n", table, null); }
/** * Returns a <code>TableMetaInfo</code> object containing details such * as row and column classes, columns, and a mechanism for scrolling through * the row/column classes. * @param context the <code>FacesContext</code> for the current request * @param table the table that's being rendered * @return the <code>TableMetaInfo</code> for provided table */ protected TableRenderer.TableMetaInfo getMetaInfo(FacesContext context, UIComponent table) { String key = createKey(table); Map<Object,Object> attributes = context.getAttributes(); TableRenderer.TableMetaInfo info = (TableRenderer.TableMetaInfo) attributes.get(key); if (info == null) { info = new TableRenderer.TableMetaInfo(table); attributes.put(key, info); } return info; }
/** * Returns a <code>TableMetaInfo</code> object containing details such * as row and column classes, columns, and a mechanism for scrolling through * the row/column classes. * @param context the <code>FacesContext</code> for the current request * @param table the table that's being rendered * @return the <code>TableMetaInfo</code> for provided table */ protected TableRenderer.TableMetaInfo getMetaInfo(FacesContext context, UIComponent table) { String key = createKey(table); Map<Object,Object> attributes = context.getAttributes(); TableRenderer.TableMetaInfo info = (TableRenderer.TableMetaInfo) attributes.get(key); if (info == null) { info = new TableRenderer.TableMetaInfo(table); attributes.put(key, info); } return info; }