1 16 package org.apache.cocoon.faces.taglib.html; 17 18 import org.apache.cocoon.faces.taglib.UIComponentTag; 19 import org.apache.cocoon.faces.FacesUtils; 20 21 import javax.faces.component.UIComponent; 22 import javax.faces.component.UIData; 23 import javax.faces.FacesException; 24 25 28 public class DataTableTag extends UIComponentTag { 29 30 private String first; 31 private String rows; 32 private String value; 33 private String var; 34 private String bgcolor; 35 private String border; 36 private String cellpadding; 37 private String cellspacing; 38 private String columnClasses; 39 private String dir; 40 private String footerClass; 41 private String frame; 42 private String headerClass; 43 private String lang; 44 private String onclick; 45 private String ondblclick; 46 private String onkeydown; 47 private String onkeypress; 48 private String onkeyup; 49 private String onmousedown; 50 private String onmousemove; 51 private String onmouseout; 52 private String onmouseover; 53 private String onmouseup; 54 private String rowClasses; 55 private String rules; 56 private String style; 57 private String styleClass; 58 private String summary; 59 private String title; 60 private String width; 61 62 63 public void setFirst(String first) { 64 this.first = first; 65 } 66 67 public void setRows(String rows) { 68 this.rows = rows; 69 } 70 71 public void setValue(String value) { 72 this.value = value; 73 } 74 75 public void setVar(String var) { 76 this.var = var; 77 } 78 79 public void setBgcolor(String bgcolor) { 80 this.bgcolor = bgcolor; 81 } 82 83 public void setBorder(String border) { 84 this.border = border; 85 } 86 87 public void setCellpadding(String cellpadding) { 88 this.cellpadding = cellpadding; 89 } 90 91 public void setCellspacing(String cellspacing) { 92 this.cellspacing = cellspacing; 93 } 94 95 public void setColumnClasses(String columnClasses) { 96 this.columnClasses = columnClasses; 97 } 98 99 public void setDir(String dir) { 100 this.dir = dir; 101 } 102 103 public void setFooterClass(String footerClass) { 104 this.footerClass = footerClass; 105 } 106 107 public void setFrame(String frame) { 108 this.frame = frame; 109 } 110 111 public void setHeaderClass(String headerClass) { 112 this.headerClass = headerClass; 113 } 114 115 public void setLang(String lang) { 116 this.lang = lang; 117 } 118 119 public void setOnclick(String onclick) { 120 this.onclick = onclick; 121 } 122 123 public void setOndblclick(String ondblclick) { 124 this.ondblclick = ondblclick; 125 } 126 127 public void setOnkeydown(String onkeydown) { 128 this.onkeydown = onkeydown; 129 } 130 131 public void setOnkeypress(String onkeypress) { 132 this.onkeypress = onkeypress; 133 } 134 135 public void setOnkeyup(String onkeyup) { 136 this.onkeyup = onkeyup; 137 } 138 139 public void setOnmousedown(String onmousedown) { 140 this.onmousedown = onmousedown; 141 } 142 143 public void setOnmousemove(String onmousemove) { 144 this.onmousemove = onmousemove; 145 } 146 147 public void setOnmouseout(String onmouseout) { 148 this.onmouseout = onmouseout; 149 } 150 151 public void setOnmouseover(String onmouseover) { 152 this.onmouseover = onmouseover; 153 } 154 155 public void setOnmouseup(String onmouseup) { 156 this.onmouseup = onmouseup; 157 } 158 159 public void setRowClasses(String rowClasses) { 160 this.rowClasses = rowClasses; 161 } 162 163 public void setRules(String rules) { 164 this.rules = rules; 165 } 166 167 public void setStyle(String style) { 168 this.style = style; 169 } 170 171 public void setStyleClass(String styleClass) { 172 this.styleClass = styleClass; 173 } 174 175 public void setSummary(String summary) { 176 this.summary = summary; 177 } 178 179 public void setTitle(String title) { 180 this.title = title; 181 } 182 183 public void setWidth(String width) { 184 this.width = width; 185 } 186 187 188 public String getRendererType() { 189 return "javax.faces.Table"; 190 } 191 192 public String getComponentType() { 193 return "javax.faces.HtmlDataTable"; 194 } 195 196 197 protected void setProperties(UIComponent component) { 198 super.setProperties(component); 199 200 UIData data; 201 try { 202 data = (UIData) component; 203 } catch (ClassCastException cce) { 204 throw new FacesException("Tag <" + getClass().getName() + "> expected UIData. " + 205 "Got <" + component.getClass().getName() + ">"); 206 } 207 208 if (first != null) { 209 if (FacesUtils.isExpression(first)) { 210 data.setValueBinding("first", createValueBinding(first)); 211 } else { 212 data.setFirst(Integer.parseInt(first)); 213 } 214 } 215 216 if (rows != null) { 217 if (FacesUtils.isExpression(rows)) { 218 data.setValueBinding("rows", createValueBinding(rows)); 219 } else { 220 data.setRows(Integer.parseInt(rows)); 221 } 222 } 223 224 if (value != null) { 225 if (FacesUtils.isExpression(value)) { 226 data.setValueBinding("value", createValueBinding(value)); 227 } else { 228 data.setValue(value); 229 } 230 } 231 232 data.setVar(var); 233 234 setProperty(component, "bgcolor", bgcolor); 235 236 setIntegerProperty(component, "border", border); 237 238 setProperty(component, "cellpadding", cellpadding); 239 setProperty(component, "cellspacing", cellspacing); 240 setProperty(component, "columnClasses", columnClasses); 241 setProperty(component, "dir", dir); 242 setProperty(component, "footerClass", footerClass); 243 setProperty(component, "frame", frame); 244 setProperty(component, "headerClass", headerClass); 245 setProperty(component, "lang", lang); 246 247 setProperty(component, "onclick", onclick); 248 setProperty(component, "ondblclick", ondblclick); 249 setProperty(component, "onkeydown", onkeydown); 250 setProperty(component, "onkeypress", onkeypress); 251 setProperty(component, "onkeyup", onkeyup); 252 setProperty(component, "onmousedown", onmousedown); 253 setProperty(component, "onmousemove", onmousemove); 254 setProperty(component, "onmouseout", onmouseout); 255 setProperty(component, "onmouseover", onmouseover); 256 setProperty(component, "onmouseup", onmouseup); 257 258 setProperty(component, "rowClasses", rowClasses); 259 setProperty(component, "rules", rules); 260 setProperty(component, "style", style); 261 setProperty(component, "styleClass", styleClass); 262 setProperty(component, "summary", summary); 263 setProperty(component, "title", title); 264 setProperty(component, "width", width); 265 } 266 267 public void recycle() { 268 super.recycle(); 269 first = null; 270 rows = null; 271 value = null; 272 var = null; 273 bgcolor = null; 274 border = null; 275 cellpadding = null; 276 cellspacing = null; 277 columnClasses = null; 278 dir = null; 279 footerClass = null; 280 frame = null; 281 headerClass = null; 282 lang = null; 283 onclick = null; 284 ondblclick = null; 285 onkeydown = null; 286 onkeypress = null; 287 onkeyup = null; 288 onmousedown = null; 289 onmousemove = null; 290 onmouseout = null; 291 onmouseover = null; 292 onmouseup = null; 293 rowClasses = null; 294 rules = null; 295 style = null; 296 styleClass = null; 297 summary = null; 298 title = null; 299 width = null; 300 } 301 } 302 | Popular Tags |