/// class ProspectDirector.Web.UI.Queries.Commands.RemoveConstraint
/// using ProspectDirector.Web.UI.Command

/**
@class RemoveConstraint
@constructor
@namespace Web.UI.Queries.Commands
**/
ProspectDirector.Web.UI.Queries.Commands.RemoveConstraint = ProspectDirector.Web.UI.Command.extend({

    //================================
    // PROPERTIES
    //================================

    get_editor: function () {
        return this.get_options().editor;
    },

    get_selectedConstraint: function () {
        return this.get_options().selectedConstraint;
    },

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

    execute: function () {

        var selectedConstraintId = this.get_selectedConstraint() ? this.get_selectedConstraint().get_id() : undefined;

        if (selectedConstraintId) {
            this.get_editor().remove(selectedConstraintId);
        }
        
    }

});