KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > navigation > forms > ConfirmForm


1 /*
2  * SSL-Explorer
3  *
4  * Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */

19             
20 package com.sslexplorer.navigation.forms;
21
22 import java.util.ArrayList JavaDoc;
23 import java.util.List JavaDoc;
24 import java.util.StringTokenizer JavaDoc;
25
26 import org.apache.commons.logging.Log;
27 import org.apache.commons.logging.LogFactory;
28 import org.apache.struts.action.ActionMapping;
29
30 import com.sslexplorer.core.forms.CoreForm;
31
32 /**
33  *
34  */

35 public class ConfirmForm extends CoreForm {
36
37     static Log log = LogFactory.getLog(ConfirmForm.class);
38
39     public final static String JavaDoc TYPE_QUESTION = "question";
40     public final static String JavaDoc TYPE_INFO = "info";
41     public final static String JavaDoc TYPE_EXCEPTION = "exception";
42     public final static String JavaDoc TYPE_ERROR = "error";
43     public final static String JavaDoc TYPE_OK = "OK";
44
45     private List JavaDoc options;
46     private String JavaDoc title, subtitle, message;
47     private boolean decorated;
48     private String JavaDoc traceMessage, exceptionMessage;
49     private List JavaDoc messages = new ArrayList JavaDoc();
50     private String JavaDoc align;
51     private String JavaDoc type;
52     private String JavaDoc arg0;
53
54     public void initialize(String JavaDoc type, String JavaDoc title, String JavaDoc subtitle, String JavaDoc message, List JavaDoc options, boolean decorated,
55                            String JavaDoc align, String JavaDoc arg0) {
56         setTitle(title);
57         setSubtitle(subtitle);
58         setMessage(message);
59         setOptions(options);
60         setDecorated(decorated);
61         setAlign(align);
62         setType(type);
63         setArg0(arg0);
64     }
65
66     public void reset(ActionMapping mapping, javax.servlet.http.HttpServletRequest JavaDoc request) {
67     }
68
69     public String JavaDoc getType() {
70         return type;
71     }
72
73     public String JavaDoc getMessage() {
74         return message;
75     }
76
77     public void setMessage(String JavaDoc message) {
78         this.message = message;
79         messages.clear();
80         StringTokenizer JavaDoc t = new StringTokenizer JavaDoc(message == null ? "<null>" : message, "\n");
81         while (t.hasMoreTokens()) {
82             messages.add(t.nextToken());
83         }
84     }
85
86     public String JavaDoc getAlign() {
87         return align;
88     }
89
90     public List JavaDoc getOptions() {
91         return options;
92     }
93
94     public void setOptions(List JavaDoc options) {
95         this.options = options;
96     }
97
98     public void setType(String JavaDoc type) {
99         this.type = type;
100     }
101
102     public String JavaDoc getTitle() {
103         return title;
104     }
105
106     public void setTitle(String JavaDoc title) {
107         this.title = title;
108     }
109
110     public String JavaDoc getSubtitle() {
111         return subtitle;
112     }
113
114     public void setAlign(String JavaDoc align) {
115         this.align = align;
116     }
117
118     public void setSubtitle(String JavaDoc subtitle) {
119         this.subtitle = subtitle;
120     }
121
122     public boolean isDecorated() {
123         return decorated;
124     }
125
126     public void setDecorated(boolean decorated) {
127         this.decorated = decorated;
128     }
129
130     public void setExceptionMessage(String JavaDoc exceptionMessage) {
131         this.exceptionMessage = exceptionMessage;
132     }
133
134     public List JavaDoc getMessages() {
135         return messages;
136     }
137
138     public String JavaDoc getExceptionMessage() {
139         return exceptionMessage;
140     }
141
142     public void setTraceMessage(String JavaDoc traceMessage) {
143         this.traceMessage = traceMessage;
144     }
145
146     public String JavaDoc getTraceMessage() {
147         return traceMessage;
148     }
149
150     public String JavaDoc getArg0() {
151         return arg0;
152     }
153
154     public void setArg0(String JavaDoc arg0) {
155         this.arg0 = arg0;
156     }
157 }
Popular Tags