Package systole.view.crud.family

Source Code of systole.view.crud.family.ControllerFamilyView

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package systole.view.crud.family;

import systole.exceptions.ExceptionDAO;
import systole.utils.ImageUtils;
import systole.view.crud.controller.ControllerEntityView;
import systole.view.crud.tableModels.FamilyTableModel;
import systole.view.utils.ErrorDialog;

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

    /**
     *
     * @throws ExceptionDAO
     */
    @SuppressWarnings("unchecked")
    public ControllerFamilyView() throws ExceptionDAO {
        super();
        this.entityList = this.facadeDB.getFamilyBroker().getAllFamilies();
        this.tableModel = new FamilyTableModel(this.entityList);
        this.entityName = "Familiar";
        this.pluralEntity = "Familiares";
        this.controllerEntityEdition = new ControllerFamilyEdition();
    }

    @Override
    public void refreshList() {
        try {
            this.entityList = this.facadeDB.getFamilyBroker().getAllFamilies();
            this.tableModel.refreshList(this.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/family/family16.png"));
        this.entities.getJXEntityHeader().setIcon(ImageUtils.buildIcon("resources/icons/family/family32.png"));
    }
}
TOP

Related Classes of systole.view.crud.family.ControllerFamilyView

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.