Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
GridColumn |
|
| 1.0;1 |
1 | package net.sf.jolene.dom; | |
2 | ||
3 | /** | |
4 | * A grid column object. This is used to define the columns that the grid will display. The columns define the | |
5 | * header text, width, align and cell object. The cell object can be any of the HTMLElement objects. Cell objects | |
6 | * render the object in the grid cell instead of just text. Commonly this would be used to display checkboxes in | |
7 | * the grid. | |
8 | * | |
9 | * @author Dan Howard | |
10 | * @since Oct 11, 2005 Time: 6:51:04 PM | |
11 | */ | |
12 | public final class GridColumn { | |
13 | ||
14 | private String width; | |
15 | private String header; | |
16 | private String align; //@todo does not work. Assigns to the header only! | |
17 | private HTMLElement cellObject; | |
18 | ||
19 | /** | |
20 | * Default constructor. | |
21 | */ | |
22 | 9 | public GridColumn() { |
23 | 9 | width = ""; |
24 | 9 | header = ""; |
25 | 9 | align = ""; |
26 | 9 | cellObject = null; |
27 | 9 | } |
28 | ||
29 | /** | |
30 | * Constructs a GridColumn using a header string and a width string. | |
31 | * | |
32 | * @param header header string for the column. | |
33 | * @param width width of the column. | |
34 | */ | |
35 | public GridColumn(String header, String width) { | |
36 | 9 | this(); |
37 | 9 | this.header = header; |
38 | 9 | this.width = width; |
39 | 9 | } |
40 | ||
41 | /** | |
42 | * Return the align for the column. | |
43 | * | |
44 | * @return Alignment of the column. | |
45 | */ | |
46 | public String getAlign() { | |
47 | 27 | return align; |
48 | } | |
49 | ||
50 | ||
51 | /** | |
52 | * Gets the CellObject for the column. | |
53 | * | |
54 | * @return HTMLElement cell object. | |
55 | */ | |
56 | public HTMLElement getCellObject() { | |
57 | 49 | return cellObject; |
58 | } | |
59 | ||
60 | /** | |
61 | * Returns the column header string. | |
62 | * | |
63 | * @return Header of the column. | |
64 | */ | |
65 | public String getHeader() { | |
66 | 27 | return header; |
67 | } | |
68 | ||
69 | /** | |
70 | * Returns the column width. | |
71 | * | |
72 | * @return Width of the column. | |
73 | */ | |
74 | public String getWidth() { | |
75 | 36 | return width; |
76 | } | |
77 | ||
78 | /** | |
79 | * Sets the column align. | |
80 | * | |
81 | * @param align Alignment of the column. | |
82 | */ | |
83 | public void setAlign(String align) { | |
84 | 0 | this.align = align; |
85 | 0 | } |
86 | ||
87 | /** | |
88 | * Sets the column header. | |
89 | * | |
90 | * @param header Header of the column. | |
91 | */ | |
92 | public void setHeader(String header) { | |
93 | 0 | this.header = header; |
94 | 0 | } |
95 | ||
96 | /** | |
97 | * Sets the CellObject for the column. | |
98 | * | |
99 | * @param cellObject Any HTMLElement object. | |
100 | */ | |
101 | public void setCellObject(HTMLElement cellObject) { | |
102 | 2 | this.cellObject = cellObject; |
103 | 2 | } |
104 | ||
105 | /** | |
106 | * Sets the column width. | |
107 | * | |
108 | * @param width Width of the column. | |
109 | */ | |
110 | public void setWidth(String width) { | |
111 | 0 | this.width = width; |
112 | 0 | } |
113 | ||
114 | } |