01: package com.salmonllc.jsp;
02:
03: import com.salmonllc.html.HtmlPage;
04: import com.salmonllc.html.HtmlComponent;
05:
06: /**
07: * This tag creates a div component
08: * @author Nicolás Genta
09: */
10: public class JspDiv extends HtmlComponent {
11:
12: private boolean _hidden;
13: private String _style;
14:
15: public JspDiv(String name, HtmlPage p) {
16: super (name, p);
17: setTheme(null);
18: _hidden = false;
19: _style = "";
20: }
21:
22: public void generateHTML(java.io.PrintWriter p, int row)
23: throws Exception {
24: if (!getVisible())
25: return;
26:
27: StringBuffer sbOut = new StringBuffer();
28: String name = getFullName();
29: if (row != -1)
30: name += "_" + row;
31: if (_hidden) {
32: sbOut.append("<DIV ID=\"" + name + "\""
33: + " STYLE=\"display:none; " + _style + "\">");
34: } else {
35: sbOut.append("<DIV ID=\"" + name + "\""
36: + " STYLE=\"display:block; " + _style + "\">");
37: }
38: p.print(sbOut.toString());
39: }
40:
41: public boolean isHidden() {
42: return _hidden;
43: }
44:
45: public void setHidden(boolean hidden) {
46: this ._hidden = hidden;
47: }
48:
49: public String getStyle() {
50: return _style;
51: }
52:
53: public void setStyle(String style) {
54: this._style = style;
55: }
56: }
|