KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > taglib > html > HtmlCommandLinkTagBase


1 /*
2  * Copyright 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.myfaces.taglib.html;
17
18 import org.apache.myfaces.renderkit.JSFAttr;
19 import org.apache.myfaces.renderkit.html.HTML;
20
21 import javax.faces.component.UIComponent;
22
23 /**
24  * @author Manfred Geiler (latest modification by $Author: matzew $)
25  * @author Martin Marinschek
26  * @version $Revision: 1.5 $ $Date: 2005/02/18 18:24:35 $
27  * $Log: HtmlCommandLinkTagBase.java,v $
28  * Revision 1.5 2005/02/18 18:24:35 matzew
29  * added release() to tag clazzes.
30  *
31  * Revision 1.4 2004/10/13 11:51:01 matze
32  * renamed packages to org.apache
33  *
34  * Revision 1.3 2004/07/01 22:01:11 mwessendorf
35  * ASF switch
36  *
37  * Revision 1.2 2004/04/29 18:51:35 o_rossmueller
38  * moved 'target' attribute to standard htmlCommandLink
39  *
40  * Revision 1.1 2004/03/31 11:58:44 manolito
41  * custom component refactoring
42  *
43  */

44 public abstract class HtmlCommandLinkTagBase
45     extends HtmlComponentTagBase
46 {
47     //private static final Log log = LogFactory.getLog(HtmlCommandLinkTag.class);
48

49     // UIComponent attributes --> already implemented in UIComponentTagBase
50

51     // user role attributes --> already implemented in UIComponentTagBase
52

53     // HTML universal attributes --> already implemented in HtmlComponentTagBase
54

55     // HTML event handler attributes --> already implemented in HtmlComponentTagBase
56

57     // HTML anchor attributes relevant for command link
58
private String JavaDoc _accesskey;
59     private String JavaDoc _charset;
60     private String JavaDoc _coords;
61     private String JavaDoc _hreflang;
62     private String JavaDoc _rel;
63     private String JavaDoc _rev;
64     private String JavaDoc _shape;
65     private String JavaDoc _tabindex;
66     private String JavaDoc _type;
67     private String JavaDoc _target;
68     //HtmlCommandLink Attributes
69
//FIXME: is mentioned in JSF API, but is no official anchor-attribute of HTML 4.0... what to do?
70
private String JavaDoc _onblur;
71     //FIXME: is mentioned in JSF API, but is no official anchor-attribute of HTML 4.0... what to do?
72
private String JavaDoc _onfocus;
73
74     // UICommand attributes
75
private String JavaDoc _action;
76     private String JavaDoc _immediate;
77     private String JavaDoc _actionListener;
78     
79     public void release() {
80         super.release();
81         _accesskey=null;
82         _charset=null;
83         _coords=null;
84         _hreflang=null;
85         _rel=null;
86         _rev=null;
87         _shape=null;
88         _tabindex=null;
89         _type=null;
90         _target=null;
91         _onblur=null;
92         _onfocus=null;
93         _action=null;
94         _immediate=null;
95         _actionListener=null;
96     }
97
98     protected void setProperties(UIComponent component)
99     {
100         super.setProperties(component);
101
102         setStringProperty(component, HTML.ACCESSKEY_ATTR, _accesskey);
103         setStringProperty(component, HTML.CHARSET_ATTR, _charset);
104         setStringProperty(component, HTML.COORDS_ATTR, _coords);
105         setStringProperty(component, HTML.HREFLANG_ATTR, _hreflang);
106         setStringProperty(component, HTML.REL_ATTR, _rel);
107         setStringProperty(component, HTML.REV_ATTR, _rev);
108         setStringProperty(component, HTML.SHAPE_ATTR, _shape);
109         setStringProperty(component, HTML.TABINDEX_ATTR, _tabindex);
110         setStringProperty(component, HTML.TYPE_ATTR, _type);
111         setStringProperty(component, HTML.ONBLUR_ATTR, _onblur);
112         setStringProperty(component, HTML.ONFOCUS_ATTR, _onfocus);
113         setStringProperty(component, HTML.TARGET_ATTR, _target);
114         setActionProperty(component, _action);
115         setActionListenerProperty(component, _actionListener);
116         setBooleanProperty(component, JSFAttr.IMMEDIATE_ATTR, _immediate);
117    }
118
119     public void setAccesskey(String JavaDoc accesskey)
120     {
121         _accesskey = accesskey;
122     }
123
124     public void setCharset(String JavaDoc charset)
125     {
126         _charset = charset;
127     }
128
129     public void setCoords(String JavaDoc coords)
130     {
131         _coords = coords;
132     }
133
134     public void setHreflang(String JavaDoc hreflang)
135     {
136         _hreflang = hreflang;
137     }
138
139     public void setOnblur(String JavaDoc onblur)
140     {
141         _onblur = onblur;
142     }
143
144     public void setOnfocus(String JavaDoc onfocus)
145     {
146         _onfocus = onfocus;
147     }
148
149     public void setRel(String JavaDoc rel)
150     {
151         _rel = rel;
152     }
153
154     public void setRev(String JavaDoc rev)
155     {
156         _rev = rev;
157     }
158
159     public void setShape(String JavaDoc shape)
160     {
161         _shape = shape;
162     }
163
164     public void setTabindex(String JavaDoc tabindex)
165     {
166         _tabindex = tabindex;
167     }
168
169     public void setType(String JavaDoc type)
170     {
171         _type = type;
172     }
173
174     public void setAction(String JavaDoc action)
175     {
176         _action = action;
177     }
178
179     public void setImmediate(String JavaDoc immediate)
180     {
181         _immediate = immediate;
182     }
183
184     public void setActionListener(String JavaDoc actionListener)
185     {
186         _actionListener = actionListener;
187     }
188
189
190     public void setTarget(String JavaDoc target)
191     {
192         this._target = target;
193     }
194 }
195
Popular Tags