View Javadoc

1   /***
2    * Copyright (c) 2003 held jointly by the individual authors.            
3    *                                                                          
4    * This library is free software; you can redistribute it and/or modify it    
5    * under the terms of the GNU Lesser General Public License as published      
6    * by the Free Software Foundation; either version 2.1 of the License, or 
7    * (at your option) any later version.                                            
8    *                                                                            
9    * This library is distributed in the hope that it will be useful, but 
10   * WITHOUT ANY WARRANTY; with out even the implied warranty of 
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
12   * GNU Lesser General Public License for more details.                                                  
13   *                                                                           
14   * You should have received a copy of the GNU Lesser General Public License   
15   * along with this library;  if not, write to the Free Software Foundation,   
16   * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA.              
17   *                                                                            
18   * > http://www.gnu.org/copyleft/lesser.html                                  
19   * > http://www.opensource.org/licenses/lgpl-license.php
20   */
21  package net.mlw.vlh.web.tag.support;
22  
23  import java.util.List;
24  
25  /*** Holds attributes of a column (title, adapterProperty etc).
26   * It's used to transfer information about the column among the various classes that work with it.
27   *  
28   * @author Matthew L. Wilson 
29   * @version $Revision: 1.4 $ $Date: 2005/11/23 14:36:19 $
30   */
31  public class ColumnInfo
32  {
33     /*** The title of the column. */
34     private String title;
35  
36     /*** The tooltip of the column's title (shown when a mouse pointer is over the title).*/
37     private String toolTip = null;
38  
39     /*** The header of a nested value list. */
40     private List nestedList;
41  
42     /*** The adapter name of the method that returns the value to display. */
43     private String adapterPropertyName;
44  
45     /*** The default sort direction. */
46     private Integer defaultSort;
47  
48     private String attributes;
49  
50     /***
51      * Default no argument bean constructor.
52      *
53      */
54     public ColumnInfo()
55     {
56     }
57  
58     /*** 
59      * Creates a column info with toolTip set to the given value.
60      * 
61      * @param title        The title of the column.
62      * @param toolTip    The tool tip of the column (shown when a mouse pointer is over the title).
63      * @param adapterPropertyName The adapter property name of the method that 
64      *                     returns the value to display.
65      * @param defaultSort  The default sort direction.
66      * @param attributes Other attributes of the resulting tag (e.g. "abbr='an abbreviation' id='myTHId'").
67      * 
68      * @see #ColumnInfo(String, String, Integer, String)
69      */
70     public ColumnInfo(String title, String toolTip, String propertyName, Integer defaultSort, String attributes)
71     {
72        this(title, propertyName, defaultSort, attributes);
73        setToolTip(toolTip);
74     }
75  
76     /*** Default constructor.
77      * 
78      * @param title        The title of the column.
79      * @param adapterPropertyName The adapter property name of the method that 
80      *                     returns the value to display.
81      * @param defaultSort  The default sort direction.
82      */
83     public ColumnInfo(String title, String propertyName, Integer defaultSort, String attributes)
84     {
85        this.title = title;
86        this.adapterPropertyName = propertyName;
87        this.defaultSort = defaultSort;
88        this.attributes = attributes;
89     }
90  
91     /*** Gets the title of the column.
92      * @return The title of the column.
93      */
94     public String getTitle()
95     {
96        return title;
97     }
98  
99     /***
100     * @param title The title to set.
101     */
102    public void setTitle(String title)
103    {
104       this.title = title;
105    }
106 
107    /*** 
108     * Get the tooltip of the column's title (shown when a mouse pointer is over the title).
109     * @return the tooltip of the column's title; returns null if the tooltip wasn't set.
110     * @see net.mlw.vlh.web.tag.DefaultColumnTag#getToolTip()
111     */
112    public String getToolTip()
113    {
114       return toolTip;
115    }
116 
117    /***
118     * @return Returns the nestedList.
119     */
120    public List getNestedList()
121    {
122       return nestedList;
123    }
124 
125    /***
126     * @param nestedList The nestedList to set.
127     */
128    public void setNestedList(List nestedList)
129    {
130       this.nestedList = nestedList;
131    }
132 
133    /***
134     * Set the tooltip of the column's title (shown when a mouse pointer is over the title).
135     * @param toolTip
136     *       The tooltip of the column's title.
137     * @see net.mlw.vlh.web.tag.DefaultColumnTag#getToolTip()
138     */
139    public void setToolTip(String toolTip)
140    {
141       this.toolTip = toolTip;
142    }
143 
144    /*** Gets the adapter property name of the method that returns the value to display.
145     * @return The adapter property name of the method that returns the value to display.
146     */
147    public String getAdapterPropertyName()
148    {
149       return adapterPropertyName;
150    }
151 
152    /***
153     * @param adapterPropertyName The adapterPropertyName to set.
154     */
155    public void setAdapterPropertyName(String adapterPropertyName)
156    {
157       this.adapterPropertyName = adapterPropertyName;
158    }
159 
160    /*** Gets the default sort direction.
161     * @return The default sort direction.
162     */
163    public Integer getDefaultSort()
164    {
165       return defaultSort;
166    }
167 
168    /***
169     * @param defaultSort The defaultSort to set.
170     */
171    public void setDefaultSort(Integer defaultSort)
172    {
173       this.defaultSort = defaultSort;
174    }
175 
176    /***
177     * @return Returns the attributes.
178     */
179    public String getAttributes()
180    {
181       return attributes;
182    }
183 
184    /***
185     * @param attributes The attributes to set.
186     */
187    public void setAttributes(String attributes)
188    {
189       this.attributes = attributes;
190    }
191 }