package com.acme.vcutil.supplier;

import com.acme.structure.util.ConversionUtil;
import com.acme.structure.util.datalist.SimpleListSupplier;
import com.acme.vcutil.bean.UtilBean;

public class UnitGroupSupplier extends SimpleListSupplier
{
    public UnitGroupSupplier(boolean blankItemApplied)
    {
        super(blankItemApplied);
    }

    public UnitGroupSupplier()
    {
        super();
    }

    @Override
    public void loadList()
    {
        try
        {
            UtilBean utilBean = new UtilBean();
            clearList();
            list.addAll(utilBean.findUnitGroupsForList());
            itemList.addAll(ConversionUtil.getConvertedToSelectItemList(list, isBlankItemApplied()));
        }
        catch (Exception exc)
        {
            System.out.println(exc.toString());
        }
    }

    public String getListName()
    {
        return "unitgroups";
    }
}
