View Javadoc

1   /*
2    * $Id: AbstractUITag.java 443205 2006-09-14 03:17:51Z mrdon $
3    *
4    * Copyright 2006 The Apache Software Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  package org.apache.struts2.views.jsp.ui;
19  
20  import org.apache.struts2.components.UIBean;
21  import org.apache.struts2.views.jsp.ComponentTagSupport;
22  
23  
24  /***
25   * Abstract base class for all UI tags.
26   *
27   */
28  public abstract class AbstractUITag extends ComponentTagSupport {
29      protected String cssClass;
30      protected String cssStyle;
31      protected String title;
32      protected String disabled;
33      protected String label;
34      protected String labelPosition;
35      protected String requiredposition;
36      protected String name;
37      protected String required;
38      protected String tabindex;
39      protected String value;
40      protected String template;
41      protected String theme;
42      protected String templateDir;
43      protected String onclick;
44      protected String ondblclick;
45      protected String onmousedown;
46      protected String onmouseup;
47      protected String onmouseover;
48      protected String onmousemove;
49      protected String onmouseout;
50      protected String onfocus;
51      protected String onblur;
52      protected String onkeypress;
53      protected String onkeydown;
54      protected String onkeyup;
55      protected String onselect;
56      protected String onchange;
57      protected String accesskey;
58      
59      // tooltip attributes
60      protected String tooltip;
61      protected String tooltipConfig;
62  
63  
64      protected void populateParams() {
65          super.populateParams();
66  
67          UIBean uiBean = (UIBean) component;
68          uiBean.setCssClass(cssClass);
69          uiBean.setCssClass(cssClass);
70          uiBean.setCssStyle(cssStyle);
71          uiBean.setTitle(title);
72          uiBean.setDisabled(disabled);
73          uiBean.setLabel(label);
74          uiBean.setLabelposition(labelPosition);
75          uiBean.setRequiredposition(requiredposition);
76          uiBean.setName(name);
77          uiBean.setRequired(required);
78          uiBean.setTabindex(tabindex);
79          uiBean.setValue(value);
80          uiBean.setTemplate(template);
81          uiBean.setTheme(theme);
82          uiBean.setTemplateDir(templateDir);
83          uiBean.setOnclick(onclick);
84          uiBean.setOndblclick(ondblclick);
85          uiBean.setOnmousedown(onmousedown);
86          uiBean.setOnmouseup(onmouseup);
87          uiBean.setOnmouseover(onmouseover);
88          uiBean.setOnmousemove(onmousemove);
89          uiBean.setOnmouseout(onmouseout);
90          uiBean.setOnfocus(onfocus);
91          uiBean.setOnblur(onblur);
92          uiBean.setOnkeypress(onkeypress);
93          uiBean.setOnkeydown(onkeydown);
94          uiBean.setOnkeyup(onkeyup);
95          uiBean.setOnselect(onselect);
96          uiBean.setOnchange(onchange);
97          uiBean.setTooltip(tooltip);
98          uiBean.setTooltipConfig(tooltipConfig);
99          uiBean.setAccesskey(accesskey);
100     }
101 
102     public void setCssClass(String cssClass) {
103         this.cssClass = cssClass;
104     }
105 
106     public void setCssStyle(String cssStyle) {
107         this.cssStyle = cssStyle;
108     }
109 
110     public void setTitle(String title) {
111         this.title = title;
112     }
113 
114     public void setDisabled(String disabled) {
115         this.disabled = disabled;
116     }
117 
118     public void setLabel(String label) {
119         this.label = label;
120     }
121 
122     public void setLabelposition(String labelPosition) {
123         this.labelPosition = labelPosition;
124     }
125 
126     public void setRequiredposition(String requiredPosition) {
127         this.requiredposition = requiredPosition;
128     }
129 
130     public void setName(String name) {
131         this.name = name;
132     }
133 
134     public void setRequired(String required) {
135         this.required = required;
136     }
137 
138     public void setTabindex(String tabindex) {
139         this.tabindex = tabindex;
140     }
141 
142     public void setValue(String value) {
143         this.value = value;
144     }
145 
146     public void setTemplateDir(String templateDir) {
147     	this.templateDir = templateDir;
148     }
149     
150     public void setTemplate(String template) {
151         this.template = template;
152     }
153 
154     public void setTheme(String theme) {
155         this.theme = theme;
156     }
157 
158     public void setOnclick(String onclick) {
159         this.onclick = onclick;
160     }
161 
162     public void setOndblclick(String ondblclick) {
163         this.ondblclick = ondblclick;
164     }
165 
166     public void setOnmousedown(String onmousedown) {
167         this.onmousedown = onmousedown;
168     }
169 
170     public void setOnmouseup(String onmouseup) {
171         this.onmouseup = onmouseup;
172     }
173 
174     public void setOnmouseover(String onmouseover) {
175         this.onmouseover = onmouseover;
176     }
177 
178     public void setOnmousemove(String onmousemove) {
179         this.onmousemove = onmousemove;
180     }
181 
182     public void setOnmouseout(String onmouseout) {
183         this.onmouseout = onmouseout;
184     }
185 
186     public void setOnfocus(String onfocus) {
187         this.onfocus = onfocus;
188     }
189 
190     public void setOnblur(String onblur) {
191         this.onblur = onblur;
192     }
193 
194     public void setOnkeypress(String onkeypress) {
195         this.onkeypress = onkeypress;
196     }
197 
198     public void setOnkeydown(String onkeydown) {
199         this.onkeydown = onkeydown;
200     }
201 
202     public void setOnkeyup(String onkeyup) {
203         this.onkeyup = onkeyup;
204     }
205 
206     public void setOnselect(String onselect) {
207         this.onselect = onselect;
208     }
209 
210     public void setOnchange(String onchange) {
211         this.onchange = onchange;
212     }
213     
214     public void setTooltip(String tooltip) {
215     	this.tooltip = tooltip;
216     }
217     
218     public void setTooltipConfig(String tooltipConfig) {
219     	this.tooltipConfig = tooltipConfig;
220     }
221     
222     public void setAccesskey(String accesskey) {
223     	this.accesskey = accesskey;
224     }
225 }