Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

DiagnosisEditor Class Reference

Inheritance diagram for DiagnosisEditor:

Widget List of all members.

Public Member Functions

 DiagnosisEditor (int active, Vector diagnoses, String prefix, Form form)
void save ()
void loadDefaults ()
void loadValues ()
void display (boolean hidden)

Public Attributes

int active
Vector diagnoses
ActionButton action
TextBox name
TextBox description

Static Public Attributes

static final int SAVE = 1
static final int SAVEADD = 2
static final int CANCEL = 3

Package Attributes

boolean done = false
boolean more = false

Detailed Description

Definition at line 3 of file DiagnosisEditor.java.


Constructor & Destructor Documentation

DiagnosisEditor::DiagnosisEditor int  active,
Vector  diagnoses,
String  prefix,
Form  form
[inline]
 

Definition at line 18 of file DiagnosisEditor.java.

References action, Widget::addChild(), description, Widget::n(), and name.

00019         {
00020           super(prefix, form);
00021           this.active = active;
00022           this.diagnoses = diagnoses;
00023     name = new TextBox(0,40, n("name"), form);
00024     description = new TextBox(10, 40, n("description"), form);
00025     action = new ActionButton(n("action"), form);
00026 
00027     addChild(name);
00028     addChild(description);
00029     addChild(action);
00030         }


Member Function Documentation

void DiagnosisEditor::display boolean  hidden  )  [inline]
 

Reimplemented from Widget.

Definition at line 77 of file DiagnosisEditor.java.

References action, CANCEL, description, ActionButton::display(), TextBox::display(), name, Widget::p(), SAVE, and SAVEADD.

00078   {
00079     if (hidden)
00080     {
00081       name.display(true);
00082       description.display(true);
00083       action.display(true);
00084       return;
00085     }
00086     p(
00087 "\n"+
00088 "<h4>Diagnosis</h4>\n"+
00089 "<table>\n"+
00090 "<tr>\n"+
00091 "  <td valign=top>Name:</td>\n"+
00092 "  <td>"); name.display(); p("</td>\n"+
00093 "</tr>\n"+
00094 "<tr>\n"+
00095 "  <td valign=top>Description:</td>\n"+
00096 "  <td>"); description.display(); p("</td>\n"+
00097 "</tr>\n"+
00098 "<tr>\n"+
00099 "  <td>&nbsp;</td>\n"+
00100 "  <td>\n"+
00101 "");
00102     action.display("Save", SAVE);
00103     action.display("Save and Add Another", SAVEADD);
00104     action.display("Cancel", CANCEL); p("\n"+
00105 "  </td>\n"+
00106 "</tr>\n"+
00107 "</table>\n"+
00108 "");
00109   }

void DiagnosisEditor::loadDefaults  )  [inline]
 

Reimplemented from Widget.

Definition at line 49 of file DiagnosisEditor.java.

References active, Diagnosis::description, description, diagnoses, Diagnosis::name, name, and TextBox::text.

00050   {
00051     if (active < 0) return;
00052     Diagnosis load = (Diagnosis) diagnoses.get(active);
00053     name.text = load.name;
00054     description.text = load.description;
00055   }

void DiagnosisEditor::loadValues  )  [inline]
 

Reimplemented from Widget.

Definition at line 57 of file DiagnosisEditor.java.

References ActionButton::action, action, CANCEL, done, more, save(), SAVE, and SAVEADD.

00058         {
00059     super.loadValues();
00060 
00061     switch(action.action)
00062     {
00063       case SAVE:
00064         done = true;
00065         save();
00066       break;
00067       case CANCEL:
00068         done = true;
00069       break;
00070       case SAVEADD:
00071         more = true;
00072         save();
00073       break;
00074     }
00075         }

void DiagnosisEditor::save  )  [inline]
 

Definition at line 32 of file DiagnosisEditor.java.

References active, description, Diagnosis::description, diagnoses, name, Diagnosis::name, and TextBox::text.

00033   {
00034     Diagnosis d;
00035     if (active < 0)
00036     {
00037       d = new Diagnosis();
00038       diagnoses.add(d);
00039     }
00040     else
00041     {
00042       d = (Diagnosis) diagnoses.get(active);
00043     }
00044 
00045     d.name = name.text;
00046     d.description = description.text;
00047   }


Member Data Documentation

ActionButton DiagnosisEditor::action
 

Definition at line 7 of file DiagnosisEditor.java.

int DiagnosisEditor::active
 

Definition at line 5 of file DiagnosisEditor.java.

final int DiagnosisEditor::CANCEL = 3 [static]
 

Definition at line 11 of file DiagnosisEditor.java.

TextBox DiagnosisEditor::description
 

Definition at line 13 of file DiagnosisEditor.java.

Vector DiagnosisEditor::diagnoses
 

Definition at line 6 of file DiagnosisEditor.java.

boolean DiagnosisEditor::done = false [package]
 

Definition at line 15 of file DiagnosisEditor.java.

boolean DiagnosisEditor::more = false [package]
 

Definition at line 16 of file DiagnosisEditor.java.

TextBox DiagnosisEditor::name
 

Reimplemented from Widget.

Definition at line 13 of file DiagnosisEditor.java.

final int DiagnosisEditor::SAVE = 1 [static]
 

Definition at line 9 of file DiagnosisEditor.java.

final int DiagnosisEditor::SAVEADD = 2 [static]
 

Definition at line 10 of file DiagnosisEditor.java.


The documentation for this class was generated from the following file:
Generated on Mon Mar 6 23:34:35 2006 by  doxygen 1.4.4