KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > quikj > application > web > talk > client > AutoEmailTranscriptInfo


1 /*
2  * AutoEmailInfo.java
3  *
4  * Created on March 10, 2003, 2:03 AM
5  */

6
7 package com.quikj.application.web.talk.client;
8
9 import java.applet.*;
10 import java.util.*;
11
12 /**
13  *
14  * @author amit
15  */

16 public class AutoEmailTranscriptInfo
17 {
18     
19     /** Holds value of property autoEmail. */
20     private boolean autoEmail = false;
21     
22     /** Holds value of property sendSelf. */
23     private boolean sendSelf;
24     
25     /** Holds value of property sendOthers. */
26     private boolean sendOthers;
27     
28     private String JavaDoc[] toList;
29     
30     private boolean promptForTranscript = true;
31     
32     /** Creates a new instance of AutoEmailInfo */
33     public AutoEmailTranscriptInfo(Applet applet)
34     {
35         if (applet == null)
36         {
37             return;
38         }
39         
40         String JavaDoc param = applet.getParameter("prompt-email-transcript");
41         if (param != null)
42         {
43             if (param.equals("yes") == true)
44             {
45                 promptForTranscript = true;
46             }
47             else if (param.equals("no") == true)
48             {
49                 promptForTranscript = false;
50             }
51             // else, takes the default parameter
52
}
53         
54         param = applet.getParameter("auto-email-transcript");
55         if (param == null)
56         {
57             return;
58         }
59         
60         autoEmail = true;
61         
62         StringTokenizer tokens = new StringTokenizer(param, ";");
63         int num = tokens.countTokens();
64         Vector alist = new Vector();
65         for (int i = 0; i < num; i++)
66         {
67             String JavaDoc email = tokens.nextToken();
68             if (email.equals ("@SELF") == true)
69             {
70                 sendSelf = true;
71             }
72             else if (email.equals ("@OTHERS") == true)
73             {
74                 sendOthers = true;
75             }
76             else
77             {
78                 alist.addElement(email);
79             }
80         }
81         
82         toList = new String JavaDoc[alist.size()];
83         for (int i = 0; i < toList.length; i++)
84         {
85             toList[i] = (String JavaDoc)alist.elementAt(i);
86         }
87     }
88     
89     /** Getter for property autoEmail.
90      * @return Value of property autoEmail.
91      *
92      */

93     public boolean isAutoEmail()
94     {
95         return this.autoEmail;
96     }
97     
98     /** Setter for property autoEmail.
99      * @param autoEmail New value of property autoEmail.
100      *
101      */

102     public void setAutoEmail(boolean autoEmail)
103     {
104         this.autoEmail = autoEmail;
105     }
106     
107     /** Getter for property sendSelf.
108      * @return Value of property sendSelf.
109      *
110      */

111     public boolean isSendSelf()
112     {
113         return this.sendSelf;
114     }
115     
116     /** Setter for property sendSelf.
117      * @param sendSelf New value of property sendSelf.
118      *
119      */

120     public void setSendSelf(boolean sendSelf)
121     {
122         this.sendSelf = sendSelf;
123     }
124     
125     /** Getter for property sendOthers.
126      * @return Value of property sendOthers.
127      *
128      */

129     public boolean isSendOthers()
130     {
131         return this.sendOthers;
132     }
133     
134     /** Setter for property sendOthers.
135      * @param sendOthers New value of property sendOthers.
136      *
137      */

138     public void setSendOthers(boolean sendOthers)
139     {
140         this.sendOthers = sendOthers;
141     }
142     
143     /** Getter for property toList.
144      * @return Value of property toList.
145      *
146      */

147     public String JavaDoc[] getToList()
148     {
149         return toList;
150     }
151     
152     /** Setter for property toList.
153      * @param toList New value of property toList.
154      *
155      */

156     public void setToList(String JavaDoc[] toList)
157     {
158         this.toList = toList;
159     }
160     
161     /** Getter for property promptForTranscript.
162      * @return Value of property promptForTranscript.
163      *
164      */

165     public boolean isPromptForTranscript()
166     {
167         return promptForTranscript;
168     }
169     
170     /** Setter for property promptForTranscript.
171      * @param promptForTranscript New value of property promptForTranscript.
172      *
173      */

174     public void setPromptForTranscript(boolean promptForTranscript)
175     {
176         this.promptForTranscript = promptForTranscript;
177     }
178     
179 }
180
Popular Tags