using Habanero.BO;
using Habanero.Faces.Base;
using <<BOPROJECTNAME>>;

namespace <<NAMESPACE>>
{
    public class <<CLASSNAME>>GridControlManager : IControlManager
    {
        private readonly IReadOnlyGridControl _grid;
        private readonly IControlHabanero _control;
        private readonly IControlFactory _controlFactory;

        public <<CLASSNAME>>GridControlManager(IControlFactory controlFactory)
        {
			_controlFactory = controlFactory;
			_control = _controlFactory.CreateUserControl(this.GetType().Name);
            _grid = _controlFactory.CreateReadOnlyGridControl();
            BorderLayoutManager manager = _controlFactory.CreateBorderLayoutManager(_control);
            manager.AddControl(_grid, BorderLayoutManager.Position.Centre);
            BusinessObjectCollection<<<CLASSNAME>>> boCollection = Broker.GetBusinessObjectCollection<<<CLASSNAME>>>("");
            _grid.SetBusinessObjectCollection(boCollection);
        }

		public IControlHabanero Control
		{
			get { return _control; }
		}		
    }
}