KickJava   Java API By Example, From Geeks To Geeks.

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


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 ChatMediaBarTag extends javax.servlet.jsp.tagext.TagSupport JavaDoc
17 {
18     
19     /** Holds value of property sendLabel. */
20     private String JavaDoc sendLabel = "Send";
21     
22     /** Holds value of property buzzLabel. */
23     private String JavaDoc buzzLabel = "Buzz";
24     
25     /** Holds value of property webPageLabel. */
26     private String JavaDoc webPageLabel = "Web Page";
27     
28     /** Holds value of property webPageSendLabel. */
29     private String JavaDoc webPageSendLabel = "Send";
30     
31     /** Holds value of property bgcolor. */
32     private String JavaDoc bgcolor = "lightgrey";
33     
34     /** Holds value of property width. */
35     private String JavaDoc width = "100%";
36     
37     /** Holds value of property showBuzz. */
38     private String JavaDoc showBuzz = "yes";
39     
40     /** Holds value of property showWebPage. */
41     private String JavaDoc showWebPage = "yes";
42     
43     /** Creates a new instance of ChatTranscriptTag */
44     public ChatMediaBarTag()
45     {
46     }
47     
48     public int doStartTag()
49     {
50         try
51         {
52             JspWriter out = pageContext.getOut();
53  
54             out.println("<div id=\"media_bar\" style=\"visibility:hidden\">"
55             + "<table border=\"1\" cellpadding=\"3\" width=\""
56             + width
57             + "\" bgcolor=\""
58             + bgcolor
59             + "\" style=\"border-style:solid;\">");
60             
61             out.println("<tr id=\"media_table\">");
62             out.println("<td align=\"left\" style=\"border-width:0px;\"><b>"
63             + sendLabel + "&nbsp;&nbsp;</b></td>");
64             
65             if (showBuzz.equals("yes") == true)
66             {
67                 out.println("<td align=\"center\" style=\"border-style:solid;\">"
68                 + "<input type=\"submit\" name=\"buzz\" value=\""
69                 + buzzLabel + "\" onclick='return chat.sendMedia(\"buzz\")'></td>");
70             }
71             
72             if (showWebPage.equals("yes") == true)
73             {
74                 out.println("<td align=\"center\" style=\"border-style:solid;\">"
75                 + webPageLabel + "&nbsp;");
76                 out.println("<input type=\"text\" name=\"href\" size=\"30\" onkeypress=\"return chat.hrefKeyPressed(event)\"> &nbsp;");
77                 out.println("<input type=\"submit\" name=\"send_href\" value=\""
78                 + webPageSendLabel + "\" onclick='return chat.sendMedia(\"href\", document.chat_form.href.value)'></td>");
79             }
80             
81             out.println("</tr></table></div>");
82             
83         }
84         catch (IOException ex)
85         {
86             return SKIP_PAGE;
87         }
88         
89         return EVAL_PAGE;
90     }
91     
92     /** Getter for property label.
93      * @return Value of property label.
94      *
95      */

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

105     public void setSendLabel(String JavaDoc sendLabel)
106     {
107         this.sendLabel = sendLabel;
108     }
109     
110     /** Getter for property buzzLabel.
111      * @return Value of property buzzLabel.
112      *
113      */

114     public String JavaDoc getBuzzLabel()
115     {
116         return this.buzzLabel;
117     }
118     
119     /** Setter for property buzzLabel.
120      * @param buzzLabel New value of property buzzLabel.
121      *
122      */

123     public void setBuzzLabel(String JavaDoc buzzLabel)
124     {
125         this.buzzLabel = buzzLabel;
126     }
127     
128     /** Getter for property webPageLabel.
129      * @return Value of property webPageLabel.
130      *
131      */

132     public String JavaDoc getWebPageLabel()
133     {
134         return this.webPageLabel;
135     }
136     
137     /** Setter for property webPageLabel.
138      * @param webPageLabel New value of property webPageLabel.
139      *
140      */

141     public void setWebPageLabel(String JavaDoc webPageLabel)
142     {
143         this.webPageLabel = webPageLabel;
144     }
145     
146     /** Getter for property webPageSendLabel.
147      * @return Value of property webPageSendLabel.
148      *
149      */

150     public String JavaDoc getWebPageSendLabel()
151     {
152         return this.webPageSendLabel;
153     }
154     
155     /** Setter for property webPageSendLabel.
156      * @param webPageSendLabel New value of property webPageSendLabel.
157      *
158      */

159     public void setWebPageSendLabel(String JavaDoc webPageSendLabel)
160     {
161         this.webPageSendLabel = webPageSendLabel;
162     }
163     
164     /** Getter for property bgcolor.
165      * @return Value of property bgcolor.
166      *
167      */

168     public String JavaDoc getBgcolor()
169     {
170         return this.bgcolor;
171     }
172     
173     /** Setter for property bgcolor.
174      * @param bgcolor New value of property bgcolor.
175      *
176      */

177     public void setBgcolor(String JavaDoc bgcolor)
178     {
179         this.bgcolor = bgcolor;
180     }
181     
182     /** Getter for property width.
183      * @return Value of property width.
184      *
185      */

186     public String JavaDoc getWidth()
187     {
188         return this.width;
189     }
190     
191     /** Setter for property width.
192      * @param width New value of property width.
193      *
194      */

195     public void setWidth(String JavaDoc width)
196     {
197         this.width = width;
198     }
199     
200     /** Getter for property showBuzz.
201      * @return Value of property showBuzz.
202      *
203      */

204     public String JavaDoc getShowBuzz()
205     {
206         return this.showBuzz;
207     }
208     
209     /** Setter for property showBuzz.
210      * @param showBuzz New value of property showBuzz.
211      *
212      */

213     public void setShowBuzz(String JavaDoc showBuzz)
214     {
215         this.showBuzz = showBuzz;
216     }
217     
218     /** Getter for property showWebPage.
219      * @return Value of property showWebPage.
220      *
221      */

222     public String JavaDoc getShowWebPage()
223     {
224         return this.showWebPage;
225     }
226     
227     /** Setter for property showWebPage.
228      * @param showWebPage New value of property showWebPage.
229      *
230      */

231     public void setShowWebPage(String JavaDoc showWebPage)
232     {
233         this.showWebPage = showWebPage;
234     }
235     
236 }
237
Popular Tags