1 /******************************************************************************* 2 * Copyright (c) 2000, 2006 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 *******************************************************************************/ 11 package org.eclipse.ltk.core.refactoring; 12 13 import org.eclipse.core.runtime.IProgressMonitor; 14 15 /** 16 * A query interface to decide if a undo change whose validation check 17 * returned a status unequal {@link org.eclipse.ltk.core.refactoring.RefactoringStatus#OK} 18 * should be executed or not. 19 * <p> 20 * Clients should be aware that the methods defined by this interface can be 21 * called from a non UI thread. 22 * </p> 23 * <p> 24 * The interface may be implemented by clients. 25 * </p> 26 * 27 * @since 3.0 28 */ 29 public interface IValidationCheckResultQuery { 30 31 /** 32 * Returns whether the undo proceeds or not. This method is called if the 33 * validation check returned a status greater than <code>OK</code> and less 34 * than <code>FATAL</code>. 35 * 36 * @param status the refactoring status returned from {@link Change#isValid(IProgressMonitor)} 37 * 38 * @return <code>true</code> if the undo should proceed; <code>false</code> 39 * otherwise 40 */ 41 public boolean proceed(RefactoringStatus status); 42 43 /** 44 * Called when the validation check returned a fatal error. In this case the 45 * undo can't proceed. The hook can be used to present a corresponding dialog 46 * to the user. 47 * 48 * @param status the refactoring status returned from {@link Change#isValid(IProgressMonitor)} 49 */ 50 public void stopped(RefactoringStatus status); 51 } 52