KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > faces > taglib > html > OutputLinkTag


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

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 /**
26  * @version CVS $Id: OutputLinkTag.java 46253 2004-09-17 14:36:29Z vgritsenko $
27  */

28 public class OutputLinkTag extends UIComponentTag {
29
30     private String JavaDoc converter;
31     private String JavaDoc value;
32     private String JavaDoc accesskey;
33     private String JavaDoc charset;
34     private String JavaDoc coords;
35     private String JavaDoc dir;
36     private String JavaDoc hreflang;
37     private String JavaDoc lang;
38     private String JavaDoc onblur;
39     private String JavaDoc onclick;
40     private String JavaDoc ondblclick;
41     private String JavaDoc onfocus;
42     private String JavaDoc onkeydown;
43     private String JavaDoc onkeypress;
44     private String JavaDoc onkeyup;
45     private String JavaDoc onmousedown;
46     private String JavaDoc onmousemove;
47     private String JavaDoc onmouseout;
48     private String JavaDoc onmouseover;
49     private String JavaDoc onmouseup;
50     private String JavaDoc rel;
51     private String JavaDoc rev;
52     private String JavaDoc shape;
53     private String JavaDoc style;
54     private String JavaDoc styleClass;
55     private String JavaDoc tabindex;
56     private String JavaDoc target;
57     private String JavaDoc title;
58     private String JavaDoc type;
59
60
61     public void setConverter(String JavaDoc converter) {
62         this.converter = converter;
63     }
64
65     public void setValue(String JavaDoc value) {
66         this.value = value;
67     }
68
69     public void setAccesskey(String JavaDoc accesskey) {
70         this.accesskey = accesskey;
71     }
72
73     public void setCharset(String JavaDoc charset) {
74         this.charset = charset;
75     }
76
77     public void setCoords(String JavaDoc coords) {
78         this.coords = coords;
79     }
80
81     public void setDir(String JavaDoc dir) {
82         this.dir = dir;
83     }
84
85     public void setHreflang(String JavaDoc hreflang) {
86         this.hreflang = hreflang;
87     }
88
89     public void setLang(String JavaDoc lang) {
90         this.lang = lang;
91     }
92
93     public void setOnblur(String JavaDoc onblur) {
94         this.onblur = onblur;
95     }
96
97     public void setOnclick(String JavaDoc onclick) {
98         this.onclick = onclick;
99     }
100
101     public void setOndblclick(String JavaDoc ondblclick) {
102         this.ondblclick = ondblclick;
103     }
104
105     public void setOnfocus(String JavaDoc onfocus) {
106         this.onfocus = onfocus;
107     }
108
109     public void setOnkeydown(String JavaDoc onkeydown) {
110         this.onkeydown = onkeydown;
111     }
112
113     public void setOnkeypress(String JavaDoc onkeypress) {
114         this.onkeypress = onkeypress;
115     }
116
117     public void setOnkeyup(String JavaDoc onkeyup) {
118         this.onkeyup = onkeyup;
119     }
120
121     public void setOnmousedown(String JavaDoc onmousedown) {
122         this.onmousedown = onmousedown;
123     }
124
125     public void setOnmousemove(String JavaDoc onmousemove) {
126         this.onmousemove = onmousemove;
127     }
128
129     public void setOnmouseout(String JavaDoc onmouseout) {
130         this.onmouseout = onmouseout;
131     }
132
133     public void setOnmouseover(String JavaDoc onmouseover) {
134         this.onmouseover = onmouseover;
135     }
136
137     public void setOnmouseup(String JavaDoc onmouseup) {
138         this.onmouseup = onmouseup;
139     }
140
141     public void setRel(String JavaDoc rel) {
142         this.rel = rel;
143     }
144
145     public void setRev(String JavaDoc rev) {
146         this.rev = rev;
147     }
148
149     public void setShape(String JavaDoc shape) {
150         this.shape = shape;
151     }
152
153     public void setStyle(String JavaDoc style) {
154         this.style = style;
155     }
156
157     public void setStyleClass(String JavaDoc styleClass) {
158         this.styleClass = styleClass;
159     }
160
161     public void setTabindex(String JavaDoc tabindex) {
162         this.tabindex = tabindex;
163     }
164
165     public void setTarget(String JavaDoc target) {
166         this.target = target;
167     }
168
169     public void setTitle(String JavaDoc title) {
170         this.title = title;
171     }
172
173     public void setType(String JavaDoc type) {
174         this.type = type;
175     }
176
177     public String JavaDoc getRendererType() {
178         return "javax.faces.Link";
179     }
180
181     public String JavaDoc 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 JavaDoc 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