1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.tklm.time.timeblock.service;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.kpme.tklm.common.TkConstants;
20 import org.kuali.rice.core.web.format.Formatter;
21
22 public class TimeBlockActionHistoryFormatter extends Formatter {
23
24
25
26
27 private static final long serialVersionUID = 1L;
28
29 @Override
30 public Object format(Object value) {
31 if (value != null) {
32 String val = (String) value;
33 if (StringUtils.equals(TkConstants.ACTIONS.ADD_TIME_BLOCK,
34 (String) value)) {
35 val = "Add";
36 } else if (StringUtils.equals(
37 TkConstants.ACTIONS.UPDATE_TIME_BLOCK, (String) value)) {
38 val = "Update";
39 } else if (StringUtils.equals(
40 TkConstants.ACTIONS.DELETE_TIME_BLOCK, (String) value)) {
41 val = "Delete";
42 }
43 return val;
44 }
45 return super.format(value);
46 }
47
48 @Override
49 public Object convertFromPresentationFormat(Object value) {
50 return super.convertFromPresentationFormat(value);
51 }
52
53 }