/// class PD.Manage.Modules.ObjectModel.ProcessPropertiesDialogCommand

PD.Manage.Modules.ObjectModel.ProcessPropertiesDialogCommand =
PD.Commands.Command.extend({

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

    setDefaults: function () {

        this.props("id", "process/properties-dialog");
        this.props("enabled", true);
        this.props("icon", PD.Path.to16x16("pencil.png"));
        this.props("label", "Edit");
        this.props("tooltip", "Edit the selected Process.");

        this.state("processId", null);

    },

    setState: function (state) {
        this._super(state);
        this.props("enabled", this.state("processId") != null);
    },

    execute: function (e) {
        this._super(e);
        this._showDialog(this.state("processId"));
    },

    //===================================
    // PRIVATE METHODS
    //===================================

    _showDialog: function (processId) {

        PD.Manage.Modules.ObjectModel.ProcessPropertiesDialog.show({
            params: {
                id: processId
            },
            callbacks: {
                ok: function (sender, e) {
                    PD.context.get_default().get_events().publish("process/update", {
                        id: processId
                    });
                }
            }
        });

    }

});