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