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.uif.CssConstants;
22 import org.kuali.rice.krad.uif.component.Component;
23 import org.kuali.rice.krad.uif.util.LifecycleElement;
24
25
26
27
28
29
30 @BeanTag(name = "scrollpane", parent = "Uif-Scrollpane")
31 public class Scrollpane extends WidgetBase {
32 private static final long serialVersionUID = 3853028195825084261L;
33
34 private String height;
35
36 @Override
37 public void performFinalize(Object model, LifecycleElement parent) {
38 super.performFinalize(model, parent);
39
40 if (parent instanceof Component) {
41 buildCSSforScrollPane((Component) parent);
42 }
43 }
44
45 private void buildCSSforScrollPane(Component parent) {
46 if (StringUtils.isNotBlank(getHeight())) {
47 if (!StringUtils.contains(parent.getStyle(), CssConstants.HEIGHT)) {
48 parent.appendToStyle(CssConstants.HEIGHT + getHeight() +";");
49 }
50
51 if (!StringUtils.contains(parent.getStyle(), CssConstants.OVERFLOW)) {
52 parent.appendToStyle(CssConstants.OVERFLOW + "auto;");
53 }
54 }
55 }
56
57
58
59
60
61
62
63
64
65
66
67
68
69 @BeanTagAttribute
70 public String getHeight() {
71 return height;
72 }
73
74
75
76
77
78
79 public void setHeight(String height) {
80 this.height = height;
81 }
82
83 }