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

ReferralEditor Class Reference

Inheritance diagram for ReferralEditor:

Widget List of all members.

Public Member Functions

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

Public Attributes

int active
Vector referrals
ActionButton action
DoctorSelect doctor
boolean incoming

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 4 of file ReferralEditor.java.


Constructor & Destructor Documentation

ReferralEditor::ReferralEditor int  active,
Vector  referrals,
String  prefix,
Form  form
[inline]
 

Definition at line 20 of file ReferralEditor.java.

References action, Widget::addChild(), doctor, and Widget::n().

00021         {
00022           super(prefix, form);
00023           this.active = active;
00024           this.referrals = referrals;
00025     action = new ActionButton(n("action"), form);
00026     doctor = new DoctorSelect(0, 7, n("doctor"), form);
00027     addChild(action);
00028     addChild(doctor);
00029         }


Member Function Documentation

void ReferralEditor::display boolean  hidden  )  [inline]
 

Reimplemented from Widget.

Definition at line 77 of file ReferralEditor.java.

References action, CANCEL, ActionButton::display(), DoctorSelect::display(), doctor, incoming, Widget::modalChild, Widget::n(), Widget::p(), Widget::printAttribute(), SAVE, and SAVEADD.

00078   {
00079     super.display(hidden);
00080     if (hidden || modalChild != null)
00081     {
00082       printAttribute("incoming", incoming ? "1" : "0");
00083       return;
00084     }
00085     p(
00086 "\n"+
00087 "<table>\n"+
00088 "<tr>\n"+
00089 "  <td>Referral</td>\n"+
00090 "  <td><select name=" + n("incoming") + ">"
00091   + "<option value=1" + (incoming ? " selected" : "") + ">From"
00092   + "<option value=0" + (incoming ? "" : " selected") + ">To"
00093   + "</select></td>\n"+
00094 "  <td>"); doctor.display(); p("</td>\n"+
00095 "</tr>\n"+
00096 "<tr>\n"+
00097 "  <td colspan=3 align=center>\n"+
00098 "");
00099     action.display("Save", SAVE);
00100     action.display("Save and Add Another", SAVEADD);
00101     action.display("Cancel", CANCEL); p("\n"+
00102 "  </td>\n"+
00103 "</tr>\n"+
00104 "</table>\n"+
00105 "");
00106   }

void ReferralEditor::loadDefaults  )  [inline]
 

Reimplemented from Widget.

Definition at line 48 of file ReferralEditor.java.

References active, doctor, Referral::doctor_id, SelectBox::id, Referral::incoming, incoming, and referrals.

00049   {
00050     if (active < 0) return;
00051     Referral load = (Referral) referrals.get(active);
00052     doctor.id = new Integer(load.doctor_id);
00053     incoming = load.incoming;
00054   }

void ReferralEditor::loadValues  )  [inline]
 

Reimplemented from Widget.

Definition at line 56 of file ReferralEditor.java.

References ActionButton::action, action, CANCEL, done, incoming, Widget::loadAttribute(), more, save(), SAVE, SAVEADD, and Widget::toInt().

00057         {
00058     super.loadValues();
00059     incoming = toInt(loadAttribute("incoming"), 0) != 0;
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 ReferralEditor::save  )  [inline]
 

Definition at line 31 of file ReferralEditor.java.

References active, doctor, Referral::doctor_id, SelectBox::id, incoming, Referral::incoming, and referrals.

00032   {
00033     Referral r;
00034     if (active < 0)
00035     {
00036       r = new Referral();
00037       referrals.add(r);
00038     }
00039     else
00040     {
00041       r = (Referral) referrals.get(active);
00042     }
00043 
00044     r.doctor_id = doctor.id.intValue(); // XXX: doctor.id could be null
00045     r.incoming = incoming;
00046   }


Member Data Documentation

ActionButton ReferralEditor::action
 

Definition at line 8 of file ReferralEditor.java.

int ReferralEditor::active
 

Definition at line 6 of file ReferralEditor.java.

final int ReferralEditor::CANCEL = 3 [static]
 

Definition at line 12 of file ReferralEditor.java.

DoctorSelect ReferralEditor::doctor
 

Definition at line 14 of file ReferralEditor.java.

boolean ReferralEditor::done = false [package]
 

Definition at line 17 of file ReferralEditor.java.

boolean ReferralEditor::incoming
 

Definition at line 15 of file ReferralEditor.java.

boolean ReferralEditor::more = false [package]
 

Definition at line 18 of file ReferralEditor.java.

Vector ReferralEditor::referrals
 

Definition at line 7 of file ReferralEditor.java.

final int ReferralEditor::SAVE = 1 [static]
 

Definition at line 10 of file ReferralEditor.java.

final int ReferralEditor::SAVEADD = 2 [static]
 

Definition at line 11 of file ReferralEditor.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