/// class PD.Manage.Modules.ObjectModel.ExplorerFolderMoveCommand

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

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

    setDefaults: function () {

        this.props("id", "explorer-folder/update");
        this.props("enabled", true);
        this.props("label", "Save");
        this.props("icon", PD.Path.to16x16("floppy_disk.png"));
        this.props("tooltip", "Save");
        this.props("visible", true);
        
        this.state("folderId", null);
        this.state("destinationId", null);
        this.state("movePosition", null);

    },

    execute: function (e) {
        this._super(e);

        var service = new PD.Manage.Services.ExplorerModelService(),
            folderId = this.state("folderId"),
            destinationId = this.state("destinationId"),
            movePosition = this.state("movePosition");

        service.moveFolder(folderId, destinationId, movePosition, function (result) {
            PD.context.get_default().get_events().publish("explorer-folder/move", {});
        });

    }

});