|
@@ -1 +1,105 @@ |
1 |
|
- |
// This Source Code is Copyright & Licenced as indicated below |
2 |
1 |
|
* Copyright 2007 Google Inc. |
3 |
2 |
|
* |
4 |
3 |
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
5 |
4 |
|
* use this file except in compliance with the License. You may obtain a copy of |
6 |
5 |
|
* the License at |
7 |
6 |
|
* |
8 |
7 |
|
* http://www.apache.org/licenses/LICENSE-2.0 |
9 |
8 |
|
* |
10 |
9 |
|
* Unless required by applicable law or agreed to in writing, software |
11 |
10 |
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
12 |
11 |
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
13 |
12 |
|
* License for the specific language governing permissions and limitations under |
14 |
13 |
|
* the License. |
15 |
14 |
|
*/ |
16 |
15 |
|
* Public class DatePickerCell is being used by DatePicker class to keep |
17 |
16 |
|
* the labels of controls and dates in the grid. It has the facility to attach |
18 |
17 |
|
* and retrieve integer type and value fields. The type and value fields |
19 |
18 |
|
* could be used by DatePicker to attach the type and specific nature of |
20 |
19 |
|
* actions on click. |
21 |
20 |
|
*/ |
22 |
21 |
|
private int type; |
23 |
22 |
|
private int value; |
24 |
23 |
|
/** |
25 |
24 |
|
* Default constructor. |
26 |
25 |
|
*/ |
27 |
26 |
|
public DatePickerCell() { |
28 |
27 |
|
} |
29 |
28 |
|
/** |
30 |
29 |
|
* Constructor of DatePickerCell. |
31 |
30 |
|
* |
32 |
31 |
|
* @param text - string to be set to the label |
33 |
32 |
|
*/ |
34 |
33 |
|
public DatePickerCell( String text ) { |
35 |
34 |
|
this.setText( text ); |
36 |
35 |
|
} |
37 |
36 |
|
/** |
38 |
37 |
|
* Constructor of DatePickerCell. |
39 |
38 |
|
* |
40 |
39 |
|
* @param text - string to be set to the label |
41 |
40 |
|
* @param type - type to be associated to the label |
42 |
41 |
|
* @param value - value to be associated to the label |
43 |
42 |
|
*/ |
44 |
43 |
|
public DatePickerCell( String text, int type, int value ) { |
45 |
44 |
|
this.setText( text ); |
46 |
45 |
|
this.type = type; |
47 |
46 |
|
this.value = value; |
48 |
47 |
|
} |
49 |
48 |
|
/** |
50 |
49 |
|
* Creates a clone of the DatePickerCell object. |
51 |
50 |
|
* |
52 |
51 |
|
* @return Object - with the text, |
53 |
52 |
|
*/ |
54 |
53 |
|
public DatePickerCell copy() { |
55 |
54 |
|
return new DatePickerCell( this.getText(), this.type, this.value ); |
56 |
55 |
|
} |
57 |
56 |
|
/** |
58 |
57 |
|
* Sets type of the DatePickerCell. |
59 |
58 |
|
* |
60 |
59 |
|
* @param type - int indicating the type of the object |
61 |
60 |
|
*/ |
62 |
61 |
|
public void setType( int type ) { |
63 |
62 |
|
this.type = type; |
64 |
63 |
|
} |
65 |
64 |
|
/** |
66 |
65 |
|
* Sets value of the DatePickerCell. |
67 |
66 |
|
* |
68 |
67 |
|
* @param value - int indicating the value of the object |
69 |
68 |
|
*/ |
70 |
69 |
|
public void setValue( int value ) { |
71 |
70 |
|
this.value = value; |
72 |
71 |
|
} |
73 |
72 |
|
/** |
74 |
73 |
|
* Gets the type of the DatePickerCell. |
75 |
74 |
|
* |
76 |
75 |
|
* @return value - int indicating the type of the object |
77 |
76 |
|
*/ |
78 |
77 |
|
public int type() { |
79 |
78 |
|
return this.type; |
80 |
79 |
|
} |
81 |
80 |
|
/** |
82 |
81 |
|
* Gets the value of the DatePickerCell. |
83 |
82 |
|
* |
84 |
83 |
|
* @return value - int indicating the value of the object |
85 |
84 |
|
*/ |
86 |
85 |
|
public int value() { |
87 |
86 |
|
return this.value; |
88 |
87 |
|
} |
|
88 |
+ |
// This Source Code is Copyright & Licenced as indicated below |
|
89 |
+ |
package org.litesoft.GWT.forms.client.components.nonpublic.datepicker.impl; |
|
90 |
+ |
/* |
|
91 |
+ |
* Copyright 2007 Google Inc. |
|
92 |
+ |
* |
|
93 |
+ |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
|
94 |
+ |
* use this file except in compliance with the License. You may obtain a copy of |
|
95 |
+ |
* the License at |
|
96 |
+ |
* |
|
97 |
+ |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
98 |
+ |
* |
|
99 |
+ |
* Unless required by applicable law or agreed to in writing, software |
|
100 |
+ |
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
|
101 |
+ |
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
|
102 |
+ |
* License for the specific language governing permissions and limitations under |
|
103 |
+ |
* the License. |
|
104 |
+ |
*/ |
|
105 |
+ |
|
|
106 |
+ |
import com.google.gwt.user.client.ui.*; |
|
107 |
+ |
|
|
108 |
+ |
/** |
|
109 |
+ |
* Public class DatePickerCell is being used by DatePicker class to keep |
|
110 |
+ |
* the labels of controls and dates in the grid. It has the facility to attach |
|
111 |
+ |
* and retrieve integer type and value fields. The type and value fields |
|
112 |
+ |
* could be used by DatePicker to attach the type and specific nature of |
|
113 |
+ |
* actions on click. |
|
114 |
+ |
*/ |
|
115 |
+ |
|
|
116 |
+ |
public class DatePickerCell extends Label { |
|
117 |
+ |
private int type; |
|
118 |
+ |
private int value; |
|
119 |
+ |
|
|
120 |
+ |
/** |
|
121 |
+ |
* Default constructor. |
|
122 |
+ |
*/ |
|
123 |
+ |
public DatePickerCell() { |
|
124 |
+ |
} |
|
125 |
+ |
|
|
126 |
+ |
/** |
|
127 |
+ |
* Constructor of DatePickerCell. |
|
128 |
+ |
* |
|
129 |
+ |
* @param text - string to be set to the label |
|
130 |
+ |
*/ |
|
131 |
+ |
public DatePickerCell( String text ) { |
|
132 |
+ |
this.setText( text ); |
|
133 |
+ |
} |
|
134 |
+ |
|
|
135 |
+ |
/** |
|
136 |
+ |
* Constructor of DatePickerCell. |
|
137 |
+ |
* |
|
138 |
+ |
* @param text - string to be set to the label |
|
139 |
+ |
* @param type - type to be associated to the label |
|
140 |
+ |
* @param value - value to be associated to the label |
|
141 |
+ |
*/ |
|
142 |
+ |
public DatePickerCell( String text, int type, int value ) { |
|
143 |
+ |
this.setText( text ); |
|
144 |
+ |
this.type = type; |
|
145 |
+ |
this.value = value; |
|
146 |
+ |
} |
|
147 |
+ |
|
|
148 |
+ |
/** |
|
149 |
+ |
* Creates a clone of the DatePickerCell object. |
|
150 |
+ |
* |
|
151 |
+ |
* @return Object - with the text, |
|
152 |
+ |
*/ |
|
153 |
+ |
public DatePickerCell copy() { |
|
154 |
+ |
return new DatePickerCell( this.getText(), this.type, this.value ); |
|
155 |
+ |
} |
|
156 |
+ |
|
|
157 |
+ |
/** |
|
158 |
+ |
* Sets type of the DatePickerCell. |
|
159 |
+ |
* |
|
160 |
+ |
* @param type - int indicating the type of the object |
|
161 |
+ |
*/ |
|
162 |
+ |
public void setType( int type ) { |
|
163 |
+ |
this.type = type; |
|
164 |
+ |
} |
|
165 |
+ |
|
|
166 |
+ |
/** |
|
167 |
+ |
* Sets value of the DatePickerCell. |
|
168 |
+ |
* |
|
169 |
+ |
* @param value - int indicating the value of the object |
|
170 |
+ |
*/ |
|
171 |
+ |
public void setValue( int value ) { |
|
172 |
+ |
this.value = value; |
|
173 |
+ |
} |
|
174 |
+ |
|
|
175 |
+ |
/** |
|
176 |
+ |
* Gets the type of the DatePickerCell. |
|
177 |
+ |
* |
|
178 |
+ |
* @return value - int indicating the type of the object |
|
179 |
+ |
*/ |
|
180 |
+ |
public int type() { |
|
181 |
+ |
return this.type; |
|
182 |
+ |
} |
|
183 |
+ |
|
|
184 |
+ |
/** |
|
185 |
+ |
* Gets the value of the DatePickerCell. |
|
186 |
+ |
* |
|
187 |
+ |
* @return value - int indicating the value of the object |
|
188 |
+ |
*/ |
|
189 |
+ |
public int value() { |
|
190 |
+ |
return this.value; |
|
191 |
+ |
} |
|
192 |
+ |
} |