Inheritance diagram for Widget:
Public Member Functions | |
Widget (String prefix, Form form) | |
void | addChild (Widget w) |
void | loadDefaults () |
void | loadValues () |
void | display () |
void | display (boolean hidden) |
void | dumpscript () |
String | loadAttribute () |
String | loadAttribute (String name) |
String | n (String suffix) |
void | printAttribute (String name, String value) |
void | preserveAttribute (String name) |
void | p (String str) |
void | p (Exception e) |
String | serialize (Serializable o) |
Object | unserialize (String s) |
int | toInt (String str, int def) |
Static Public Member Functions | |
static String | htmlencode (String v) |
static void | ShowException (Throwable t, PrintWriter pw) |
Public Attributes | |
String | prefix |
Form | form |
boolean | modal = false |
Vector | children = new Vector() |
Widget | modalChild |
String | name |
int | method |
Static Public Attributes | |
static final int | GET = 1 |
static final int | POST = 2 |
static final int | BOTH = 3 |
Definition at line 10 of file Widget.java.
|
Definition at line 27 of file Widget.java. 00028 { 00029 this.prefix = prefix; 00030 this.form = form; 00031 }
|
|
Definition at line 33 of file Widget.java. References children. 00034 { 00035 children.add(w); 00036 }
|
|
Reimplemented in ActionButton, AppointmentEditor, AppointmentList, DiagnosisEditor, DiagnosisList, DoctorSelect, PatientEditor, PatientList, PatientSelect, PolicySelect, ReferralEditor, ReferralList, SelectBox, ServicesSelect, TableEditor, and TextBox. Definition at line 64 of file Widget.java. References children, display(), modal, and modalChild. 00065 { 00066 if (hidden || modalChild != null) 00067 { 00068 int l = children.size(); 00069 for(int i = 0; i < l; ++i) 00070 { 00071 Widget w = (Widget)children.get(i); 00072 w.display(!w.modal); 00073 } 00074 } 00075 }
|
|
Definition at line 59 of file Widget.java. 00060 { 00061 display(false); 00062 }
|
|
Definition at line 77 of file Widget.java.
|
|
Definition at line 115 of file Widget.java. 00116 { 00117 if (v == null) return ""; 00118 StringBuffer b = new StringBuffer(); 00119 int l = v.length(); 00120 00121 for(int i = 0; i < l; ++i) 00122 { 00123 char c = v.charAt(i); 00124 00125 switch (c) 00126 { 00127 case '"': 00128 b.append("""); 00129 break; 00130 case '<': 00131 b.append("<"); 00132 break; 00133 case '>': 00134 b.append(">"); 00135 break; 00136 case '&': 00137 b.append("&"); 00138 break; 00139 default: 00140 b.append(c); 00141 break; 00142 } 00143 } 00144 return b.toString(); 00145 }
|
|
Definition at line 84 of file Widget.java. References form, n(), and Form::req.
|
|
Definition at line 79 of file Widget.java. References form, prefix, and Form::req.
|
|
Reimplemented in AppointmentEditor, DiagnosisEditor, PatientEditor, and ReferralEditor. Definition at line 38 of file Widget.java. References children, and loadDefaults(). 00039 { 00040 int l = children.size(); 00041 for(int i = 0; i < l; ++i) 00042 { 00043 Widget w = (Widget)children.get(i); 00044 w.loadDefaults(); 00045 } 00046 }
|
|
Reimplemented in ActionButton, AppointmentEditor, AppointmentList, DiagnosisEditor, DiagnosisList, PatientEditor, PatientList, ReferralEditor, ReferralList, SelectBox, TableEditor, and TextBox. Definition at line 48 of file Widget.java. References children, loadValues(), modal, and modalChild. 00049 { 00050 int l = children.size(); 00051 for(int i = 0; i < l; ++i) 00052 { 00053 Widget w = (Widget)children.get(i); 00054 w.loadValues(); 00055 if (w.modal) modalChild = w; 00056 } 00057 }
|
|
Definition at line 89 of file Widget.java. References prefix.
|
|
Definition at line 110 of file Widget.java. References form, Form::pw, and ShowException(). 00111 { 00112 ShowException(e, form.pw); 00113 }
|
|
Definition at line 105 of file Widget.java. References form, and Form::pw.
|
|
Definition at line 99 of file Widget.java. References loadAttribute(), and printAttribute(). 00100 { 00101 String v = loadAttribute(name); 00102 if (v != null) printAttribute(name, v); 00103 }
|
|
Definition at line 94 of file Widget.java. References htmlencode(), n(), and p(). 00095 { 00096 p("<input type=hidden name=\"" + n(name) + "\" value=\"" + htmlencode(value) + "\">"); 00097 }
|
|
Definition at line 147 of file Widget.java. References p(). 00148 { 00149 String r = null; 00150 try 00151 { 00152 ByteArrayOutputStream bos = new ByteArrayOutputStream(); 00153 try 00154 { 00155 ObjectOutputStream oos = new ObjectOutputStream(bos); 00156 try 00157 { 00158 oos.writeObject(o); 00159 oos.flush(); 00160 r = Base64.encodeBytes(bos.toByteArray()); 00161 } 00162 finally 00163 { 00164 oos.close(); 00165 } 00166 } 00167 finally 00168 { 00169 bos.close(); 00170 } 00171 } 00172 catch (java.io.IOException e) 00173 { 00174 p("<h1>Serialize IO Exception: " + e.toString() + "</h1>"); 00175 } 00176 return r; 00177 }
|
|
Definition at line 226 of file Widget.java. 00227 { 00228 pw.println("</select>"); 00229 pw.println("<h2>Exception Caught</h2>"); 00230 pw.print("<pre style=\"background-color: #eeeeee\">"); 00231 t.printStackTrace(pw); 00232 pw.println("</pre>"); 00233 }
|
|
Definition at line 214 of file Widget.java. 00215 { 00216 try 00217 { 00218 return str == null ? def : Integer.parseInt(str); 00219 } 00220 catch (java.lang.NumberFormatException e) 00221 { 00222 return def; 00223 } 00224 }
|
|
Definition at line 179 of file Widget.java. References p(). 00180 { 00181 Object o = null; 00182 try 00183 { 00184 InputStream is = new ByteArrayInputStream(Base64.decode(s)); 00185 try 00186 { 00187 ObjectInputStream ois = new ObjectInputStream(is); 00188 try 00189 { 00190 o = ois.readObject(); 00191 } 00192 finally 00193 { 00194 ois.close(); 00195 } 00196 is.close(); 00197 } 00198 finally 00199 { 00200 is.close(); 00201 } 00202 } 00203 catch (java.io.IOException e) 00204 { 00205 p(e); 00206 } 00207 catch (java.lang.ClassNotFoundException e) 00208 { 00209 p(e); 00210 } 00211 return o; 00212 }
|
|
Definition at line 22 of file Widget.java. |
|
Definition at line 17 of file Widget.java. |
|
Definition at line 13 of file Widget.java. |
|
Definition at line 20 of file Widget.java. |
|
Definition at line 25 of file Widget.java. |
|
Definition at line 15 of file Widget.java. |
|
Definition at line 18 of file Widget.java. |
|
Reimplemented in DiagnosisEditor, and PatientEditor. Definition at line 24 of file Widget.java. |
|
Definition at line 21 of file Widget.java. |
|
Definition at line 12 of file Widget.java. |