1 |
|
package org.kuali.student.lum.program.client.widgets; |
2 |
|
|
3 |
|
import org.kuali.student.common.assembly.data.QueryPath; |
4 |
|
import org.kuali.student.common.ui.client.configurable.mvc.binding.ModelWidgetBinding; |
5 |
|
import org.kuali.student.common.ui.client.mvc.DataModel; |
6 |
|
import org.kuali.student.common.ui.client.widgets.KSDatePicker; |
7 |
|
import org.kuali.student.lum.program.client.ProgramUtils; |
8 |
|
|
9 |
|
import java.util.Date; |
10 |
|
|
11 |
|
|
12 |
|
@author |
13 |
|
|
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 4 |
Complexity Density: 0.57 |
|
14 |
|
class DateBinding implements ModelWidgetBinding<KSDatePicker> { |
15 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
16 |
0
|
@Override... |
17 |
|
public void setModelValue(KSDatePicker widget, DataModel model, String path) { |
18 |
0
|
QueryPath qPath = QueryPath.parse(path); |
19 |
0
|
Date dateValue = widget.getValue(); |
20 |
0
|
if (dateValue != null) { |
21 |
0
|
model.set(qPath, ProgramUtils.df.format(dateValue)); |
22 |
|
} |
23 |
|
} |
24 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
25 |
0
|
@Override... |
26 |
|
public void setWidgetValue(KSDatePicker widget, DataModel model, String path) { |
27 |
0
|
String value = model.get(path); |
28 |
0
|
if (value != null) { |
29 |
0
|
widget.setValue(ProgramUtils.df.parse(value)); |
30 |
|
} |
31 |
|
} |
32 |
|
} |