01: package org.gridsphere.provider.portletui.beans;
02:
03: /**
04: * The <code>GroupBean</code> provides a way to visually group elements with an optional label.
05: */
06: public class GroupBean extends BaseComponentBean implements TagBean {
07:
08: private String label = null;
09: private String height = null;
10: private String width = null;
11:
12: public String getLabel() {
13: return label;
14: }
15:
16: public void setLabel(String label) {
17: this .label = label;
18: }
19:
20: public String getHeight() {
21: return height;
22: }
23:
24: public void setHeight(String height) {
25: this .height = height;
26: }
27:
28: public String getWidth() {
29: return width;
30: }
31:
32: public void setWidth(String width) {
33: this .width = width;
34: }
35:
36: public String toStartString() {
37:
38: if (width != null)
39: this .addCssStyle(" width:" + width + "; ");
40: if (height != null)
41: this .addCssStyle(" height:" + height + "; ");
42:
43: StringBuffer sb = new StringBuffer();
44: sb.append("<fieldset");
45: sb.append(getFormattedCss());
46: sb.append(">");
47: if (this .label != null) {
48: sb.append("<legend>");
49: sb.append(label);
50: sb.append("</legend>");
51: }
52: return sb.toString();
53: }
54:
55: public String toEndString() {
56: return "</fieldset>";
57: }
58:
59: }
|