1    package com.instantbank.collections.main.web;
2    
3    /**
4     * A Class class.
5     * <P>
6     *
7     * @author Guillermo Posse
8     */
9    
10   import javax.servlet.jsp.JspException;
11   import javax.servlet.jsp.tagext.TagSupport;
12   import javax.servlet.http.HttpServletRequest;
13   
14   public class TabTag extends TagSupport {
15     private boolean disabled = false;
16     private String number;
17     private boolean selected = false;
18     private String title;
19     private String width;
20   
21   
22     public TabTag() { }
23   
24   
25     public int doStartTag() throws JspException {
26       String result;
27       String tabClass = "tabFolder2";
28   
29       try {
30         if(selected) {
31           tabClass = "tabFolderSel2";
32         }
33         result = "<td id=\"tab" + number + "right\" align=middle bgcolor=#cccccc valign=top class=\"" + tabClass + "\">";
34         result += "<img align=left hspace=0 src=\"../images/gt_l.gif\" width=6></td>";
35   
36         if(disabled) {
37           result += "<td id=\"tab" + number + "\" align=center width=\"" + width + "\" valign=middle class=\"tabFolderDis2\">" + title + "</td>";
38         }
39         else {
40           result += "<td id=\"tab" + number + "\" align=center width=\"" + width + "\" valign=middle class=\"" + tabClass + "\" onClick=\"onTabClicked(this);\">" + title + "</td>";
41         }
42   
43         result += "<td id=\"tab" + number + "left\" align=middle bgcolor=#cccccc valign=top class=\"" + tabClass + "\">";
44         result += "<img align=right height=18 hspace=0 src=\"../images/gt_r.gif\" width=6> </td>";
45         pageContext.getOut().print(result);
46   
47       }
48       catch(Exception e) {
49         throw new JspException(e.getMessage());
50       }
51       return SKIP_BODY;
52     }
53   
54   
55     public void release() {
56       disabled = false;
57       selected = false;
58     }
59   
60   
61     public void setDisabled(String disabled) {
62       Boolean b = new Boolean(disabled);
63       this.disabled = b.booleanValue();
64     }
65   
66   
67     public void setNumber(String number) {
68       this.number = number;
69     }
70   
71   
72     public void setSelected(String selected) {
73       Boolean b = new Boolean(selected);
74       this.selected = b.booleanValue();
75     }
76   
77   
78     public void setTitle(String title) {
79       this.title = title;
80     }
81   
82   
83     public void setWidth(String width) {
84       this.width = width;
85     }
86   }
87   
88