1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.control;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
20 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
21 import org.kuali.rice.krad.uif.component.Component;
22 import org.kuali.rice.krad.uif.field.InputField;
23 import org.kuali.rice.krad.uif.util.LifecycleElement;
24
25
26
27
28
29
30
31 @BeanTag(name = "passwordControl", parent = "Uif-PasswordControl")
32 public class PasswordControl extends ControlBase implements SizedControl {
33 private static final long serialVersionUID = -8267606288443759880L;
34
35 private int size;
36 private Integer maxLength;
37 private Integer minLength;
38
39 private String watermarkText = StringUtils.EMPTY;
40
41 public PasswordControl() {
42 super();
43 }
44
45
46
47
48
49
50
51
52
53
54 @Override
55 public void performFinalize(Object model, LifecycleElement parent) {
56 super.performFinalize(model, parent);
57
58 if (parent instanceof InputField) {
59 InputField field = (InputField) parent;
60 if (getMaxLength() == null) {
61 setMaxLength(field.getMaxLength());
62 }
63
64 if (getMinLength() == null) {
65 setMinLength(field.getMinLength());
66 }
67 }
68 }
69
70
71
72
73 @BeanTagAttribute
74 public int getSize() {
75 return this.size;
76 }
77
78
79
80
81 public void setSize(int size) {
82 this.size = size;
83 }
84
85
86
87
88
89
90
91
92 @BeanTagAttribute
93 public Integer getMaxLength() {
94 return maxLength;
95 }
96
97
98
99
100
101
102 public void setMaxLength(Integer maxLength) {
103 this.maxLength = maxLength;
104 }
105
106
107
108
109
110
111
112
113 @BeanTagAttribute
114 public Integer getMinLength() {
115 return minLength;
116 }
117
118
119
120
121
122
123 public void setMinLength(Integer minLength) {
124 this.minLength = minLength;
125 }
126
127
128
129
130
131
132
133
134
135
136
137
138 @BeanTagAttribute
139 public String getWatermarkText() {
140 return this.watermarkText;
141 }
142
143
144
145
146
147
148 public void setWatermarkText(String watermarkText) {
149
150
151 if (StringUtils.isNotEmpty(watermarkText)) {
152 watermarkText = watermarkText + " ";
153 }
154
155 this.watermarkText = watermarkText;
156 }
157 }