1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.widget;
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.datadictionary.parse.BeanTags;
22 import org.kuali.rice.krad.uif.component.Component;
23
24 import java.util.HashMap;
25 import java.util.Map;
26
27
28
29
30
31
32
33 @BeanTags({@BeanTag(name = "lightBox-bean", parent = "Uif-LightBox"),
34 @BeanTag(name = "lightBoxPost-bean", parent = "Uif-LightBoxPost")})
35 public class LightBox extends WidgetBase {
36 private static final long serialVersionUID = -4004284762546700975L;
37
38 private String height;
39 private String width;
40
41 private boolean addAppParms;
42 private boolean lookupReturnByScript;
43
44 public LightBox() {
45 super();
46 }
47
48
49
50
51
52
53 @Override
54 public Map<String, String> getTemplateOptions() {
55 Map<String, String> templateOptions = super.getTemplateOptions();
56
57 if (templateOptions == null) {
58 super.setTemplateOptions(templateOptions = new HashMap<String, String>());
59 }
60
61 if (StringUtils.isNotBlank(width) && !templateOptions.containsKey("width")) {
62 templateOptions.put("width", width);
63 }
64
65 if (StringUtils.isNotBlank(height) && !templateOptions.containsKey("height")) {
66 templateOptions.put("height", height);
67 }
68
69 return templateOptions;
70 }
71
72
73
74
75 @BeanTagAttribute(name = "height")
76 public String getHeight() {
77 return height;
78 }
79
80
81
82
83
84
85
86 public void setHeight(String height) {
87 this.height = height;
88 }
89
90
91
92
93 @BeanTagAttribute(name = "width")
94 public String getWidth() {
95 return width;
96 }
97
98
99
100
101
102
103
104 public void setWidth(String width) {
105 this.width = width;
106 }
107
108
109
110
111
112
113 @BeanTagAttribute(name = "addAppParms")
114 public boolean isAddAppParms() {
115 return addAppParms;
116 }
117
118
119
120
121
122
123 public void setAddAppParms(boolean addAppParms) {
124 this.addAppParms = addAppParms;
125 }
126
127
128
129
130 @BeanTagAttribute(name = "lookupReturnByScript")
131 public boolean isLookupReturnByScript() {
132 return lookupReturnByScript;
133 }
134
135
136
137
138
139
140
141 public void setLookupReturnByScript(boolean lookupReturnByScript) {
142 this.lookupReturnByScript = lookupReturnByScript;
143 }
144
145
146
147
148 @Override
149 protected <T> void copyProperties(T component) {
150 super.copyProperties(component);
151 LightBox lightBoxCopy = (LightBox) component;
152 lightBoxCopy.setHeight(this.getHeight());
153 lightBoxCopy.setWidth(this.getWidth());
154 lightBoxCopy.setAddAppParms(this.isAddAppParms());
155 lightBoxCopy.setLookupReturnByScript(this.isLookupReturnByScript());
156 }
157 }