1 19 20 package com.sslexplorer.navigation.forms; 21 22 import java.util.ArrayList ; 23 import java.util.List ; 24 import java.util.StringTokenizer ; 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 35 public class ConfirmForm extends CoreForm { 36 37 static Log log = LogFactory.getLog(ConfirmForm.class); 38 39 public final static String TYPE_QUESTION = "question"; 40 public final static String TYPE_INFO = "info"; 41 public final static String TYPE_EXCEPTION = "exception"; 42 public final static String TYPE_ERROR = "error"; 43 public final static String TYPE_OK = "OK"; 44 45 private List options; 46 private String title, subtitle, message; 47 private boolean decorated; 48 private String traceMessage, exceptionMessage; 49 private List messages = new ArrayList (); 50 private String align; 51 private String type; 52 private String arg0; 53 54 public void initialize(String type, String title, String subtitle, String message, List options, boolean decorated, 55 String align, String 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 request) { 67 } 68 69 public String getType() { 70 return type; 71 } 72 73 public String getMessage() { 74 return message; 75 } 76 77 public void setMessage(String message) { 78 this.message = message; 79 messages.clear(); 80 StringTokenizer t = new StringTokenizer (message == null ? "<null>" : message, "\n"); 81 while (t.hasMoreTokens()) { 82 messages.add(t.nextToken()); 83 } 84 } 85 86 public String getAlign() { 87 return align; 88 } 89 90 public List getOptions() { 91 return options; 92 } 93 94 public void setOptions(List options) { 95 this.options = options; 96 } 97 98 public void setType(String type) { 99 this.type = type; 100 } 101 102 public String getTitle() { 103 return title; 104 } 105 106 public void setTitle(String title) { 107 this.title = title; 108 } 109 110 public String getSubtitle() { 111 return subtitle; 112 } 113 114 public void setAlign(String align) { 115 this.align = align; 116 } 117 118 public void setSubtitle(String 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 exceptionMessage) { 131 this.exceptionMessage = exceptionMessage; 132 } 133 134 public List getMessages() { 135 return messages; 136 } 137 138 public String getExceptionMessage() { 139 return exceptionMessage; 140 } 141 142 public void setTraceMessage(String traceMessage) { 143 this.traceMessage = traceMessage; 144 } 145 146 public String getTraceMessage() { 147 return traceMessage; 148 } 149 150 public String getArg0() { 151 return arg0; 152 } 153 154 public void setArg0(String arg0) { 155 this.arg0 = arg0; 156 } 157 } | Popular Tags |