Inheritance diagram for DiagnosisList:
Public Member Functions | |
DiagnosisList (String prefix, Form form) | |
void | loadValues () |
void | display (boolean hidden) |
Static Public Attributes | |
static final int | ADD = 1 |
static final int | EDIT = 2 |
static final int | DELETE = 3 |
Package Attributes | |
ActionButton | action |
DiagnosisEditor | editor |
Vector | diagnoses = new Vector() |
int | active |
Definition at line 3 of file DiagnosisList.java.
|
Definition at line 14 of file DiagnosisList.java. References action, Widget::addChild(), and Widget::n(). 00015 { 00016 super(prefix, form); 00017 action = new ActionButton(n("action"), form); 00018 addChild(action); 00019 }
|
|
Reimplemented from Widget. Definition at line 70 of file DiagnosisList.java. References action, active, ADD, DELETE, Diagnosis::description, diagnoses, ActionButton::display(), DiagnosisEditor::display(), EDIT, editor, Widget::modal, Diagnosis::name, Widget::p(), Widget::printAttribute(), and Widget::serialize(). 00071 { 00072 printAttribute("list", serialize(diagnoses)); 00073 00074 if (modal) 00075 { 00076 printAttribute("modal", "1"); 00077 printAttribute("active", Integer.toString(active)); 00078 editor.display(hidden); 00079 return; 00080 } 00081 else if (hidden) 00082 return; 00083 00084 if (diagnoses.size() <= 0) 00085 { 00086 action.display("Add a diagnosis...", ADD); 00087 } 00088 else 00089 { 00090 action.display("Add another diagnosis...", ADD); 00091 p("<br>\n<table>\n"); 00092 int l = diagnoses.size(); 00093 for(int i = 0; i < l; ++i) 00094 { 00095 Diagnosis d = (Diagnosis) diagnoses.get(i); 00096 p( 00097 "\n"+ 00098 "<tr>\n"+ 00099 " <td>\n"+ 00100 " <table border=1 RULES=NONE FRAME=BOX>\n"+ 00101 " <tr><td colspan=2><strong>" + d.name + "</strong></td></tr>\n"+ 00102 " <tr>\n"+ 00103 " <td valign=top><i>Description:</i></td>\n"+ 00104 " <td>" + d.description + "</td> \n"+ 00105 " </tr>\n"+ 00106 " </table>\n"+ 00107 " </td>\n"+ 00108 " <td>\n"+ 00109 " "); 00110 action.display("Edit...", EDIT, i); p(" "); 00111 action.display("Delete", DELETE, i); p("\n"+ 00112 " </td>\n"+ 00113 "</tr>\n"+ 00114 ""); 00115 } 00116 p("</table>\n"); 00117 } 00118 }
|
|
Reimplemented from Widget. Definition at line 21 of file DiagnosisList.java. References ActionButton::action, action, active, ADD, DELETE, diagnoses, DiagnosisEditor::done, EDIT, editor, Widget::form, Widget::loadAttribute(), DiagnosisEditor::loadDefaults(), DiagnosisEditor::loadValues(), Widget::modal, DiagnosisEditor::more, Widget::n(), ActionButton::param, Widget::toInt(), and Widget::unserialize(). 00022 { 00023 super.loadValues(); 00024 00025 modal = loadAttribute("modal") != null; 00026 00027 String l = loadAttribute("list"); 00028 if (l != null) diagnoses = (Vector) unserialize(l); 00029 00030 String a = loadAttribute("active"); 00031 00032 for(;;) 00033 if (modal) 00034 { 00035 if (a != null) active = toInt(a, -1); 00036 editor = new DiagnosisEditor(active, diagnoses, n("editor"), form); 00037 if (a == null) editor.loadDefaults(); else editor.loadValues(); 00038 00039 if (editor.done) 00040 modal = false; 00041 else if (editor.more) 00042 { 00043 a = null; 00044 active = -1; 00045 } 00046 else 00047 return; 00048 } 00049 else 00050 { 00051 switch (action.action) 00052 { 00053 case ADD: 00054 modal = true; 00055 active = -1; 00056 break; 00057 case EDIT: 00058 modal = true; 00059 active = action.param; 00060 break; 00061 case DELETE: 00062 diagnoses.remove(action.param); 00063 return; 00064 default: 00065 return; 00066 } 00067 } 00068 }
|
|
Definition at line 5 of file DiagnosisList.java. |
|
Definition at line 8 of file DiagnosisList.java. |
|
Definition at line 10 of file DiagnosisList.java. |
|
Definition at line 12 of file DiagnosisList.java. |
|
Definition at line 7 of file DiagnosisList.java. |
|
Definition at line 11 of file DiagnosisList.java. |
|
Definition at line 6 of file DiagnosisList.java. |