1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.student.cm.uif.element;
18
19 import org.apache.commons.lang.StringUtils;
20 import org.kuali.rice.krad.uif.element.Message;
21 import org.kuali.rice.krad.uif.util.LifecycleElement;
22
23 import java.util.HashMap;
24 import java.util.Map;
25
26
27
28
29
30
31 public class CMLozengeMessage extends Message {
32
33 protected Map<String,String> dataStyleMapping = new HashMap<>();
34 protected String dataToStyle;
35
36 public CMLozengeMessage() {
37 super();
38 }
39
40 @Override
41 public void performFinalize(Object model, LifecycleElement parent) {
42
43 String style = dataStyleMapping.get(dataToStyle);
44
45 if (StringUtils.isNotBlank(style)){
46 getAdditionalCssClasses().add(style);
47 }
48
49 super.performFinalize(model,parent);
50 }
51
52 public Map<String, String> getDataStyleMapping() {
53 return dataStyleMapping;
54 }
55
56 public void setDataStyleMapping(Map<String, String> dataStyleMapping) {
57 this.dataStyleMapping = dataStyleMapping;
58 }
59
60 public String getDataToStyle() {
61 return dataToStyle;
62 }
63
64 public void setDataToStyle(String dataToStyle) {
65 this.dataToStyle = dataToStyle;
66 }
67
68
69 }