/**
*
*/
package systole.view.crud.patient.patientComponents.clinicalInfo;
import java.util.ArrayList;
import org.jdesktop.swingx.JXTable;
import systole.domain.clinicalInformation.ClinicalInformation;
import systole.domain.persons.Patient;
import systole.view.crud.patient.patientComponents.controller.ControllerViewPatientComponent;
import systole.view.crud.tableModels.ClinicalInfoTableModel;
/**
* @author jmj
*
*/
public class ControllerViewClinicalInfoByPatient extends ControllerViewPatientComponent {
/**
* @param table
* @param patient
* @param editing
* @throws ExceptionDAO
*/
public ControllerViewClinicalInfoByPatient(JXTable table, Patient patient, boolean editing) {
super(table, patient, editing);
this.entityList = this.entityList = new ArrayList(this.patient.getClinicalInformation());
this.tableModel = new ClinicalInfoTableModel(this.entityList);
this.table.setModel(this.tableModel);
this.controllerEntityEdition = new ControllerEditionClinicalInfoByPatient(patient);
}
/* (non-Javadoc)
* @see systole.view.crud.patient.patientComponents.controller.ControllerViewPatientComponent#deleteEntity(java.lang.Object)
*/
@Override
protected void deleteEntity(Object entity) {
this.patient.getClinicalInformation().remove((ClinicalInformation) entity);
}
/* (non-Javadoc)
* @see systole.view.crud.patient.patientComponents.controller.ControllerViewPatientComponent#refreshList()
*/
@Override
protected void refreshList() {
this.entityList = new ArrayList(this.patient.getClinicalInformation());
this.tableModel.refreshList(this.entityList);
this.table.setModel(this.tableModel);
this.table.revalidate();
}
}