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

package CH.ifa.draw.standard;


/**
 * Copy the selection to the clipboard.
 * See {@link CH.ifa.draw.util.Clipboard}.
 * @deprecated This class is not to be used externally and will later be hidden.
 */
@Deprecated(since = "5.0", forRemoval = true)
@SuppressWarnings("removal")
public class CopyCommand extends FigureTransferCommand {

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

    @Override
    public boolean executeUndoable() {
        copySelection();
        return false;
    }

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