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.kuali.rice.krad.datadictionary.parse.BeanTag;
19 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
20 import org.kuali.rice.krad.uif.component.Component;
21 import org.kuali.rice.krad.uif.widget.Spinner;
22
23 import java.util.List;
24
25
26
27
28
29
30
31 @BeanTag(name = "spinnerControl-bean", parent = "Uif-SpinnerControl")
32 public class SpinnerControl extends TextControl {
33 private static final long serialVersionUID = -8267606288443759880L;
34
35 private Spinner spinner;
36
37 public SpinnerControl() {
38 super();
39 }
40
41
42
43
44 @Override
45 public List<Component> getComponentsForLifecycle() {
46 List<Component> components = super.getComponentsForLifecycle();
47
48 components.add(getSpinner());
49
50 return components;
51 }
52
53
54
55
56
57
58 @BeanTagAttribute(name="spinner",type = BeanTagAttribute.AttributeType.SINGLEBEAN)
59 public Spinner getSpinner() {
60 return spinner;
61 }
62
63
64
65
66
67
68 public void setSpinner(Spinner spinner) {
69 this.spinner = spinner;
70 }
71
72
73
74
75 @Override
76 protected <T> void copyProperties(T component) {
77 super.copyProperties(component);
78 SpinnerControl spinnerControlCopy = (SpinnerControl) component;
79
80 if(this.spinner != null) {
81 spinnerControlCopy.setSpinner((Spinner)this.spinner.copy());
82 }
83 }
84 }