From fed650628278b01bc09c174fb98f9af8ce41ef4b Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Fri, 28 Apr 2006 22:09:53 +0000 Subject: [PATCH] Added cancel for Fast Reindexing jobs. --- .../internal/core/pdom/indexer/fast/PDOMFastReindex.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/fast/PDOMFastReindex.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/fast/PDOMFastReindex.java index 301511438b6..3693900f06b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/fast/PDOMFastReindex.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/fast/PDOMFastReindex.java @@ -44,6 +44,8 @@ public class PDOMFastReindex extends PDOMFastIndexerJob { final int[] count = { 0 }; pdom.getProject().accept(new ICElementVisitor() { public boolean visit(ICElement element) throws CoreException { + if (monitor.isCanceled()) + throw new CoreException(Status.CANCEL_STATUS); switch (element.getElementType()) { case ICElement.C_UNIT: ++count[0]; @@ -61,6 +63,8 @@ public class PDOMFastReindex extends PDOMFastIndexerJob { // First index all the source files (i.e. not headers) pdom.getProject().accept(new ICElementVisitor() { public boolean visit(ICElement element) throws CoreException { + if (monitor.isCanceled()) + throw new CoreException(Status.CANCEL_STATUS); switch (element.getElementType()) { case ICElement.C_UNIT: ITranslationUnit tu = (ITranslationUnit)element; @@ -85,6 +89,8 @@ public class PDOMFastReindex extends PDOMFastIndexerJob { // Now add in the header files but only if they aren't already indexed pdom.getProject().accept(new ICElementVisitor() { public boolean visit(ICElement element) throws CoreException { + if (monitor.isCanceled()) + throw new CoreException(Status.CANCEL_STATUS); switch (element.getElementType()) { case ICElement.C_UNIT: ITranslationUnit tu = (ITranslationUnit)element;