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 OutputLinkTag extends UIComponentTag { 29 30 private String converter; 31 private String value; 32 private String accesskey; 33 private String charset; 34 private String coords; 35 private String dir; 36 private String hreflang; 37 private String lang; 38 private String onblur; 39 private String onclick; 40 private String ondblclick; 41 private String onfocus; 42 private String onkeydown; 43 private String onkeypress; 44 private String onkeyup; 45 private String onmousedown; 46 private String onmousemove; 47 private String onmouseout; 48 private String onmouseover; 49 private String onmouseup; 50 private String rel; 51 private String rev; 52 private String shape; 53 private String style; 54 private String styleClass; 55 private String tabindex; 56 private String target; 57 private String title; 58 private String type; 59 60 61 public void setConverter(String converter) { 62 this.converter = converter; 63 } 64 65 public void setValue(String value) { 66 this.value = value; 67 } 68 69 public void setAccesskey(String accesskey) { 70 this.accesskey = accesskey; 71 } 72 73 public void setCharset(String charset) { 74 this.charset = charset; 75 } 76 77 public void setCoords(String coords) { 78 this.coords = coords; 79 } 80 81 public void setDir(String dir) { 82 this.dir = dir; 83 } 84 85 public void setHreflang(String hreflang) { 86 this.hreflang = hreflang; 87 } 88 89 public void setLang(String lang) { 90 this.lang = lang; 91 } 92 93 public void setOnblur(String onblur) { 94 this.onblur = onblur; 95 } 96 97 public void setOnclick(String onclick) { 98 this.onclick = onclick; 99 } 100 101 public void setOndblclick(String ondblclick) { 102 this.ondblclick = ondblclick; 103 } 104 105 public void setOnfocus(String onfocus) { 106 this.onfocus = onfocus; 107 } 108 109 public void setOnkeydown(String onkeydown) { 110 this.onkeydown = onkeydown; 111 } 112 113 public void setOnkeypress(String onkeypress) { 114 this.onkeypress = onkeypress; 115 } 116 117 public void setOnkeyup(String onkeyup) { 118 this.onkeyup = onkeyup; 119 } 120 121 public void setOnmousedown(String onmousedown) { 122 this.onmousedown = onmousedown; 123 } 124 125 public void setOnmousemove(String onmousemove) { 126 this.onmousemove = onmousemove; 127 } 128 129 public void setOnmouseout(String onmouseout) { 130 this.onmouseout = onmouseout; 131 } 132 133 public void setOnmouseover(String onmouseover) { 134 this.onmouseover = onmouseover; 135 } 136 137 public void setOnmouseup(String onmouseup) { 138 this.onmouseup = onmouseup; 139 } 140 141 public void setRel(String rel) { 142 this.rel = rel; 143 } 144 145 public void setRev(String rev) { 146 this.rev = rev; 147 } 148 149 public void setShape(String shape) { 150 this.shape = shape; 151 } 152 153 public void setStyle(String style) { 154 this.style = style; 155 } 156 157 public void setStyleClass(String styleClass) { 158 this.styleClass = styleClass; 159 } 160 161 public void setTabindex(String tabindex) { 162 this.tabindex = tabindex; 163 } 164 165 public void setTarget(String target) { 166 this.target = target; 167 } 168 169 public void setTitle(String title) { 170 this.title = title; 171 } 172 173 public void setType(String type) { 174 this.type = type; 175 } 176 177 public String getRendererType() { 178 return "javax.faces.Link"; 179 } 180 181 public String getComponentType() { 182 return "javax.faces.HtmlOutputLink"; 183 } 184 185 186 protected void setProperties(UIComponent component) { 187 super.setProperties(component); 188 189 UIOutput output; 190 try { 191 output = (UIOutput) component; 192 } catch (ClassCastException cce) { 193 throw new FacesException("Tag <" + getClass().getName() + "> expected UIOutput. " + 194 "Got <" + component.getClass().getName() + ">"); 195 } 196 197 if (converter != null) { 198 if (FacesUtils.isExpression(converter)) { 199 output.setValueBinding("converter", createValueBinding(converter)); 200 } else { 201 output.setConverter(getApplication().createConverter(converter)); 202 } 203 } 204 205 if (value != null) { 206 if (FacesUtils.isExpression(value)) { 207 output.setValueBinding("value", createValueBinding(value)); 208 } else { 209 output.setValue(value); 210 } 211 } 212 213 setProperty(component, "accesskey", accesskey); 214 setProperty(component, "charset", charset); 215 setProperty(component, "coords", coords); 216 setProperty(component, "dir", dir); 217 setProperty(component, "hreflang", hreflang); 218 setProperty(component, "lang", lang); 219 setProperty(component, "onblur", onblur); 220 setProperty(component, "onclick", onclick); 221 setProperty(component, "ondblclick", ondblclick); 222 setProperty(component, "onfocus", onfocus); 223 setProperty(component, "onkeydown", onkeydown); 224 setProperty(component, "onkeypress", onkeypress); 225 setProperty(component, "onkeyup", onkeyup); 226 setProperty(component, "onmousedown", onmousedown); 227 setProperty(component, "onmousemove", onmousemove); 228 setProperty(component, "onmouseout", onmouseout); 229 setProperty(component, "onmouseover", onmouseover); 230 setProperty(component, "onmouseup", onmouseup); 231 setProperty(component, "rel", rel); 232 setProperty(component, "rev", rev); 233 setProperty(component, "shape", shape); 234 setProperty(component, "style", style); 235 setProperty(component, "styleClass", styleClass); 236 setProperty(component, "tabindex", tabindex); 237 setProperty(component, "target", target); 238 setProperty(component, "title", title); 239 setProperty(component, "type", type); 240 } 241 242 public void recycle() { 243 super.recycle(); 244 converter = null; 245 value = null; 246 accesskey = null; 247 charset = null; 248 coords = null; 249 dir = null; 250 hreflang = null; 251 lang = null; 252 onblur = null; 253 onclick = null; 254 ondblclick = null; 255 onfocus = null; 256 onkeydown = null; 257 onkeypress = null; 258 onkeyup = null; 259 onmousedown = null; 260 onmousemove = null; 261 onmouseout = null; 262 onmouseover = null; 263 onmouseup = null; 264 rel = null; 265 rev = null; 266 shape = null; 267 style = null; 268 styleClass = null; 269 tabindex = null; 270 target = null; 271 title = null; 272 type = null; 273 } 274 } 275 | Popular Tags |