1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.element;
17
18 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
19 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
20 import org.kuali.rice.krad.datadictionary.parse.BeanTags;
21
22 import org.kuali.rice.krad.datadictionary.validator.ValidationTrace;
23 import org.kuali.rice.krad.datadictionary.validator.Validator;
24
25
26
27
28
29
30
31
32
33 @BeanTags({@BeanTag(name = "icon-bean", parent = "Uif-Icon")})
34 public class Icon extends ContentElementBase {
35
36 private static final long serialVersionUID = 6771810101056598912L;
37
38 private String iconClass;
39
40 public Icon() {
41 super();
42 }
43
44
45
46
47
48
49
50
51
52
53 @BeanTagAttribute(name = "iconClass")
54 public String getIconClass() {
55 return iconClass;
56 }
57
58
59
60
61
62
63 public void setIconClass(String iconClass) {
64 this.iconClass = iconClass;
65 }
66
67
68
69
70 @Override
71 public void completeValidation(ValidationTrace tracer){
72 tracer.addBean(this);
73
74
75 if(getIconClass()==null){
76 if(!Validator.checkExpressions(this, "iconClass")){
77 String currentValues [] = {"iconClass ="+getIconClass()};
78 tracer.createError("iconClass must be set",currentValues);
79 }
80 }
81
82 super.completeValidation(tracer.getCopy());
83 }
84 }