KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > quikj > application > web > talk > jspbeans > ChatTranscriptTag


1 /*
2  * ChatTranscriptTag.java
3  *
4  * Created on April 4, 2004, 8:42 AM
5  */

6
7 package com.quikj.application.web.talk.jspbeans;
8
9 import javax.servlet.jsp.*;
10 import java.io.*;
11
12 /**
13  *
14  * @author amit
15  */

16 public class ChatTranscriptTag extends javax.servlet.jsp.tagext.TagSupport JavaDoc
17 {
18     
19     /** Holds value of property width. */
20     private String JavaDoc width = "*";
21     
22     /** Holds value of property height. */
23     private String JavaDoc height = "300";
24     
25     /** Holds value of property bgcolor. */
26     private String JavaDoc bgcolor = "lightyellow";
27     
28     /** Creates a new instance of ChatTranscriptTag */
29     public ChatTranscriptTag()
30     {
31     }
32     
33     public int doStartTag()
34     {
35         try
36         {
37             JspWriter out = pageContext.getOut();
38  
39             out.println("<div id=\"transcript\" style=\"width:"
40             + width
41             + ";height:"
42             + height
43             + ";background-color:"
44             + bgcolor
45             + ";overflow:scroll\"></div>");
46             
47         }
48         catch (IOException ex)
49         {
50             return SKIP_PAGE;
51         }
52         
53         return EVAL_PAGE;
54     }
55     
56     
57     /** Getter for property width.
58      * @return Value of property width.
59      *
60      */

61     public String JavaDoc getWidth()
62     {
63         return this.width;
64     }
65     
66     /** Setter for property width.
67      * @param width New value of property width.
68      *
69      */

70     public void setWidth(String JavaDoc width)
71     {
72         this.width = width;
73     }
74     
75     /** Getter for property height.
76      * @return Value of property height.
77      *
78      */

79     public String JavaDoc getHeight()
80     {
81         return this.height;
82     }
83     
84     /** Setter for property height.
85      * @param height New value of property height.
86      *
87      */

88     public void setHeight(String JavaDoc height)
89     {
90         this.height = height;
91     }
92     
93     /** Getter for property bgcolor.
94      * @return Value of property bgcolor.
95      *
96      */

97     public String JavaDoc getBgcolor()
98     {
99         return this.bgcolor;
100     }
101     
102     /** Setter for property bgcolor.
103      * @param bgcolor New value of property bgcolor.
104      *
105      */

106     public void setBgcolor(String JavaDoc bgcolor)
107     {
108         this.bgcolor = bgcolor;
109     }
110     
111 }
112
Popular Tags