Bug 47010 Make refactorings more responsive to cancel [refactoring]
I20031119 Most of our current refactorings only do a sporadic check of IProgressMonitor.isCanceled() resulting in a bad canceling behavior. We should make a path over our existing refactoring and queck the cancel state at least after each compilation unit we have processes in checkInput and createChange. The code pattern to add should look like this: pm.worked(...) if (pm.isCanceled()) { // clean-up state if necessary throw new OperationCancelException(); }
org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/core/refactoring/participants/ProcessorBasedRefactoring.java
* {@inheritDoc}
	 */
	public RefactoringStatus checkFinalConditions(IProgressMonitor pm) throws CoreException {
		RefactoringStatus result= new RefactoringStatus();
		CheckConditionsContext context= createCheckConditionsContext();
		
		pm.beginTask("", 9); 
		pm.setTaskName(RefactoringCoreMessages.getString("ProcessorBasedRefactoring.final_conditions")); 
		
		result.merge(getProcessor().checkFinalConditions(new SubProgressMonitor(pm, 5), context));
		if (result.hasFatalError()) {
			pm.done();
			return result;
		}
		
		fParticipants= getProcessor().loadParticipants(result, fSharedParticipants);
		if (fParticipants == null) 
			fParticipants= EMPTY_PARTICIPANTS;
		if (result.hasFatalError()) {
			pm.done();
			return result;
		}
		IProgressMonitor sm= new SubProgressMonitor(pm, 2);
		sm.beginTask("", fParticipants.length); 
		for (int i= 0; i < fParticipants.length && !result.hasFatalError(); i++) {
			result.merge(fParticipants[i].checkConditions(new SubProgressMonitor(sm, 1), context));
			if (sm.isCanceled())
				throw new OperationCanceledException();
		}
		sm.done();