001    /**
002     * <copyright> 
003     *
004     * Copyright (c) 2008 IBM Corporation and others.
005     * All rights reserved.   This program and the accompanying materials
006     * are made available under the terms of the Eclipse Public License v1.0
007     * which accompanies this distribution, and is available at
008     * http://www.eclipse.org/legal/epl-v10.html
009     * 
010     * Contributors: 
011     *   IBM - Initial API and implementation
012     *
013     * </copyright>
014     *
015     * $Id: AbortExecutionException.java,v 1.1 2008/04/29 22:25:51 davidms Exp $
016     */
017    package org.eclipse.emf.common.command;
018    
019    /**
020     * An exception thrown when a command's {@link Command#execute() execution} is to be silently aborted.
021     * This is a signal to the command stack to behave as if {@link Command#canExecute() canExecute} returned <code>false</code>.
022     * Only a command that has not changed the state of the model should be aborted in this way.
023     */
024    public class AbortExecutionException extends RuntimeException
025    {
026      private static final long serialVersionUID = 1L;
027    
028      /**
029       * Constructs an new instance.
030       */
031      public AbortExecutionException()
032      {
033        super();
034      }
035    
036      /**
037       * Constructs a new instance with the given message and cause.
038       * @param message a description of the reason for aborting.
039       * @param cause an indication of why execution was aborted.
040       */
041      public AbortExecutionException(String message, Throwable cause)
042      {
043        super(message, cause);
044      }
045    
046      /**
047       * Constructs a new instance with the given message.
048       * @param message a description of the reason for aborting.
049       */
050      public AbortExecutionException(String message)
051      {
052        super(message);
053      }
054    
055      /**
056       * Constructs a new instance with the given message and cause.
057       * @param cause an indication of why execution was aborted.
058       */
059      public AbortExecutionException(Throwable cause)
060      {
061        super(cause);
062      }
063    }