1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kns.web.ui; |
17 | |
|
18 | |
import org.kuali.rice.core.web.format.Formatter; |
19 | |
import org.kuali.rice.kns.lookup.HtmlData; |
20 | |
import org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData; |
21 | |
import org.kuali.rice.kns.lookup.HtmlData.MultipleAnchorHtmlData; |
22 | |
|
23 | |
import java.util.ArrayList; |
24 | |
import java.util.Comparator; |
25 | |
import java.util.List; |
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
@Deprecated |
33 | |
public class Column implements java.io.Serializable, PropertyRenderingConfigElement { |
34 | |
private static final long serialVersionUID = -5916942413570667803L; |
35 | |
private String columnTitle; |
36 | 0 | private String sortable = "true"; |
37 | |
private String propertyName; |
38 | |
private String propertyValue; |
39 | |
private Object unformattedPropertyValue; |
40 | |
private String propertyURL; |
41 | |
private HtmlData columnAnchor; |
42 | |
private Formatter formatter; |
43 | |
private Comparator comparator; |
44 | 0 | private boolean escapeXMLValue=true; |
45 | |
|
46 | |
private String alternateDisplayPropertyName; |
47 | |
private String additionalDisplayPropertyName; |
48 | |
|
49 | |
private boolean total; |
50 | |
|
51 | |
|
52 | |
|
53 | |
|
54 | |
private Comparator valueComparator; |
55 | |
|
56 | |
|
57 | |
|
58 | |
|
59 | |
|
60 | |
private int maxLength; |
61 | |
|
62 | 0 | public Column() { |
63 | 0 | } |
64 | |
|
65 | 0 | public Column(String columnTitle, String propertyName) { |
66 | 0 | this.columnTitle = columnTitle; |
67 | 0 | this.propertyName = propertyName; |
68 | 0 | } |
69 | |
|
70 | 0 | public Column(String columnTitle, String sortable, String propertyName) { |
71 | 0 | this.columnTitle = columnTitle; |
72 | 0 | this.sortable = sortable; |
73 | 0 | this.propertyName = propertyName; |
74 | 0 | } |
75 | |
|
76 | |
public Column(String columnTitle, String sortable, String propertyName, Comparator comparator) { |
77 | 0 | this(columnTitle, sortable, propertyName); |
78 | 0 | this.comparator = comparator; |
79 | 0 | } |
80 | |
|
81 | 0 | public Column(String columnTitle, String propertyName, Formatter formatter) { |
82 | 0 | this.columnTitle = columnTitle; |
83 | 0 | this.propertyName = propertyName; |
84 | 0 | this.formatter = formatter; |
85 | 0 | } |
86 | |
|
87 | |
|
88 | |
|
89 | |
|
90 | |
public Comparator getComparator() { |
91 | 0 | return comparator; |
92 | |
} |
93 | |
|
94 | |
|
95 | |
|
96 | |
|
97 | |
|
98 | |
public void setComparator(Comparator comparator) { |
99 | 0 | this.comparator = comparator; |
100 | 0 | } |
101 | |
|
102 | |
|
103 | |
|
104 | |
|
105 | |
|
106 | |
public String getColumnTitle() { |
107 | 0 | return columnTitle; |
108 | |
} |
109 | |
|
110 | |
|
111 | |
|
112 | |
|
113 | |
|
114 | |
public void setColumnTitle(String columnTitle) { |
115 | 0 | this.columnTitle = columnTitle; |
116 | 0 | } |
117 | |
|
118 | |
|
119 | |
|
120 | |
|
121 | |
|
122 | |
public String getPropertyName() { |
123 | 0 | return propertyName; |
124 | |
} |
125 | |
|
126 | |
|
127 | |
|
128 | |
|
129 | |
|
130 | |
public void setPropertyName(String propertyName) { |
131 | 0 | this.propertyName = propertyName; |
132 | 0 | } |
133 | |
|
134 | |
|
135 | |
|
136 | |
|
137 | |
|
138 | |
public String getSortable() { |
139 | 0 | return sortable; |
140 | |
} |
141 | |
|
142 | |
|
143 | |
|
144 | |
|
145 | |
|
146 | |
public void setSortable(String sortable) { |
147 | 0 | this.sortable = sortable; |
148 | 0 | } |
149 | |
|
150 | |
|
151 | |
|
152 | |
|
153 | |
|
154 | |
public String getPropertyURL() { |
155 | 0 | return propertyURL; |
156 | |
} |
157 | |
|
158 | |
|
159 | |
|
160 | |
|
161 | |
|
162 | |
public void setPropertyURL(String propertyURL) { |
163 | 0 | this.propertyURL = propertyURL; |
164 | 0 | } |
165 | |
|
166 | |
|
167 | |
|
168 | |
|
169 | |
public HtmlData getColumnAnchor() { |
170 | 0 | return this.columnAnchor; |
171 | |
} |
172 | |
|
173 | |
public boolean isMultipleAnchors(){ |
174 | 0 | return this.columnAnchor instanceof MultipleAnchorHtmlData; |
175 | |
} |
176 | |
|
177 | |
public List<AnchorHtmlData> getColumnAnchors(){ |
178 | 0 | if(isMultipleAnchors()) |
179 | 0 | return ((MultipleAnchorHtmlData)this.columnAnchor).getAnchorHtmlData(); |
180 | 0 | List<AnchorHtmlData> htmlData = new ArrayList<AnchorHtmlData>(); |
181 | 0 | htmlData.add((AnchorHtmlData)columnAnchor); |
182 | 0 | return htmlData; |
183 | |
} |
184 | |
|
185 | |
public int getNumberOfColumnAnchors(){ |
186 | 0 | return getColumnAnchors().size(); |
187 | |
} |
188 | |
|
189 | |
|
190 | |
|
191 | |
|
192 | |
public void setColumnAnchor(HtmlData columnAnchor) { |
193 | 0 | this.columnAnchor = columnAnchor; |
194 | 0 | if(columnAnchor!=null) |
195 | 0 | setPropertyURL(((AnchorHtmlData)columnAnchor).getHref()); |
196 | 0 | } |
197 | |
|
198 | |
|
199 | |
|
200 | |
|
201 | |
public String getPropertyValue() { |
202 | 0 | return propertyValue; |
203 | |
} |
204 | |
|
205 | |
|
206 | |
|
207 | |
|
208 | |
|
209 | |
public void setPropertyValue(String propertyValue) { |
210 | 0 | this.propertyValue = propertyValue; |
211 | 0 | } |
212 | |
|
213 | |
|
214 | |
|
215 | |
|
216 | |
public Formatter getFormatter() { |
217 | 0 | return formatter; |
218 | |
} |
219 | |
|
220 | |
|
221 | |
|
222 | |
|
223 | |
|
224 | |
public void setFormatter(Formatter formatter) { |
225 | 0 | this.formatter = formatter; |
226 | 0 | } |
227 | |
|
228 | |
public Comparator getValueComparator() { |
229 | 0 | return valueComparator; |
230 | |
} |
231 | |
|
232 | |
public void setValueComparator(Comparator valueComparator) { |
233 | 0 | this.valueComparator = valueComparator; |
234 | 0 | } |
235 | |
|
236 | |
|
237 | |
|
238 | |
|
239 | |
|
240 | |
|
241 | |
public int getMaxLength() { |
242 | 0 | return maxLength; |
243 | |
} |
244 | |
|
245 | |
|
246 | |
|
247 | |
|
248 | |
|
249 | |
|
250 | |
public void setMaxLength(int maxColumnLength) { |
251 | 0 | this.maxLength = maxColumnLength; |
252 | 0 | } |
253 | |
|
254 | |
|
255 | |
|
256 | |
|
257 | |
public boolean isEscapeXMLValue() { |
258 | 0 | return this.escapeXMLValue; |
259 | |
} |
260 | |
|
261 | |
|
262 | |
|
263 | |
|
264 | |
public void setEscapeXMLValue(boolean escapeXMLValue) { |
265 | 0 | this.escapeXMLValue = escapeXMLValue; |
266 | 0 | } |
267 | |
|
268 | |
public String getAlternateDisplayPropertyName() { |
269 | 0 | return this.alternateDisplayPropertyName; |
270 | |
} |
271 | |
|
272 | |
public void setAlternateDisplayPropertyName(String alternateDisplayPropertyName) { |
273 | 0 | this.alternateDisplayPropertyName = alternateDisplayPropertyName; |
274 | 0 | } |
275 | |
|
276 | |
public String getAdditionalDisplayPropertyName() { |
277 | 0 | return this.additionalDisplayPropertyName; |
278 | |
} |
279 | |
|
280 | |
public void setAdditionalDisplayPropertyName(String additionalDisplayPropertyName) { |
281 | 0 | this.additionalDisplayPropertyName = additionalDisplayPropertyName; |
282 | 0 | } |
283 | |
|
284 | |
public boolean isTotal() { |
285 | 0 | return this.total; |
286 | |
} |
287 | |
|
288 | |
public void setTotal(boolean total) { |
289 | 0 | this.total = total; |
290 | 0 | } |
291 | |
|
292 | |
public Object getUnformattedPropertyValue() { |
293 | 0 | return this.unformattedPropertyValue; |
294 | |
} |
295 | |
|
296 | |
public void setUnformattedPropertyValue(Object unformattedPropertyValue) { |
297 | 0 | this.unformattedPropertyValue = unformattedPropertyValue; |
298 | 0 | } |
299 | |
|
300 | |
} |