1 16 package org.apache.cocoon.faces.taglib.html; 17 18 import org.apache.cocoon.faces.FacesUtils; 19 import org.apache.cocoon.faces.taglib.UIComponentTag; 20 21 import javax.faces.FacesException; 22 import javax.faces.component.UIComponent; 23 import javax.faces.component.UIOutput; 24 25 28 public class OutputLabelTag extends UIComponentTag { 29 30 private String converter; 31 private String value; 32 private String accesskey; 33 private String dir; 34 private String _for; 35 private String lang; 36 private String onblur; 37 private String onclick; 38 private String ondblclick; 39 private String onfocus; 40 private String onkeydown; 41 private String onkeypress; 42 private String onkeyup; 43 private String onmousedown; 44 private String onmousemove; 45 private String onmouseout; 46 private String onmouseover; 47 private String onmouseup; 48 private String style; 49 private String styleClass; 50 private String tabindex; 51 private String title; 52 53 54 public void setConverter(String converter) { 55 this.converter = converter; 56 } 57 58 public void setValue(String value) { 59 this.value = value; 60 } 61 62 public void setAccesskey(String accesskey) { 63 this.accesskey = accesskey; 64 } 65 66 public void setDir(String dir) { 67 this.dir = dir; 68 } 69 70 public void setFor(String _for) { 71 this._for = _for; 72 } 73 public void setLang(String lang) { 74 this.lang = lang; 75 } 76 77 public void setOnblur(String onblur) { 78 this.onblur = onblur; 79 } 80 81 public void setOnclick(String onclick) { 82 this.onclick = onclick; 83 } 84 85 public void setOndblclick(String ondblclick) { 86 this.ondblclick = ondblclick; 87 } 88 89 public void setOnfocus(String onfocus) { 90 this.onfocus = onfocus; 91 } 92 93 public void setOnkeydown(String onkeydown) { 94 this.onkeydown = onkeydown; 95 } 96 97 public void setOnkeypress(String onkeypress) { 98 this.onkeypress = onkeypress; 99 } 100 101 public void setOnkeyup(String onkeyup) { 102 this.onkeyup = onkeyup; 103 } 104 105 public void setOnmousedown(String onmousedown) { 106 this.onmousedown = onmousedown; 107 } 108 109 public void setOnmousemove(String onmousemove) { 110 this.onmousemove = onmousemove; 111 } 112 113 public void setOnmouseout(String onmouseout) { 114 this.onmouseout = onmouseout; 115 } 116 117 public void setOnmouseover(String onmouseover) { 118 this.onmouseover = onmouseover; 119 } 120 121 public void setOnmouseup(String onmouseup) { 122 this.onmouseup = onmouseup; 123 } 124 125 public void setStyle(String style) { 126 this.style = style; 127 } 128 129 public void setStyleClass(String styleClass) { 130 this.styleClass = styleClass; 131 } 132 133 public void setTabindex(String tabindex) { 134 this.tabindex = tabindex; 135 } 136 137 public void setTitle(String title) { 138 this.title = title; 139 } 140 141 142 public String getRendererType() { 143 return "javax.faces.Text"; 144 } 145 146 public String getComponentType() { 147 return "javax.faces.HtmlOutputText"; 148 } 149 150 151 protected void setProperties(UIComponent component) { 152 super.setProperties(component); 153 154 UIOutput output; 155 try { 156 output = (UIOutput) component; 157 } catch (ClassCastException cce) { 158 throw new FacesException("Tag <" + getClass().getName() + "> expected UIOutput. " + 159 "Got <" + component.getClass().getName() + ">"); 160 } 161 162 if (converter != null) { 163 if (FacesUtils.isExpression(converter)) { 164 output.setValueBinding("converter", createValueBinding(converter)); 165 } else { 166 output.setConverter(getApplication().createConverter(converter)); 167 } 168 } 169 170 if (value != null) { 171 if (FacesUtils.isExpression(value)) { 172 output.setValueBinding("value", createValueBinding(value)); 173 } else { 174 output.setValue(value); 175 } 176 } 177 178 setProperty(component, "accesskey", accesskey); 179 setProperty(component, "dir", dir); 180 setProperty(component, "for", _for); 182 setProperty(component, "lang", lang); 183 setProperty(component, "onblur", onblur); 184 setProperty(component, "onclick", onclick); 185 setProperty(component, "ondblclick", ondblclick); 186 setProperty(component, "onfocus", onfocus); 187 setProperty(component, "onkeydown", onkeydown); 188 setProperty(component, "onkeypress", onkeypress); 189 setProperty(component, "onkeyup", onkeyup); 190 setProperty(component, "onmousedown", onmousedown); 191 setProperty(component, "onmousemove", onmousemove); 192 setProperty(component, "onmouseout", onmouseout); 193 setProperty(component, "onmouseover", onmouseover); 194 setProperty(component, "onmouseup", onmouseup); 195 196 setProperty(component, "style", style); 197 setProperty(component, "styleClass", styleClass); 198 setProperty(component, "tabindex", tabindex); 199 setProperty(component, "title", title); 200 } 201 202 public void recycle() { 203 super.recycle(); 204 converter = null; 205 value = null; 206 accesskey = null; 207 dir = null; 208 _for = null; 209 lang = null; 210 onblur = null; 211 onclick = null; 212 ondblclick = null; 213 onfocus = null; 214 onkeydown = null; 215 onkeypress = null; 216 onkeyup = null; 217 onmousedown = null; 218 onmousemove = null; 219 onmouseout = null; 220 onmouseover = null; 221 onmouseup = null; 222 style = null; 223 styleClass = null; 224 tabindex = null; 225 title = null; 226 } 227 } 228 | Popular Tags |