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

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

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

    setDefaults: function () {

        this._super();

        this.props("id", "editor/line-numbers/show");
        this.props("enabled", true);
        this.props("icon", PD.Path.to16x16("list_style_numbered.png"));
        this.props("canExecute", true);
        this.props("toggled", null);
        this.props("tooltip", "Line Numbers");

        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.showLineNumbers(!editor.showLineNumbers());
        }

    },

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

    isToggled: function () {

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

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

        return result;

    }

});