/*
 * @(#)DeleteCommand.java 5.1
 *
 */

package CH.ifa.draw.standard;


/**
 * Command to delete the selection.
 * @deprecated This class is not to be used externally and will later be hidden.
 */
@Deprecated(since = "5.0", forRemoval = true)
@SuppressWarnings("removal")
public class DeleteCommand extends FigureTransferCommand {

    /**
     * Constructs a delete command.
     * @param name the command name
     */
    public DeleteCommand(String name) {
        super(name);
    }

    @Override
    public boolean executeUndoable() {
        deleteSelection();
        getEditor().view().checkDamage();
        return true;
    }

    @Override
    public boolean isExecutable() {
        if (!super.isExecutable()) {
            return false;
        }
        return getEditor().view().selectionCount() > 0;
    }
}