View Javadoc

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.html.HTML;
19  import org.apache.myfaces.taglib.UIComponentTagBase;
20  
21  import javax.faces.component.UIComponent;
22  
23  /***
24   * @author Manfred Geiler (latest modification by $Author: grantsmith $)
25   * @version $Revision: 169655 $ $Date: 2005-05-11 16:45:06 +0000 (Wed, 11 May 2005) $
26   */
27  public abstract class HtmlComponentTagBase
28          extends UIComponentTagBase
29  {
30      //private static final Log log = LogFactory.getLog(HtmlComponentTag.class);
31  
32      //HTML universal attributes
33      private String _dir;
34      private String _lang;
35      private String _style;
36      private String _styleClass;
37      private String _title;
38  
39      //HTML event handler attributes
40      private String _onclick;
41      private String _ondblclick;
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  
51      public void release() {
52          super.release();
53  
54          _dir=null;
55          _lang=null;
56          _style=null;
57          _styleClass=null;
58          _title=null;
59          _onclick=null;
60          _ondblclick=null;
61          _onkeydown=null;
62          _onkeypress=null;
63          _onkeyup=null;
64          _onmousedown=null;
65          _onmousemove=null;
66          _onmouseout=null;
67          _onmouseover=null;
68          _onmouseup=null;
69  
70      }
71  
72      protected void setProperties(UIComponent component)
73      {
74          super.setProperties(component);
75          setStringProperty(component, HTML.DIR_ATTR, _dir);
76          setStringProperty(component, HTML.LANG_ATTR, _lang);
77          setStringProperty(component, HTML.STYLE_ATTR, _style);
78          setStringProperty(component, HTML.TITLE_ATTR, _title);
79          setStringProperty(component, HTML.STYLE_CLASS_ATTR, _styleClass);
80          setStringProperty(component, HTML.ONCLICK_ATTR, _onclick);
81          setStringProperty(component, HTML.ONDBLCLICK_ATTR, _ondblclick);
82          setStringProperty(component, HTML.ONMOUSEDOWN_ATTR, _onmousedown);
83          setStringProperty(component, HTML.ONMOUSEUP_ATTR, _onmouseup);
84          setStringProperty(component, HTML.ONMOUSEOVER_ATTR, _onmouseover);
85          setStringProperty(component, HTML.ONMOUSEMOVE_ATTR, _onmousemove);
86          setStringProperty(component, HTML.ONMOUSEOUT_ATTR, _onmouseout);
87          setStringProperty(component, HTML.ONKEYPRESS_ATTR, _onkeypress);
88          setStringProperty(component, HTML.ONKEYDOWN_ATTR, _onkeydown);
89          setStringProperty(component, HTML.ONKEYUP_ATTR, _onkeyup);
90      }
91  
92      public void setStyleClass(String styleClass)
93      {
94          _styleClass = styleClass;
95      }
96  
97      public void setDir(String dir)
98      {
99          _dir = dir;
100     }
101 
102     public void setLang(String lang)
103     {
104         _lang = lang;
105     }
106 
107     public void setStyle(String style)
108     {
109         _style = style;
110     }
111 
112     public void setTitle(String title)
113     {
114         _title = title;
115     }
116 
117     public void setOnclick(String onclick)
118     {
119         _onclick = onclick;
120     }
121 
122     public void setOndblclick(String ondblclick)
123     {
124         _ondblclick = ondblclick;
125     }
126 
127     public void setOnmousedown(String onmousedown)
128     {
129         _onmousedown = onmousedown;
130     }
131 
132     public void setOnmouseup(String onmouseup)
133     {
134         _onmouseup = onmouseup;
135     }
136 
137     public void setOnmouseover(String onmouseover)
138     {
139         _onmouseover = onmouseover;
140     }
141 
142     public void setOnmousemove(String onmousemove)
143     {
144         _onmousemove = onmousemove;
145     }
146 
147     public void setOnmouseout(String onmouseout)
148     {
149         _onmouseout = onmouseout;
150     }
151 
152     public void setOnkeypress(String onkeypress)
153     {
154         _onkeypress = onkeypress;
155     }
156 
157     public void setOnkeydown(String onkeydown)
158     {
159         _onkeydown = onkeydown;
160     }
161 
162     public void setOnkeyup(String onkeyup)
163     {
164         _onkeyup = onkeyup;
165     }
166 }