/// class PD.Manage.Shared.AceEditor.EditorToggleIndentsCommand
// using PD.Commands.Command

PD.Manage.Shared.AceEditor.EditorToggleIndentsCommand =
PD.Commands.Command.extend({

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

    setDefaults: function () {

        this._super();

        this.props("id", "editor/indents/show");
        this.props("enabled", true);
        this.props("icon", PD.Path.to16x16("code.png"));
        this.props("canExecute", true);
        this.props("toggled", false);
        this.props("tooltip", "Toggle Indents");
        
        this.state("editor", null);

    },

    setState: function (state) {
        this._super(state);
        this.props("enabled", this.isEnabled());
        this.props("toggled", this.isToggled());
    },

    execute: function (e) {
        this._super(e);
        
        var editor = this.state("editor");

        if (editor != null) {
            result = editor.showIndents(!editor.showIndents());
        }

    },

    isEnabled: function () {
        return this.state("editor") != null;
    },

    isToggled: function () {

        var result = false,
            editor = this.state("editor");

        if (editor != null) {
            result = editor.showIndents();
        }

        return result;
        
    }

});