Package systole.view.crud.medic

Source Code of systole.view.crud.medic.ControllerMedicView

/**
*
*/
package systole.view.crud.medic;

import systole.exceptions.ExceptionDAO;
import systole.utils.ImageUtils;
import systole.view.crud.controller.ControllerEntityView;
import systole.view.crud.tableModels.MedicTableModel;
import systole.view.messages.EntityDescriptions;
import systole.view.utils.ErrorDialog;

/**
* @author jmj
*
*/
public class ControllerMedicView extends ControllerEntityView {

    /**
     *
     * @throws ExceptionDAO
     */
    @SuppressWarnings("unchecked")
    public ControllerMedicView() throws ExceptionDAO {
        super();
        this.entityList = this.facadeDB.getMedicBroker().getAllMedics();
        this.tableModel = new MedicTableModel(this.entityList);
        this.entityName = EntityDescriptions.MEDIC;
        this.pluralEntity = EntityDescriptions.MEDICS;
        this.controllerEntityEdition = new ControllerMedicEdition();
    }

    @Override
    public void refreshList() {
        try {
            this.entityList = this.facadeDB.getMedicBroker().getAllMedics();
            this.tableModel.refreshList(entityList);
            this.entities.getjTableEntities().setModel(this.tableModel);
        } catch (ExceptionDAO ex) {
            this.facadeDB.refreshSession();
           ErrorDialog.showError(this.entities,ex.getMessage());
        }
        this.entities.getjTableEntities().revalidate();
    }

    @Override
    protected boolean canDeleteEntity() {
        return false;
    }

    @Override
    protected void loadIconOnForm() {
        this.entities.setIconImage(ImageUtils.buildImage("resources/icons/medic/medics16.png"));
        this.entities.getJXEntityHeader().setIcon(ImageUtils.buildIcon("resources/icons/medic/medics32.png"));
    }
}
TOP

Related Classes of systole.view.crud.medic.ControllerMedicView

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.