KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > dotmarketing > taglibs > HTMLBoxTag


1 package com.dotmarketing.taglibs;
2
3 import javax.servlet.jsp.JspException JavaDoc;
4 import javax.servlet.jsp.tagext.BodyTagSupport JavaDoc;
5 import com.dotmarketing.util.Logger;
6 import com.dotmarketing.util.UtilMethods;
7
8 public class HTMLBoxTag extends BodyTagSupport JavaDoc {
9
10     private static final long serialVersionUID = 1L;
11     private String JavaDoc _bodyContent;
12     private String JavaDoc tableId;
13     private String JavaDoc tableCaption;
14     
15
16     public int doStartTag() throws JspException JavaDoc {
17         return EVAL_BODY_BUFFERED;
18     }
19
20     public int doAfterBody() {
21         _bodyContent = getBodyContent().getString();
22
23         return SKIP_BODY;
24     }
25
26     public int doEndTag() throws JspException JavaDoc {
27
28         java.io.Writer JavaDoc out = pageContext.getOut();
29
30         try {
31             
32             if (UtilMethods.isSet(tableId)) {
33                 out.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"80%\" id=\"" + tableId + "\">\n");
34             }
35             else {
36                 out.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"80%\">\n");
37             }
38             if (UtilMethods.isSet(tableCaption)) {
39                 out.write ("<caption><font class=\"bg\" size=\"2\"><B>" + tableCaption + "</b></font></caption>");
40             }
41             out.write("<tr><td valign=\"top\"><img SRC=\"/portal/images/top_corner.gif\"></td>\n");
42             out.write("<td background=\"/portal/images/line_top.gif\"><img SRC=\"/portal/images/shim.gif\" width=\"1\" height=\"8\"></td>\n");
43             out.write("<td bgcolor=\"#9D9DA1\"><img SRC=\"/portal/images/shim.gif\" width=\"1\" height=\"1\"></td></tr>\n");
44             out.write("<tr><td background=\"/portal/images/side_bg.gif\"></td><td width=\"100%\">\n");
45
46             out.write(_bodyContent);
47
48             out.write("</td><td bgcolor=\"#9D9DA1\"><img SRC=\"/portal/images/shim.gif\" width=\"1\" height=\"1\"></td></tr>\n");
49             out.write("<tr><td bgcolor=\"#9D9DA1\" height=\"1\"><img SRC=\"/portal/images/shim.gif\" width=\"1\" height=\"1\"></td>\n");
50             out.write("<td bgcolor=\"#9D9DA1\" height=\"1\"><img SRC=\"/portal/images/shim.gif\" width=\"1\" height=\"1\"></td>\n");
51             out.write("<td bgcolor=\"#9D9DA1\" height=\"1\"><img SRC=\"/portal/images/shim.gif\" width=\"1\" height=\"1\"></td>\n");
52             out.write("</tr></table>\n");
53
54         }
55         catch (Exception JavaDoc e) {
56             Logger.warn(this, e.toString(), e);
57         }
58
59         return EVAL_PAGE;
60     }
61
62     
63
64     /**
65      * Returns the tableId.
66      * @return String
67      */

68     public String JavaDoc getTableId() {
69         return tableId;
70     }
71
72     /**
73      * Sets the tableId.
74      * @param tableId The tableId to set
75      */

76     public void setTableId(String JavaDoc tableId) {
77         this.tableId = tableId;
78     }
79
80     public String JavaDoc getTableCaption() {
81         return tableCaption;
82     }
83     public void setTableCaption(String JavaDoc tableCaption) {
84         this.tableCaption = tableCaption;
85     }
86 }
87
Popular Tags