Package systole.view.crud.patient.patientComponents.medicines

Source Code of systole.view.crud.patient.patientComponents.medicines.ControllerViewMedicineByPatient

/**
*
*/
package systole.view.crud.patient.patientComponents.medicines;

import java.util.ArrayList;
import org.jdesktop.swingx.JXTable;
import systole.domain.clinicalInformation.MedicinePatient;
import systole.domain.persons.Patient;
import systole.exceptions.ExceptionDAO;

import systole.view.crud.patient.patientComponents.controller.ControllerViewPatientComponent;
import systole.view.crud.tableModels.MedicinesByPatienteTableModel;

/**
* @author jmj
*
*/
public class ControllerViewMedicineByPatient extends ControllerViewPatientComponent {

    /**
     * @param table
     * @param patient
     * @param editing
     * @throws ExceptionDAO
     */
    public ControllerViewMedicineByPatient(JXTable table, Patient patient, boolean editing) throws ExceptionDAO {
        super(table, patient, editing);
        this.entityList = this.entityList = new ArrayList(this.patient.getMedicinesPatient());
        this.tableModel = new MedicinesByPatienteTableModel(this.entityList);
        this.table.setModel(this.tableModel);
        this.controllerEntityEdition = new ControllerEditionMedicineByPatient(patient);
    }

    /* (non-Javadoc)
     * @see systole.view.crud.patient.patientComponents.controller.ControllerViewPatientComponent#deleteEntity(java.lang.Object)
     */
    @Override
    protected void deleteEntity(Object entity) {
        this.patient.getMedicinesPatient().remove((MedicinePatient) entity);
    }

    /* (non-Javadoc)
     * @see systole.view.crud.patient.patientComponents.controller.ControllerViewPatientComponent#refreshList()
     */
    @Override
    protected void refreshList() {
        this.entityList = new ArrayList(this.patient.getMedicinesPatient());
        this.tableModel.refreshList(this.entityList);
        this.table.setModel(this.tableModel);
        this.table.revalidate();
    }
}
TOP

Related Classes of systole.view.crud.patient.patientComponents.medicines.ControllerViewMedicineByPatient

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.