001: /*
002: * $Id: ELTextTagBeanInfo.java 479635 2006-11-27 14:27:18Z pbenedict $
003: *
004: * Licensed to the Apache Software Foundation (ASF) under one
005: * or more contributor license agreements. See the NOTICE file
006: * distributed with this work for additional information
007: * regarding copyright ownership. The ASF licenses this file
008: * to you under the Apache License, Version 2.0 (the
009: * "License"); you may not use this file except in compliance
010: * with the License. You may obtain a copy of the License at
011: *
012: * http://www.apache.org/licenses/LICENSE-2.0
013: *
014: * Unless required by applicable law or agreed to in writing,
015: * software distributed under the License is distributed on an
016: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017: * KIND, either express or implied. See the License for the
018: * specific language governing permissions and limitations
019: * under the License.
020: */
021: package org.apache.strutsel.taglib.html;
022:
023: import java.beans.IntrospectionException;
024: import java.beans.PropertyDescriptor;
025: import java.beans.SimpleBeanInfo;
026:
027: import java.util.ArrayList;
028:
029: /**
030: * This is the <code>BeanInfo</code> descriptor for the
031: * <code>org.apache.strutsel.taglib.html.ELTextTag</code> class. It is needed
032: * to override the default mapping of custom tag attribute names to class
033: * attribute names. <p> This is because the value of the unevaluated EL
034: * expression has to be kept separately from the evaluated value, which is
035: * stored in the base class. This is related to the fact that the JSP compiler
036: * can choose to reuse different tag instances if they received the same
037: * original attribute values, and the JSP compiler can choose to not re-call
038: * the setter methods, because it can assume the same values are already set.
039: */
040: public class ELTextTagBeanInfo extends SimpleBeanInfo {
041: public PropertyDescriptor[] getPropertyDescriptors() {
042: ArrayList proplist = new ArrayList();
043:
044: try {
045: proplist.add(new PropertyDescriptor("accesskey",
046: ELTextTag.class, null, "setAccesskeyExpr"));
047: } catch (IntrospectionException ex) {
048: }
049:
050: try {
051: proplist.add(new PropertyDescriptor("alt", ELTextTag.class,
052: null, "setAltExpr"));
053: } catch (IntrospectionException ex) {
054: }
055:
056: try {
057: proplist.add(new PropertyDescriptor("altKey",
058: ELTextTag.class, null, "setAltKeyExpr"));
059: } catch (IntrospectionException ex) {
060: }
061:
062: try {
063: proplist.add(new PropertyDescriptor("bundle",
064: ELTextTag.class, null, "setBundleExpr"));
065: } catch (IntrospectionException ex) {
066: }
067:
068: try {
069: proplist.add(new PropertyDescriptor("dir", ELTextTag.class,
070: null, "setDirExpr"));
071: } catch (IntrospectionException ex) {
072: }
073:
074: try {
075: proplist.add(new PropertyDescriptor("disabled",
076: ELTextTag.class, null, "setDisabledExpr"));
077: } catch (IntrospectionException ex) {
078: }
079:
080: try {
081: proplist.add(new PropertyDescriptor("errorKey",
082: ELTextTag.class, null, "setErrorKeyExpr"));
083: } catch (IntrospectionException ex) {
084: }
085:
086: try {
087: proplist.add(new PropertyDescriptor("errorStyle",
088: ELTextTag.class, null, "setErrorStyleExpr"));
089: } catch (IntrospectionException ex) {
090: }
091:
092: try {
093: proplist.add(new PropertyDescriptor("errorStyleClass",
094: ELTextTag.class, null, "setErrorStyleClassExpr"));
095: } catch (IntrospectionException ex) {
096: }
097:
098: try {
099: proplist.add(new PropertyDescriptor("errorStyleId",
100: ELTextTag.class, null, "setErrorStyleIdExpr"));
101: } catch (IntrospectionException ex) {
102: }
103:
104: try {
105: proplist.add(new PropertyDescriptor("indexed",
106: ELTextTag.class, null, "setIndexedExpr"));
107: } catch (IntrospectionException ex) {
108: }
109:
110: try {
111: proplist.add(new PropertyDescriptor("lang",
112: ELTextTag.class, null, "setLangExpr"));
113: } catch (IntrospectionException ex) {
114: }
115:
116: try {
117: proplist.add(new PropertyDescriptor("maxlength",
118: ELTextTag.class, null, "setMaxlengthExpr"));
119: } catch (IntrospectionException ex) {
120: }
121:
122: try {
123: proplist.add(new PropertyDescriptor("name",
124: ELTextTag.class, null, "setNameExpr"));
125: } catch (IntrospectionException ex) {
126: }
127:
128: try {
129: proplist.add(new PropertyDescriptor("onblur",
130: ELTextTag.class, null, "setOnblurExpr"));
131: } catch (IntrospectionException ex) {
132: }
133:
134: try {
135: proplist.add(new PropertyDescriptor("onchange",
136: ELTextTag.class, null, "setOnchangeExpr"));
137: } catch (IntrospectionException ex) {
138: }
139:
140: try {
141: proplist.add(new PropertyDescriptor("onclick",
142: ELTextTag.class, null, "setOnclickExpr"));
143: } catch (IntrospectionException ex) {
144: }
145:
146: try {
147: proplist.add(new PropertyDescriptor("ondblclick",
148: ELTextTag.class, null, "setOndblclickExpr"));
149: } catch (IntrospectionException ex) {
150: }
151:
152: try {
153: proplist.add(new PropertyDescriptor("onfocus",
154: ELTextTag.class, null, "setOnfocusExpr"));
155: } catch (IntrospectionException ex) {
156: }
157:
158: try {
159: proplist.add(new PropertyDescriptor("onkeydown",
160: ELTextTag.class, null, "setOnkeydownExpr"));
161: } catch (IntrospectionException ex) {
162: }
163:
164: try {
165: proplist.add(new PropertyDescriptor("onkeypress",
166: ELTextTag.class, null, "setOnkeypressExpr"));
167: } catch (IntrospectionException ex) {
168: }
169:
170: try {
171: proplist.add(new PropertyDescriptor("onkeyup",
172: ELTextTag.class, null, "setOnkeyupExpr"));
173: } catch (IntrospectionException ex) {
174: }
175:
176: try {
177: proplist.add(new PropertyDescriptor("onmousedown",
178: ELTextTag.class, null, "setOnmousedownExpr"));
179: } catch (IntrospectionException ex) {
180: }
181:
182: try {
183: proplist.add(new PropertyDescriptor("onmousemove",
184: ELTextTag.class, null, "setOnmousemoveExpr"));
185: } catch (IntrospectionException ex) {
186: }
187:
188: try {
189: proplist.add(new PropertyDescriptor("onmouseout",
190: ELTextTag.class, null, "setOnmouseoutExpr"));
191: } catch (IntrospectionException ex) {
192: }
193:
194: try {
195: proplist.add(new PropertyDescriptor("onmouseover",
196: ELTextTag.class, null, "setOnmouseoverExpr"));
197: } catch (IntrospectionException ex) {
198: }
199:
200: try {
201: proplist.add(new PropertyDescriptor("onmouseup",
202: ELTextTag.class, null, "setOnmouseupExpr"));
203: } catch (IntrospectionException ex) {
204: }
205:
206: try {
207: proplist.add(new PropertyDescriptor("onselect",
208: ELTextTag.class, null, "setOnselectExpr"));
209: } catch (IntrospectionException ex) {
210: }
211:
212: try {
213: proplist.add(new PropertyDescriptor("property",
214: ELTextTag.class, null, "setPropertyExpr"));
215: } catch (IntrospectionException ex) {
216: }
217:
218: try {
219: proplist.add(new PropertyDescriptor("readonly",
220: ELTextTag.class, null, "setReadonlyExpr"));
221: } catch (IntrospectionException ex) {
222: }
223:
224: try {
225: proplist.add(new PropertyDescriptor("size",
226: ELTextTag.class, null, "setSizeExpr"));
227: } catch (IntrospectionException ex) {
228: }
229:
230: try {
231: proplist.add(new PropertyDescriptor("style",
232: ELTextTag.class, null, "setStyleExpr"));
233: } catch (IntrospectionException ex) {
234: }
235:
236: try {
237: proplist.add(new PropertyDescriptor("styleClass",
238: ELTextTag.class, null, "setStyleClassExpr"));
239: } catch (IntrospectionException ex) {
240: }
241:
242: try {
243: proplist.add(new PropertyDescriptor("styleId",
244: ELTextTag.class, null, "setStyleIdExpr"));
245: } catch (IntrospectionException ex) {
246: }
247:
248: try {
249: proplist.add(new PropertyDescriptor("tabindex",
250: ELTextTag.class, null, "setTabindexExpr"));
251: } catch (IntrospectionException ex) {
252: }
253:
254: try {
255: proplist.add(new PropertyDescriptor("title",
256: ELTextTag.class, null, "setTitleExpr"));
257: } catch (IntrospectionException ex) {
258: }
259:
260: try {
261: proplist.add(new PropertyDescriptor("titleKey",
262: ELTextTag.class, null, "setTitleKeyExpr"));
263: } catch (IntrospectionException ex) {
264: }
265:
266: try {
267: proplist.add(new PropertyDescriptor("value",
268: ELTextTag.class, null, "setValueExpr"));
269: } catch (IntrospectionException ex) {
270: }
271:
272: PropertyDescriptor[] result = new PropertyDescriptor[proplist
273: .size()];
274:
275: return ((PropertyDescriptor[]) proplist.toArray(result));
276: }
277: }
|