/// class ProspectDirector.Web.UI.Controls.ToolBarButtonFactory
/// using ProspectDirector.Web.UI.Controls.Control

/**
@class ToolBarButtonFactory
@namespace Web.UI.Controls
@constructor
**/
ProspectDirector.Web.UI.Controls.ToolBarButtonFactory = Class.extend({

});

ProspectDirector.Web.UI.Controls.ToolBarButtonFactory.CreateButton = function (data) {

    var result = null;

    switch (data.type) {
        case "group":
            result = new ProspectDirector.Web.UI.Controls.ToolBarButtonGroup(data);
            break;
        case "dropdown":
            result = new ProspectDirector.Web.UI.Controls.ToolBarDropDown(data);
            break;
        case "item":
            result = new ProspectDirector.Web.UI.Controls.ToolBarItem(data);
            break;
        case "splitbutton":
            result = new ProspectDirector.Web.UI.Controls.ToolBarSplitButton(data);
            break;
        default:
            result = new ProspectDirector.Web.UI.Controls.ToolBarButton(data);
            break;
    }

    return result;

};