public HtmlDataTable() { super(); setRendererType("javax.faces.Table"); }
/** * <p>Set the value of the <code>lang</code> property.</p> * @param lang the new property value */ public void setLang(java.lang.String lang) { getStateHelper().put(PropertyKeys.lang, lang); handleAttribute("lang", lang); }
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); } } }
/** * Gets styles for the specified component. */ public static Styles getStyles(HtmlNewspaperTable newspaperTable) { String rowClasses; String columnClasses; if(newspaperTable instanceof HtmlDataTable) { rowClasses = ((HtmlDataTable)newspaperTable).getRowClasses(); columnClasses = ((HtmlDataTable)newspaperTable).getColumnClasses(); } else { rowClasses = (String)newspaperTable.getAttributes().get(JSFAttr.ROW_CLASSES_ATTR); columnClasses = (String)newspaperTable.getAttributes().get(JSFAttr.COLUMN_CLASSES_ATTR); } return new Styles(rowClasses, columnClasses); }
/** * Gets The CSS class to be applied to the Caption. * * @return the new captionStyle value */ public String getCaptionStyle() { if (_captionStyle != null) { return _captionStyle; } ValueExpression expression = getValueExpression("captionStyle"); if (expression != null) { return (String)expression.getValue(getFacesContext().getELContext()); } return null; }
comp.setValueExpression("dir", _dir); comp.setValueExpression("captionStyle", _captionStyle); comp.setValueExpression("captionClass", _captionClass); comp.setValueExpression("style", _style); comp.getAttributes().put("var", _var); comp.setValueExpression("summary", _summary); comp.setValueExpression("title", _title); comp.setValueExpression("onmouseup", _onmouseup); comp.setValueExpression("footerClass", _footerClass); comp.setValueExpression("columnClasses", _columnClasses); comp.setValueExpression("lang", _lang); comp.setValueExpression("styleClass", _styleClass); comp.setValueExpression("headerClass", _headerClass); comp.setValueExpression("rowClasses", _rowClasses); comp.setValueExpression("onkeypress", _onkeypress);
protected void encodeHtmlDataTableChildren(FacesContext context, HtmlDataTable htmlDataTable) throws IOException { ResponseWriter writer = context.getResponseWriter(); writer.startElement(JsfConstants.TBODY_ELEM, htmlDataTable); LoopIterator rowClasses = toStyleLoopIterator(htmlDataTable .getRowClasses()); LoopIterator columnClasses = toStyleLoopIterator(htmlDataTable .getColumnClasses()); int start = htmlDataTable.getFirst(); int rows = htmlDataTable.getRows(); boolean allRow = true; if (0 < rows) { allRow = false; } htmlDataTable.setRowIndex(start); for (int rowIndex = start; ((allRow || 0 < rows) && htmlDataTable .isRowAvailable());) { encodeBodyRow(context, htmlDataTable, writer, rowClasses, columnClasses); rowIndex++; rows--; htmlDataTable.setRowIndex(rowIndex); } writer.endElement(JsfConstants.TBODY_ELEM); }
/** * Gets the style class for the table footer. */ private static String getFooterClass(HtmlNewspaperTable newspaperTable) { if(newspaperTable instanceof HtmlDataTable) { return ((HtmlDataTable)newspaperTable).getFooterClass(); } else { return (String)newspaperTable.getAttributes().get(JSFAttr.FOOTER_CLASS_ATTR); } }
/** * Gets the style class for the table header. */ private static String getHeaderClass(HtmlNewspaperTable newspaperTable) { if(newspaperTable instanceof HtmlDataTable) { return ((HtmlDataTable)newspaperTable).getHeaderClass(); } else { return (String)newspaperTable.getAttributes().get(JSFAttr.HEADER_CLASS_ATTR); } } /**
} else if (component instanceof HtmlDataTable) { HtmlDataTable dataTable = (HtmlDataTable) component; captionClass = dataTable.getCaptionClass(); captionStyle = dataTable.getCaptionStyle(); } else { captionClass = (String) component.getAttributes().get(org.apache.myfaces.shared_impl.renderkit.JSFAttr.CAPTION_CLASS_ATTR);
.getHeader()); if (tableHeader != null || isColumnHeaderExist) { writer.startElement(JsfConstants.THEAD_ELEM, tableHeader); RendererUtil.renderAttribute(writer, JsfConstants.CLASS_ATTR, htmlDataTable .getHeaderClass(), JsfConstants.HEADER_CLASS_ATTR); encodeComponent(context, tableHeader); RendererUtil.renderAttribute(writer, JsfConstants.CLASS_ATTR, htmlDataTable .getHeaderClass(), JsfConstants.HEADER_CLASS_ATTR); UIColumn column = (UIColumn) it.next(); .getFooter()); if (tableFooter != null || isColumnFooterExist) { writer.startElement(JsfConstants.TFOOT_ELEM, tableFooter); RendererUtil.renderAttribute(writer, JsfConstants.CLASS_ATTR, htmlDataTable .getFooterClass(), JsfConstants.FOOTER_CLASS_ATTR); encodeComponent(context, tableFooter); RendererUtil.renderAttribute(writer, JsfConstants.CLASS_ATTR, htmlDataTable .getFooterClass(),
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("footerClass", vb); comp.getAttributes().put("footerClass", _footerClass); comp.setValueBinding("frame", vb); comp.getAttributes().put("frame", _frame); comp.setValueBinding("headerClass", vb);
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); } } }
/** * Gets styles for the specified component. */ protected static Styles getStyles(UIData uiData) { String rowClasses; String columnClasses; if(uiData instanceof HtmlDataTable) { rowClasses = ((HtmlDataTable)uiData).getRowClasses(); columnClasses = ((HtmlDataTable)uiData).getColumnClasses(); } else { rowClasses = (String)uiData.getAttributes().get(JSFAttr.ROW_CLASSES_ATTR); columnClasses = (String)uiData.getAttributes().get(JSFAttr.COLUMN_CLASSES_ATTR); } return new Styles(rowClasses, columnClasses); }
/** * Gets Script to be invoked when the element is double-clicked. * * @return the new ondblclick value */ public String getOndblclick() { if (_ondblclick != null) { return _ondblclick; } ValueExpression expression = getValueExpression("ondblclick"); if (expression != null) { return (String)expression.getValue(getFacesContext().getELContext()); } return null; }
comp.setValueExpression("bgcolor", _bgcolor); comp.setValueExpression("bodyrows", _bodyrows); comp.setValueExpression("border", _border); comp.setValueExpression("cellpadding", _cellpadding); comp.setValueExpression("cellspacing", _cellspacing); comp.setValueExpression("columnClasses", _columnClasses); comp.setValueExpression("footerClass", _footerClass); comp.setValueExpression("frame", _frame); comp.setValueExpression("headerClass", _headerClass); comp.setValueExpression("rowClasses", _rowClasses); comp.setValueExpression("rules", _rules); comp.setValueExpression("summary", _summary); comp.setValueExpression("width", _width); comp.setValueExpression("captionClass", _captionClass); comp.setValueExpression("captionStyle", _captionStyle);
/** * Gets the footerClass attribute of the given <code>UIComponent</code>. * @param component the <code>UIComponent</code>. * @return the footerClass attribute of the given <code>UIComponent</code>. */ protected static String getFooterClass(UIComponent component) { if (component instanceof HtmlDataTable) { return ((HtmlDataTable) component).getFooterClass(); } else { return (String) component.getAttributes().get(org.apache.myfaces.shared_tomahawk.renderkit.JSFAttr.FOOTER_CLASS_ATTR); } }
/** * Gets the headerClass attribute of the given <code>UIComponent</code>. * @param component the <code>UIComponent</code>. * @return the headerClass attribute of the given <code>UIComponent</code>. */ protected static String getHeaderClass(UIComponent component) { if (component instanceof HtmlDataTable) { return ((HtmlDataTable) component).getHeaderClass(); } else { return (String) component.getAttributes().get(org.apache.myfaces.shared_orchestra.renderkit.JSFAttr.HEADER_CLASS_ATTR); } }
captionClass = dataTable.getCaptionClass(); captionStyle = dataTable.getCaptionStyle();
/** * <p>Set the value of the <code>onmousemove</code> property.</p> * @param onmousemove the new property value */ public void setOnmousemove(java.lang.String onmousemove) { getStateHelper().put(PropertyKeys.onmousemove, onmousemove); handleAttribute("onmousemove", onmousemove); }