/// class PD.Web.UI.Controls.ViewGridCommand
/// using PD.Commands.Command

PD.Web.UI.Controls.ViewGridCommand =
PD.Commands.Command.extend({

    //===================================
    // PUBLIC METHODS
    //===================================

    get_viewGrid: function () {
        return this.state("viewGrid");
    },

    get_viewStateId: function () {
        return this.get_viewGrid().get_viewStateId();
    },

    //===================================
    // PUBLIC METHODS
    //===================================

    setDefaults: function () {
        this.props("visible", true);
        this.state("viewGrid", null);
    },

    setState: function (state) {
        this._super(state);
        this.props("enabled", this._isEnabled());
        this.props("visible", this._isVisible());
    },

    //===================================
    // PROTECTED METHODS
    //===================================

    _isEnabled: function () {
        return this.get_viewGrid() != null;
    },

    _isVisible: function () {
        return true;
    }

});