public HtmlPanelGrid() { super(); setRendererType("javax.faces.Grid"); }
private void handleAttribute(String name, Object value) { List<String> setAttributes = (List<String>) this.getAttributes().get("javax.faces.component.UIComponentBase.attributesThatAreSet"); if (setAttributes == null) { String cname = this.getClass().getName(); if (cname != null && cname.startsWith(OPTIMIZED_PACKAGE)) { setAttributes = new ArrayList<String>(6); this.getAttributes().put("javax.faces.component.UIComponentBase.attributesThatAreSet", setAttributes); } } if (setAttributes != null) { if (value == null) { ValueExpression ve = getValueExpression(name); if (ve == null) { setAttributes.remove(name); } } else if (!setAttributes.contains(name)) { setAttributes.add(name); } } }
private int getColumns(HtmlPanelGrid htmlPanelGrid) { int columns = htmlPanelGrid.getColumns(); if (columns <= 0) { columns = 1; } return columns; }
/** * <p>Set the value of the <code>bgcolor</code> property.</p> * @param bgcolor the new property value */ public void setBgcolor(java.lang.String bgcolor) { getStateHelper().put(PropertyKeys.bgcolor, bgcolor); handleAttribute("bgcolor", bgcolor); }
/** * Gets The CSS class for this element. Corresponds to the HTML 'class' attribute. * * @return the new styleClass value */ public String getStyleClass() { if (_styleClass != null) { return _styleClass; } ValueExpression expression = getValueExpression("styleClass"); if (expression != null) { return (String)expression.getValue(getFacesContext().getELContext()); } return null; }
((HtmlPanelGrid)component).getHeaderClass() : ((HtmlPanelGrid)component).getFooterClass()) : (header ? (String)component.getAttributes().get(JSFAttr.HEADER_CLASS_ATTR) :
.getRowClasses()); LoopIterator columnClasses = toStyleLoopIterator(htmlPanelGrid .getColumnClasses());
.getFacet("header")); if (tableHeader != null) { writer.startElement(JsfConstants.THEAD_ELEM, tableHeader); JsfConstants.COLGROUP_VALUE, null); RendererUtil.renderAttribute(writer, JsfConstants.CLASS_ATTR, htmlPanelGrid.getHeaderClass(), JsfConstants.HEADER_CLASS_ATTR); encodeComponent(context, tableHeader); .getFacet("footer")); if (tableFooter != null) { writer.startElement(JsfConstants.TFOOT_ELEM, tableFooter); new Integer(getColumns(htmlPanelGrid))); RendererUtil.renderAttribute(writer, JsfConstants.CLASS_ATTR, htmlPanelGrid.getFooterClass(), JsfConstants.FOOTER_CLASS_ATTR); encodeComponent(context, tableFooter);
/** * <p>Return the value of the <code>bgcolor</code> property.</p> * @return the property value * <p>Contents: Name or code of the background color for this table. */ public java.lang.String getBgcolor() { return (java.lang.String) getStateHelper().eval(PropertyKeys.bgcolor); }
if (component instanceof HtmlPanelGrid) columnClasses = ((HtmlPanelGrid)component).getColumnClasses(); rowClasses = ((HtmlPanelGrid)component).getRowClasses(); if (component instanceof HtmlPanelGrid) rowClass = ((HtmlPanelGrid) component).getRowClass();
comp.setValueBinding("bgcolor", vb); comp.getAttributes().put("bgcolor", _bgcolor); comp.setValueBinding("border", vb); comp.getAttributes().put("border", Integer.valueOf(_border)); comp.setValueBinding("cellpadding", vb); comp.getAttributes().put("cellpadding", _cellpadding); comp.setValueBinding("cellspacing", vb); comp.getAttributes().put("cellspacing", _cellspacing); comp.setValueBinding("columnClasses", vb); comp.getAttributes().put("columnClasses", _columnClasses); comp.setValueBinding("columns", vb); comp.getAttributes().put("columns", Integer.valueOf(_columns)); comp.setValueBinding("footerClass", vb); comp.getAttributes().put("footerClass", _footerClass); comp.setValueBinding("frame", vb);
/** * <p>Return the value of the <code>headerClass</code> property.</p> */ public String getHeaderClass() { return Util.getQualifiedStyleClass(this, super.getHeaderClass(), CSS_DEFAULT.HEADER, "headerClass"); }
/** * <p>Return the value of the <code>footerClass</code> property.</p> */ public String getFooterClass() { return Util.getQualifiedStyleClass(this, super.getFooterClass(), CSS_DEFAULT.FOOTER, "footerClass"); } }
/** * <p>Set the value of the <code>cellspacing</code> property.</p> * @param cellspacing the new property value */ public void setCellspacing(java.lang.String cellspacing) { getStateHelper().put(PropertyKeys.cellspacing, cellspacing); handleAttribute("cellspacing", cellspacing); }
((HtmlPanelGrid)component).getHeaderClass() : ((HtmlPanelGrid)component).getFooterClass()) : (header ? (String)component.getAttributes().get(JSFAttr.HEADER_CLASS_ATTR) :
/** * Gets An advisory title for this element. Often used by the user agent as a tooltip. * * @return the new title value */ public String getTitle() { if (_title != null) { return _title; } ValueExpression expression = getValueExpression("title"); if (expression != null) { return (String)expression.getValue(getFacesContext().getELContext()); } return null; }
if (component instanceof HtmlPanelGrid) columnClasses = ((HtmlPanelGrid)component).getColumnClasses(); rowClasses = ((HtmlPanelGrid)component).getRowClasses();
/** * <p>Return the value of the <code>bodyrows</code> property.</p> * @return the property value * <p>Contents: Comma separated list of row indices for which a new * "tbody" element should be started (and any * previously opened one should be ended). */ public java.lang.String getBodyrows() { return (java.lang.String) getStateHelper().eval(PropertyKeys.bodyrows); }
private void renderHeaderFacet(FacesContext facesContext, UIComponent uiComponent, DOMContext domContext) throws IOException { Element root = (Element) domContext.getRootNode(); DOMContext.removeChildrenByTagName(root, "thead"); UIComponent headerFacet = getFacetByName(uiComponent, "header"); if (headerFacet != null && headerFacet.isRendered()) { Element thead = domContext.createElement("thead"); Element tr = domContext.createElement("tr"); Element th = domContext.createElement("th"); root.appendChild(thead); thead.appendChild(tr); tr.appendChild(th); String headerClassAttribute = ((HtmlPanelGrid) uiComponent).getHeaderClass(); if (headerClassAttribute != null) { th.setAttribute("class", headerClassAttribute); } th.setAttribute("scope", "colgroup"); th.setAttribute("colspan", String.valueOf( getConvertedColumnAttribute(uiComponent))); domContext.setCursorParent(th); encodeParentAndChildren(facesContext, headerFacet); } }
private void renderFooterFacet(FacesContext facesContext, UIComponent uiComponent, DOMContext domContext) throws IOException { Element root = (Element) domContext.getRootNode(); DOMContext.removeChildrenByTagName(root, "tfoot"); UIComponent footerFacet = getFacetByName(uiComponent, "footer"); if (footerFacet != null && footerFacet.isRendered()) { Element tfoot = domContext.createElement("tfoot"); Element tr = domContext.createElement("tr"); Element td = domContext.createElement("td"); root.appendChild(tfoot); tfoot.appendChild(tr); tr.appendChild(td); String footerClassAttribute = ((HtmlPanelGrid) uiComponent).getFooterClass(); if (footerClassAttribute != null) { td.setAttribute("class", footerClassAttribute); } td.setAttribute("colspan", String.valueOf( getConvertedColumnAttribute(uiComponent))); domContext.setCursorParent(td); encodeParentAndChildren(facesContext, footerFacet); } }