1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86 package com.ivata.mask.web.tag.html;
87 import java.util.List;
88
89 import javax.servlet.jsp.JspException;
90 /***
91 * <p>
92 * Overrides an HTML <code><input type=submit></code> tag for reseting
93 * the current form, by overriding the class from <strong>Struts </strong>.
94 * </p>
95 *
96 * <p>
97 * <b>Tag attributes: </b> <br/><table cellpadding='2' cellspacing='5'
98 * border='0' align='center' width='85%'>
99 * <tr class='TableHeadingColor'>
100 * <th>attribute</th>
101 * <th>reqd.</th>
102 * <th>param. class</th>
103 * <th width='100%'>description</th>
104 * </tr>
105 * <tr>
106 * <td>fieldName</td>
107 * <td>true</td>
108 * <td><code>java.lang.String</code></td>
109 * <td>The field name is used to default the following attributes of the tag:
110 * <br/>
111 * <ul>
112 * <li><code>styleId</code></li>
113 * <li><code>titleKey</code></li>
114 * <li><code>valueKey</code></li>
115 * </ul>.</td>
116 * </tr>
117 * <tr>
118 * <td>titleKey</td>
119 * <td>true</td>
120 * <td><code>java.lang.String</code></td>
121 * <td>Specifies the localized text to use for mouse-over events.</td>
122 * </tr>
123 * <tr>
124 * <td>valueKey</td>
125 * <td>true</td>
126 * <td><code>java.lang.String</code></td>
127 * <td>Specifies the localized text to use for the button text.</td>
128 * </tr>
129 * </table>
130 * </p>
131 *
132 * <p>
133 * <b>Note: </b> all the tag attributes from {@link
134 * org.apache.struts.taglib.ResetTag Stuts} are included.
135 * </p>
136 *
137 * @since ivata masks 0.4 (2003-01-15)
138 * @author Colin MacLeod
139 * <a href='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
140 * @version $Revision: 1.4 $
141 */
142 public class ResetTag extends org.apache.struts.taglib.html.ResetTag {
143 /***
144 * <p>
145 * Stores and maintains <strong>ivata op </strong> specific mask properties.
146 * </p>
147 */
148 private MaskProperties maskProperties = new MaskProperties();
149 /***
150 * <p>
151 * Overridden to reset mask properties.
152 * </p>
153 *
154 * @return <code>EVAL_PAGE</code> since we always want to evaluate the
155 * page after this tag.
156 *
157 * @throws JspException
158 * if there is an error in the mask properties.
159 *
160 */
161 public int doEndTag() throws JspException {
162 int returnValue = super.doEndTag();
163 maskProperties.reset(this);
164 return returnValue;
165 }
166 /***
167 * <p>
168 * Overridden to set the value and title strings to the values represented
169 * by the localized keys in this class.
170 * </p>
171 *
172 * @return value returned by superclass method.
173 *
174 * @throws JspException
175 * if either <code>valueKey</code> or <code>titleKey</code>
176 * have not been set, or as thrown by superclass method.
177 */
178 public int doStartTag() throws JspException {
179 maskProperties.doStartTag(this, pageContext);
180 return super.doStartTag();
181 }
182 /***
183 * <p>
184 * Calls {@link MaskProperties#getBundleMaskProperites.getBundle}.
185 * </p>
186 *
187 * @return the current value of bundle.
188 */
189 public final String getBundle() {
190 return maskProperties.getBundle();
191 }
192 /***
193 * <p>
194 * Stores and maintains <strong>ivata op </strong> specific mask properties.
195 * </p>
196 *
197 * @return the current value of maskProperties.
198 */
199 public MaskProperties getMaskProperties() {
200 return maskProperties;
201 }
202 public final List getTitleArgs() {
203 return maskProperties.getTitleArgs();
204 }
205 /***
206 * <p>
207 * Get the value of the key used to localize the title tag attribute.
208 * </p>
209 *
210 * @return the current value of titleKey.
211 */
212 public String getTitleKey() {
213 return maskProperties.getValueKey();
214 }
215 public final List getValueArgs() {
216 return maskProperties.getValueArgs();
217 }
218 /***
219 * <p>
220 * Get the value of the key used to localize the value tag attribute.
221 * </p>
222 *
223 * @return the current value of valueKey.
224 */
225 public String getValueKey() {
226 return maskProperties.getValueKey();
227 }
228 /***
229 * <p>
230 * >Name of the field to which this label refers. This is used in
231 * conjunction with the <code>resourceFieldPath</code> to retrieve the
232 * correct message resources path.
233 * </p>
234 *
235 * @param fieldName
236 * the new value of fieldName.
237 */
238 public void setFieldName(final String fieldName) {
239 maskProperties.setFieldName(fieldName);
240 }
241 /***
242 * <p>
243 * Stores and maintains <strong>ivata op </strong> specific mask properties.
244 * </p>
245 *
246 * @param maskPropertiesParam
247 * the new value of maskProperties.
248 */
249 public void setMaskProperties(final MaskProperties maskPropertiesParam) {
250 this.maskProperties = maskPropertiesParam;
251 }
252 /***
253 * Refer to {@link MaskProperties#setTitleArgs}.
254 *
255 * @param args Refer to {@link MaskProperties#setTitleArgs}.
256 */
257 public final void setTitleArgs(final List args) {
258 maskProperties.setTitleArgs(args);
259 }
260 /***
261 * <p>
262 * Set the value of the key used to localize the title tag attribute.
263 * </p>
264 *
265 * @param titleKey
266 * the new value of titleKey.
267 */
268 public final void setTitleKey(final String titleKey) {
269 maskProperties.setTitleKey(titleKey);
270 }
271 /***
272 * Refer to {@link MaskProperties#setValueArgs}.
273 *
274 * @param args Refer to {@link MaskProperties#setValueArgs}.
275 */
276 public final void setValueArgs(final List args) {
277 maskProperties.setValueArgs(args);
278 }
279 /***
280 * <p>
281 * Set the value of the key used to localize the value tag attribute.
282 * </p>
283 *
284 * @param valueKey
285 * the new value of valueKey.
286 */
287 public void setValueKey(final String valueKey) {
288 maskProperties.setValueKey(valueKey);
289 }
290 }
291