Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-patch] Open Type dialog

This patch handles an uncaught OperationCanceledException when a search operation is cancelled from the progress dialog.

Chris

Index: src/org/eclipse/cdt/internal/ui/opentype/TypeSearchOperation.java
===================================================================
retrieving revision 1.1
diff -u -r1.1 TypeSearchOperation.java
--- src/org/eclipse/cdt/internal/ui/opentype/TypeSearchOperation.java	28 Jan 2004 21:23:08 -0000	1.1
+++ src/org/eclipse/cdt/internal/ui/opentype/TypeSearchOperation.java	5 Feb 2004 17:48:24 -0000
@@ -16,6 +16,7 @@
 import org.eclipse.cdt.internal.core.search.matching.OrPattern;
 import org.eclipse.core.resources.IWorkspace;
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 
 public class TypeSearchOperation implements IRunnableWithProgress {
@@ -46,7 +47,12 @@
 	
 	public void run(IProgressMonitor monitor) throws InterruptedException {
 		collector.setProgressMonitor(monitor);
-		engine.search(workspace, pattern, scope, collector, true);
+		try {
+			engine.search(workspace, pattern, scope, collector, true);
+		}
+		catch (OperationCanceledException e) {
+			throw new InterruptedException();
+		}
 		if (monitor.isCanceled()) {
 			throw new InterruptedException();
 		}

Back to the top