/******************************************************************************* * Copyright (c) 2012 Obeo. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Obeo - initial API and implementation *******************************************************************************/ package org.eclipse.emf.compare.tests.command; import java.util.ArrayList; import java.util.Collection; import org.eclipse.emf.common.command.Command; import org.eclipse.emf.compare.command.ICompareCopyCommand; /** * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a> */ public class MockCompareCommand implements ICompareCopyCommand { private final boolean leftToRight; public MockCompareCommand(boolean leftToRight) { this.leftToRight = leftToRight; } /** * {@inheritDoc} * * @see org.eclipse.emf.common.command.Command#canExecute() */ public boolean canExecute() { return true; } /** * {@inheritDoc} * * @see org.eclipse.emf.common.command.Command#execute() */ public void execute() { } /** * {@inheritDoc} * * @see org.eclipse.emf.common.command.Command#canUndo() */ public boolean canUndo() { return true; } /** * {@inheritDoc} * * @see org.eclipse.emf.common.command.Command#undo() */ public void undo() { } /** * {@inheritDoc} * * @see org.eclipse.emf.common.command.Command#redo() */ public void redo() { } /** * {@inheritDoc} * * @see org.eclipse.emf.common.command.Command#getResult() */ public Collection<?> getResult() { return new ArrayList<Object>(); } /** * {@inheritDoc} * * @see org.eclipse.emf.common.command.Command#getAffectedObjects() */ public Collection<?> getAffectedObjects() { return new ArrayList<Object>(); } /** * {@inheritDoc} * * @see org.eclipse.emf.common.command.Command#getLabel() */ public String getLabel() { return MockCompareCommand.class.getName(); } /** * {@inheritDoc} * * @see org.eclipse.emf.common.command.Command#getDescription() */ public String getDescription() { return MockCompareCommand.class.getName(); } /** * {@inheritDoc} * * @see org.eclipse.emf.common.command.Command#dispose() */ public void dispose() { } /** * {@inheritDoc} * * @see org.eclipse.emf.common.command.Command#chain(org.eclipse.emf.common.command.Command) */ public Command chain(Command command) { throw new UnsupportedOperationException(); } /** * {@inheritDoc} * * @see org.eclipse.emf.compare.command.ICompareCopyCommand#isLeftToRight() */ public boolean isLeftToRight() { return leftToRight; } }