1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.gwtwidgets.client.ui.pagination;
18
19 /***
20 * Column to be added as a header to the table. If a property is provided, the
21 * column will be sortable. The property can be any you will use to sort the
22 * results when results from a new page are retrieved.
23 *
24 * @author Joe Toth (joetoth@gmail.com)
25 *
26 */
27 public class Column {
28
29 String title;
30
31 String parameter;
32
33 boolean sortable;
34
35 /***
36 * Use this constructor if you do not want the column to be sortable.
37 *
38 * @param title
39 */
40 public Column(String title) {
41 this.title = title;
42 }
43
44 /***
45 * Use this constructor if you want the column to be sortable.
46 *
47 * @param title
48 * Column Header
49 * @param parameter
50 * The underlying parameter is used to represent this column in
51 * JDBC / EJB / Hibernate / etc. It can also be used to store and
52 * send any extra data needed to perform the sort.
53 */
54 public Column(String title, String parameter) {
55 this(title);
56 this.parameter = parameter;
57 this.sortable = true;
58 }
59
60 public String getParameter() {
61 return parameter;
62 }
63
64 public void setParameter(String parameter) {
65 this.parameter = parameter;
66 this.sortable = true;
67 }
68
69 public String getTitle() {
70 return title;
71 }
72
73 public void setTitle(String title) {
74 this.title = title;
75 }
76
77 public boolean isSortable() {
78 return sortable;
79 }
80
81 }