From 7fa8a0305ef39d11f5984b386546fd1a601b7a4b Mon Sep 17 00:00:00 2001 From: Bogdan Gheorghe Date: Fri, 28 May 2004 22:07:10 +0000 Subject: [PATCH] Fix for Bug 63831 - Ability to determine when the index is incomplete Provided a way for external clients to query the index state of a project --- core/org.eclipse.cdt.core/index/ChangeLog | 4 ++ .../org/eclipse/cdt/core/index/Indexer.java | 70 +++++++++++++++++++ .../core/search/indexing/IndexManager.java | 2 +- 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 core/org.eclipse.cdt.core/index/org/eclipse/cdt/core/index/Indexer.java diff --git a/core/org.eclipse.cdt.core/index/ChangeLog b/core/org.eclipse.cdt.core/index/ChangeLog index 1ad4803d0ed..3a683b3b557 100644 --- a/core/org.eclipse.cdt.core/index/ChangeLog +++ b/core/org.eclipse.cdt.core/index/ChangeLog @@ -1,3 +1,7 @@ +2004-05-28 Bogdan Gheorghe + Fix for Bug 63831 - Ability to determine when the index is incomplete + Provided a way for external clients to query the index state of a project + 2004-05-28 Bogdan Gheorghe Fix for Bug 60946 - [Indexer] indexer should provide notification whenever index changes Provide a notification to the listener of index events diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/core/index/Indexer.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/core/index/Indexer.java new file mode 100644 index 00000000000..624567a7220 --- /dev/null +++ b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/core/index/Indexer.java @@ -0,0 +1,70 @@ +/* + * Created on May 28, 2004 + * + * TODO To change the template for this generated file go to + * Window - Preferences - Java - Code Style - Code Templates + */ +package org.eclipse.cdt.core.index; + +import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.internal.core.search.indexing.IndexManager; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; + +/** + * @author bgheorgh + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +public class Indexer { + private static Indexer indexer = null; + private static IndexManager manager= CCorePlugin.getDefault().getCoreModel().getIndexManager(); + + public static boolean indexEnabledOnAllProjects(){ + IProject[] projects= CCorePlugin.getWorkspace().getRoot().getProjects(); + boolean allEnabled = true; + for (int i=0; i