/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package adt.evente.gui.recherche;

import adt.evente.business.VisiteurFacade;
import adt.evente.dto.CategorieDto;
import adt.evente.exception.EventeBusinessException;
import adt.evente.gui.outils.MaComboBox;

/**
 *
 * @author ADT
 */
public class ComboCategorie extends MaComboBox<CategorieDto> {
    public ComboCategorie() throws EventeBusinessException {
        super(VisiteurFacade.getAllCategorie().toArray(new CategorieDto[0]), true, "getLibelle");
    }

    public ComboCategorie(boolean repNonSaisi) throws EventeBusinessException {
        super(VisiteurFacade.getAllCategorie().toArray(new CategorieDto[0]), repNonSaisi, "getLibelle");
    }
    
    public void refresh() throws EventeBusinessException{
        setModel(VisiteurFacade.getAllCategorie().toArray(new CategorieDto[0]));
    }
    
    public CategorieDto getCategorie(){
        return getObjectSelected();
    }
    
    public void setCategorie(CategorieDto cat){
        setSelectionByObject(cat);
    }
    
        
    public void setCategorie(int catId){
        setSelectionById(catId);
    }
}
