001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.cocoon.faces.taglib.html;
018:
019: import org.apache.cocoon.faces.FacesUtils;
020: import org.apache.cocoon.faces.taglib.UIComponentTag;
021:
022: import javax.faces.FacesException;
023: import javax.faces.component.UIComponent;
024: import javax.faces.component.UIOutput;
025:
026: /**
027: * @version CVS $Id: OutputLinkTag.java 433543 2006-08-22 06:22:54Z crossley $
028: */
029: public class OutputLinkTag extends UIComponentTag {
030:
031: private String converter;
032: private String value;
033: private String accesskey;
034: private String charset;
035: private String coords;
036: private String dir;
037: private String hreflang;
038: private String lang;
039: private String onblur;
040: private String onclick;
041: private String ondblclick;
042: private String onfocus;
043: private String onkeydown;
044: private String onkeypress;
045: private String onkeyup;
046: private String onmousedown;
047: private String onmousemove;
048: private String onmouseout;
049: private String onmouseover;
050: private String onmouseup;
051: private String rel;
052: private String rev;
053: private String shape;
054: private String style;
055: private String styleClass;
056: private String tabindex;
057: private String target;
058: private String title;
059: private String type;
060:
061: public void setConverter(String converter) {
062: this .converter = converter;
063: }
064:
065: public void setValue(String value) {
066: this .value = value;
067: }
068:
069: public void setAccesskey(String accesskey) {
070: this .accesskey = accesskey;
071: }
072:
073: public void setCharset(String charset) {
074: this .charset = charset;
075: }
076:
077: public void setCoords(String coords) {
078: this .coords = coords;
079: }
080:
081: public void setDir(String dir) {
082: this .dir = dir;
083: }
084:
085: public void setHreflang(String hreflang) {
086: this .hreflang = hreflang;
087: }
088:
089: public void setLang(String lang) {
090: this .lang = lang;
091: }
092:
093: public void setOnblur(String onblur) {
094: this .onblur = onblur;
095: }
096:
097: public void setOnclick(String onclick) {
098: this .onclick = onclick;
099: }
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: protected void setProperties(UIComponent component) {
186: super .setProperties(component);
187:
188: UIOutput output;
189: try {
190: output = (UIOutput) component;
191: } catch (ClassCastException cce) {
192: throw new FacesException("Tag <" + getClass().getName()
193: + "> expected UIOutput. " + "Got <"
194: + component.getClass().getName() + ">");
195: }
196:
197: if (converter != null) {
198: if (FacesUtils.isExpression(converter)) {
199: output.setValueBinding("converter",
200: createValueBinding(converter));
201: } else {
202: output.setConverter(getApplication().createConverter(
203: converter));
204: }
205: }
206:
207: if (value != null) {
208: if (FacesUtils.isExpression(value)) {
209: output.setValueBinding("value",
210: createValueBinding(value));
211: } else {
212: output.setValue(value);
213: }
214: }
215:
216: setProperty(component, "accesskey", accesskey);
217: setProperty(component, "charset", charset);
218: setProperty(component, "coords", coords);
219: setProperty(component, "dir", dir);
220: setProperty(component, "hreflang", hreflang);
221: setProperty(component, "lang", lang);
222: setProperty(component, "onblur", onblur);
223: setProperty(component, "onclick", onclick);
224: setProperty(component, "ondblclick", ondblclick);
225: setProperty(component, "onfocus", onfocus);
226: setProperty(component, "onkeydown", onkeydown);
227: setProperty(component, "onkeypress", onkeypress);
228: setProperty(component, "onkeyup", onkeyup);
229: setProperty(component, "onmousedown", onmousedown);
230: setProperty(component, "onmousemove", onmousemove);
231: setProperty(component, "onmouseout", onmouseout);
232: setProperty(component, "onmouseover", onmouseover);
233: setProperty(component, "onmouseup", onmouseup);
234: setProperty(component, "rel", rel);
235: setProperty(component, "rev", rev);
236: setProperty(component, "shape", shape);
237: setProperty(component, "style", style);
238: setProperty(component, "styleClass", styleClass);
239: setProperty(component, "tabindex", tabindex);
240: setProperty(component, "target", target);
241: setProperty(component, "title", title);
242: setProperty(component, "type", type);
243: }
244:
245: public void recycle() {
246: super.recycle();
247: converter = null;
248: value = null;
249: accesskey = null;
250: charset = null;
251: coords = null;
252: dir = null;
253: hreflang = null;
254: lang = null;
255: onblur = null;
256: onclick = null;
257: ondblclick = null;
258: onfocus = null;
259: onkeydown = null;
260: onkeypress = null;
261: onkeyup = null;
262: onmousedown = null;
263: onmousemove = null;
264: onmouseout = null;
265: onmouseover = null;
266: onmouseup = null;
267: rel = null;
268: rev = null;
269: shape = null;
270: style = null;
271: styleClass = null;
272: tabindex = null;
273: target = null;
274: title = null;
275: type = null;
276: }
277: }
|