1 11 package org.eclipse.jdt.internal.core; 12 13 import org.eclipse.core.runtime.IProgressMonitor; 14 import org.eclipse.core.runtime.OperationCanceledException; 15 import org.eclipse.jdt.core.compiler.CategorizedProblem; 16 import org.eclipse.jdt.internal.compiler.problem.AbortCompilation; 17 import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory; 18 19 20 public class CancelableProblemFactory extends DefaultProblemFactory { 21 public IProgressMonitor monitor; 22 23 public CancelableProblemFactory(IProgressMonitor monitor) { 24 super(); 25 this.monitor = monitor; 26 } 27 28 public CategorizedProblem createProblem(char[] originatingFileName, int problemId, String [] problemArguments, String [] messageArguments, int severity, int startPosition, int endPosition, int lineNumber, int columnNumber) { 29 if (this.monitor != null && this.monitor.isCanceled()) 30 throw new AbortCompilation(true, new OperationCanceledException()); 31 return super.createProblem(originatingFileName, problemId, problemArguments, messageArguments, severity, startPosition, endPosition, lineNumber, columnNumber); 32 } 33 } 34 | Popular Tags |