001: /*
002: * $Id: ELCancelTagBeanInfo.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.ELCancelTag</code> class. It is
032: * needed to override the default mapping of custom tag attribute names to
033: * class attribute names. <p> In particular, it provides for the mapping of
034: * the custom tag attribute <code>disabled</code> to the instance variable
035: * <code>disabledExpr</code>. <p> This is because the value of the unevaluated
036: * EL expression has to be kept separately from the evaluated value, which is
037: * stored in the base class. This is related to the fact that the JSP compiler
038: * can choose to reuse different tag instances if they received the same
039: * original attribute values, and the JSP compiler can choose to not re-call
040: * the setter methods, because it can assume the same values are already set.
041: */
042: public class ELCancelTagBeanInfo extends SimpleBeanInfo {
043: public PropertyDescriptor[] getPropertyDescriptors() {
044: ArrayList proplist = new ArrayList();
045:
046: try {
047: proplist.add(new PropertyDescriptor("accesskey",
048: ELCancelTag.class, null, "setAccesskeyExpr"));
049: } catch (IntrospectionException ex) {
050: }
051:
052: try {
053: proplist.add(new PropertyDescriptor("alt",
054: ELCancelTag.class, null, "setAltExpr"));
055: } catch (IntrospectionException ex) {
056: }
057:
058: try {
059: proplist.add(new PropertyDescriptor("altKey",
060: ELCancelTag.class, null, "setAltKeyExpr"));
061: } catch (IntrospectionException ex) {
062: }
063:
064: try {
065: proplist.add(new PropertyDescriptor("bundle",
066: ELCancelTag.class, null, "setBundleExpr"));
067: } catch (IntrospectionException ex) {
068: }
069:
070: try {
071: proplist.add(new PropertyDescriptor("dir",
072: ELCancelTag.class, null, "setDirExpr"));
073: } catch (IntrospectionException ex) {
074: }
075:
076: try {
077: proplist.add(new PropertyDescriptor("disabled",
078: ELCancelTag.class, null, "setDisabledExpr"));
079: } catch (IntrospectionException ex) {
080: }
081:
082: try {
083: proplist.add(new PropertyDescriptor("lang",
084: ELCancelTag.class, null, "setLangExpr"));
085: } catch (IntrospectionException ex) {
086: }
087:
088: try {
089: proplist.add(new PropertyDescriptor("onblur",
090: ELCancelTag.class, null, "setOnblurExpr"));
091: } catch (IntrospectionException ex) {
092: }
093:
094: try {
095: proplist.add(new PropertyDescriptor("onchange",
096: ELCancelTag.class, null, "setOnchangeExpr"));
097: } catch (IntrospectionException ex) {
098: }
099:
100: try {
101: proplist.add(new PropertyDescriptor("onclick",
102: ELCancelTag.class, null, "setOnclickExpr"));
103: } catch (IntrospectionException ex) {
104: }
105:
106: try {
107: proplist.add(new PropertyDescriptor("ondblclick",
108: ELCancelTag.class, null, "setOndblclickExpr"));
109: } catch (IntrospectionException ex) {
110: }
111:
112: try {
113: proplist.add(new PropertyDescriptor("onfocus",
114: ELCancelTag.class, null, "setOnfocusExpr"));
115: } catch (IntrospectionException ex) {
116: }
117:
118: try {
119: proplist.add(new PropertyDescriptor("onkeydown",
120: ELCancelTag.class, null, "setOnkeydownExpr"));
121: } catch (IntrospectionException ex) {
122: }
123:
124: try {
125: proplist.add(new PropertyDescriptor("onkeypress",
126: ELCancelTag.class, null, "setOnkeypressExpr"));
127: } catch (IntrospectionException ex) {
128: }
129:
130: try {
131: proplist.add(new PropertyDescriptor("onkeyup",
132: ELCancelTag.class, null, "setOnkeyupExpr"));
133: } catch (IntrospectionException ex) {
134: }
135:
136: try {
137: proplist.add(new PropertyDescriptor("onmousedown",
138: ELCancelTag.class, null, "setOnmousedownExpr"));
139: } catch (IntrospectionException ex) {
140: }
141:
142: try {
143: proplist.add(new PropertyDescriptor("onmousemove",
144: ELCancelTag.class, null, "setOnmousemoveExpr"));
145: } catch (IntrospectionException ex) {
146: }
147:
148: try {
149: proplist.add(new PropertyDescriptor("onmouseout",
150: ELCancelTag.class, null, "setOnmouseoutExpr"));
151: } catch (IntrospectionException ex) {
152: }
153:
154: try {
155: proplist.add(new PropertyDescriptor("onmouseover",
156: ELCancelTag.class, null, "setOnmouseoverExpr"));
157: } catch (IntrospectionException ex) {
158: }
159:
160: try {
161: proplist.add(new PropertyDescriptor("onmouseup",
162: ELCancelTag.class, null, "setOnmouseupExpr"));
163: } catch (IntrospectionException ex) {
164: }
165:
166: try {
167: proplist.add(new PropertyDescriptor("property",
168: ELCancelTag.class, null, "setPropertyExpr"));
169: } catch (IntrospectionException ex) {
170: }
171:
172: try {
173: proplist.add(new PropertyDescriptor("style",
174: ELCancelTag.class, null, "setStyleExpr"));
175: } catch (IntrospectionException ex) {
176: }
177:
178: try {
179: proplist.add(new PropertyDescriptor("styleClass",
180: ELCancelTag.class, null, "setStyleClassExpr"));
181: } catch (IntrospectionException ex) {
182: }
183:
184: try {
185: proplist.add(new PropertyDescriptor("styleId",
186: ELCancelTag.class, null, "setStyleIdExpr"));
187: } catch (IntrospectionException ex) {
188: }
189:
190: try {
191: proplist.add(new PropertyDescriptor("tabindex",
192: ELCancelTag.class, null, "setTabindexExpr"));
193: } catch (IntrospectionException ex) {
194: }
195:
196: try {
197: proplist.add(new PropertyDescriptor("title",
198: ELCancelTag.class, null, "setTitleExpr"));
199: } catch (IntrospectionException ex) {
200: }
201:
202: try {
203: proplist.add(new PropertyDescriptor("titleKey",
204: ELCancelTag.class, null, "setTitleKeyExpr"));
205: } catch (IntrospectionException ex) {
206: }
207:
208: try {
209: proplist.add(new PropertyDescriptor("value",
210: ELCancelTag.class, null, "setValueExpr"));
211: } catch (IntrospectionException ex) {
212: }
213:
214: PropertyDescriptor[] result = new PropertyDescriptor[proplist
215: .size()];
216:
217: return ((PropertyDescriptor[]) proplist.toArray(result));
218: }
219: }
|