1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kns.web.spring; |
17 | |
|
18 | |
import org.kuali.rice.core.util.type.AbstractKualiDecimal; |
19 | |
import org.kuali.rice.core.util.type.KualiDecimal; |
20 | |
import org.kuali.rice.core.util.type.KualiInteger; |
21 | |
import org.kuali.rice.core.util.type.KualiPercent; |
22 | |
import org.kuali.rice.core.web.format.BigDecimalFormatter; |
23 | |
import org.kuali.rice.core.web.format.CurrencyFormatter; |
24 | |
import org.kuali.rice.core.web.format.KualiIntegerCurrencyFormatter; |
25 | |
import org.kuali.rice.core.web.format.PercentageFormatter; |
26 | |
import org.springframework.web.bind.WebDataBinder; |
27 | |
import org.springframework.web.bind.support.ConfigurableWebBindingInitializer; |
28 | |
import org.springframework.web.context.request.WebRequest; |
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | 0 | public class UifConfigurableWebBindingInitializer extends ConfigurableWebBindingInitializer { |
36 | |
|
37 | |
@Override |
38 | |
public void initBinder(WebDataBinder binder, WebRequest request) { |
39 | 0 | binder.registerCustomEditor(AbstractKualiDecimal.class, new UifKnsFormatterPropertyEditor(BigDecimalFormatter.class)); |
40 | 0 | binder.registerCustomEditor(KualiDecimal.class, new UifKnsFormatterPropertyEditor(CurrencyFormatter.class)); |
41 | 0 | binder.registerCustomEditor(KualiInteger.class, new UifKnsFormatterPropertyEditor(KualiIntegerCurrencyFormatter.class)); |
42 | 0 | binder.registerCustomEditor(KualiPercent.class, new UifKnsFormatterPropertyEditor(PercentageFormatter.class)); |
43 | |
|
44 | |
|
45 | 0 | binder.registerCustomEditor(boolean.class, new UifBooleanEditor()); |
46 | |
|
47 | 0 | super.initBinder(binder, request); |
48 | 0 | } |
49 | |
|
50 | |
} |