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 @BeanTags({@BeanTag(name = "icon", parent = "Uif-Icon")})
31 public class Icon extends ContentElementBase {
32 private static final long serialVersionUID = 6771810101056598912L;
33
34 private String iconClass;
35
36 public Icon() {
37 super();
38 }
39
40
41
42
43
44
45
46
47
48
49 @BeanTagAttribute
50 public String getIconClass() {
51 return iconClass;
52 }
53
54
55
56
57
58
59 public void setIconClass(String iconClass) {
60 this.iconClass = iconClass;
61 }
62
63
64
65
66 @Override
67 public void completeValidation(ValidationTrace tracer){
68 tracer.addBean(this);
69
70
71 if(getIconClass()==null){
72 if(!Validator.checkExpressions(this, "iconClass")){
73 String currentValues [] = {"iconClass ="+getIconClass()};
74 tracer.createError("iconClass must be set",currentValues);
75 }
76 }
77
78 super.completeValidation(tracer.getCopy());
79 }
80 }