View Javadoc

1   /***
2    * Licensed under the Artistic License; you may not use this file
3    * except in compliance with the License.
4    * You may obtain a copy of the License at
5    *
6    *      http://displaytag.sourceforge.net/license.html
7    *
8    * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
9    * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
10   * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11   */
12  package org.displaytag.tags.el;
13  
14  import java.beans.IntrospectionException;
15  import java.beans.PropertyDescriptor;
16  import java.beans.SimpleBeanInfo;
17  import java.util.ArrayList;
18  import java.util.List;
19  
20  import org.displaytag.tags.TableTag;
21  
22  
23  /***
24   * BeanInfo descriptor for the <code>ELTableTag</code> class. Unevaluated EL expression has to be kept separately from
25   * the evaluated value, since the JSP compiler can choose to reuse different tag instances if they received the same
26   * original attribute values, and the JSP compiler can choose to not re-call the setter methods.
27   * @author Fabrizio Giustina
28   * @version $Revision: 1.8 $ ($Author: fgiust $)
29   */
30  public class ELTableTagBeanInfo extends SimpleBeanInfo
31  {
32  
33      /***
34       * @see java.beans.BeanInfo#getPropertyDescriptors()
35       */
36      public PropertyDescriptor[] getPropertyDescriptors()
37      {
38          List proplist = new ArrayList();
39  
40          try
41          {
42              proplist.add(new PropertyDescriptor("cellpadding", //$NON-NLS-1$
43                  ELTableTag.class, null, "setCellpadding")); //$NON-NLS-1$
44              proplist.add(new PropertyDescriptor("cellspacing", //$NON-NLS-1$
45                  ELTableTag.class, null, "setCellspacing")); //$NON-NLS-1$ 
46              proplist.add(new PropertyDescriptor("class", //$NON-NLS-1$
47                  ELTableTag.class, null, "setClass")); //$NON-NLS-1$ 
48              proplist.add(new PropertyDescriptor("decorator", //$NON-NLS-1$
49                  ELTableTag.class, null, "setDecorator")); //$NON-NLS-1$ 
50              proplist.add(new PropertyDescriptor("defaultorder", //$NON-NLS-1$
51                  ELTableTag.class, null, "setDefaultorder")); //$NON-NLS-1$ 
52              proplist.add(new PropertyDescriptor("defaultsort", //$NON-NLS-1$
53                  ELTableTag.class, null, "setDefaultsort")); //$NON-NLS-1$ 
54              proplist.add(new PropertyDescriptor("export", //$NON-NLS-1$
55                  ELTableTag.class, null, "setExport")); //$NON-NLS-1$ 
56              proplist.add(new PropertyDescriptor("frame", //$NON-NLS-1$
57                  ELTableTag.class, null, "setFrame")); //$NON-NLS-1$ 
58              proplist.add(new PropertyDescriptor("length", //$NON-NLS-1$
59                  ELTableTag.class, null, "setLength")); //$NON-NLS-1$ 
60              proplist.add(new PropertyDescriptor("name", //$NON-NLS-1$
61                  ELTableTag.class, null, "setName")); //$NON-NLS-1$ 
62              proplist.add(new PropertyDescriptor("offset", //$NON-NLS-1$
63                  ELTableTag.class, null, "setOffset")); //$NON-NLS-1$ 
64              proplist.add(new PropertyDescriptor("pagesize", //$NON-NLS-1$
65                  ELTableTag.class, null, "setPagesize")); //$NON-NLS-1$ 
66              proplist.add(new PropertyDescriptor("requestURI", //$NON-NLS-1$
67                  ELTableTag.class, null, "setRequestURI")); //$NON-NLS-1$ 
68              proplist.add(new PropertyDescriptor("requestURIcontext", //$NON-NLS-1$
69                  ELTableTag.class, null, "setRequestURIcontext")); //$NON-NLS-1$ 
70              proplist.add(new PropertyDescriptor("rules", //$NON-NLS-1$
71                  ELTableTag.class, null, "setRules")); //$NON-NLS-1$ 
72              proplist.add(new PropertyDescriptor("sort", //$NON-NLS-1$
73                  ELTableTag.class, null, "setSort")); //$NON-NLS-1$ 
74              proplist.add(new PropertyDescriptor("style", //$NON-NLS-1$
75                  ELTableTag.class, null, "setStyle")); //$NON-NLS-1$ 
76              proplist.add(new PropertyDescriptor("summary", //$NON-NLS-1$
77                  ELTableTag.class, null, "setSummary")); //$NON-NLS-1$ 
78              proplist.add(new PropertyDescriptor("excludedParams", //$NON-NLS-1$
79                  ELTableTag.class, null, "setExcludedParams")); //$NON-NLS-1$
80              proplist.add(new PropertyDescriptor("id", //$NON-NLS-1$ 
81                  ELTableTag.class, null, "setUid")); //$NON-NLS-1$
82  
83              proplist.add(new PropertyDescriptor("uid", //$NON-NLS-1$ 
84                  ELTableTag.class, null, "setUid")); //$NON-NLS-1$ 
85              proplist.add(new PropertyDescriptor("htmlId", //$NON-NLS-1$ 
86                  ELTableTag.class, null, "setHtmlId")); //$NON-NLS-1$ 
87  
88              // deprecated attributes (not supporting expressions)
89              proplist.add(new PropertyDescriptor("width", //$NON-NLS-1$ 
90                  TableTag.class, null, "setWidth")); //$NON-NLS-1$ 
91              proplist.add(new PropertyDescriptor("styleClass", //$NON-NLS-1$ 
92                  ELTableTag.class, null, "setClass")); //$NON-NLS-1$ 
93  
94              proplist.add(new PropertyDescriptor("border", //$NON-NLS-1$ 
95                  TableTag.class, null, "setBorder")); //$NON-NLS-1$ 
96              proplist.add(new PropertyDescriptor("align", //$NON-NLS-1$ 
97                  TableTag.class, null, "setAlign")); //$NON-NLS-1$ 
98              proplist.add(new PropertyDescriptor("background", //$NON-NLS-1$ 
99                  TableTag.class, null, "setBackground")); //$NON-NLS-1$ 
100             proplist.add(new PropertyDescriptor("bgcolor", //$NON-NLS-1$ 
101                 TableTag.class, null, "setBgcolor")); //$NON-NLS-1$ 
102             proplist.add(new PropertyDescriptor("height", //$NON-NLS-1$ 
103                 TableTag.class, null, "setHeight")); //$NON-NLS-1$ 
104             proplist.add(new PropertyDescriptor("hspace", //$NON-NLS-1$ 
105                 TableTag.class, null, "setHspace")); //$NON-NLS-1$ 
106             proplist.add(new PropertyDescriptor("vspace", //$NON-NLS-1$ 
107                 TableTag.class, null, "setVspace")); //$NON-NLS-1$ 
108 
109         }
110         catch (IntrospectionException ex)
111         {
112             // ignore, this should never happen
113         }
114 
115         PropertyDescriptor[] result = new PropertyDescriptor[proplist.size()];
116         return ((PropertyDescriptor[]) proplist.toArray(result));
117     }
118 
119 }