SourceElementRequestorMode renamed
diff --git a/core/plugins/org.eclipse.dltk.core/compiler/org/eclipse/dltk/compiler/ISourceElementRequestorExtension.java b/core/plugins/org.eclipse.dltk.core/compiler/org/eclipse/dltk/compiler/ISourceElementRequestorExtension.java
index 15e51c0..cd718b2 100644
--- a/core/plugins/org.eclipse.dltk.core/compiler/org/eclipse/dltk/compiler/ISourceElementRequestorExtension.java
+++ b/core/plugins/org.eclipse.dltk.core/compiler/org/eclipse/dltk/compiler/ISourceElementRequestorExtension.java
@@ -17,10 +17,6 @@
 public interface ISourceElementRequestorExtension extends
 		ISourceElementRequestor {
 
-	int MODE_UNKNOWN = 0;
-	int MODE_STRUCTURE = 1;
-	int MODE_INDEX = 2;
-
-	int getMode();
+	SourceElementRequestorMode getMode();
 
 }
diff --git a/core/plugins/org.eclipse.dltk.core/compiler/org/eclipse/dltk/compiler/SourceElementRequestorKind.java b/core/plugins/org.eclipse.dltk.core/compiler/org/eclipse/dltk/compiler/SourceElementRequestorKind.java
deleted file mode 100644
index dba6c6c..0000000
--- a/core/plugins/org.eclipse.dltk.core/compiler/org/eclipse/dltk/compiler/SourceElementRequestorKind.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 xored software, Inc.  
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html  
- *
- * Contributors:
- *     xored software, Inc. - initial API and Implementation (Alex Panchenko)
- *******************************************************************************/
-package org.eclipse.dltk.compiler;
-
-public enum SourceElementRequestorKind {
-	STRUCTURE {
-		@Override
-		public boolean matches(ISourceElementRequestor requestor) {
-			return getMode(requestor) == ISourceElementRequestorExtension.MODE_STRUCTURE;
-		}
-	},
-	INDEXER {
-		@Override
-		public boolean matches(ISourceElementRequestor requestor) {
-			return getMode(requestor) == ISourceElementRequestorExtension.MODE_INDEX;
-		}
-	};
-
-	public abstract boolean matches(ISourceElementRequestor requestor);
-
-	private static int getMode(ISourceElementRequestor requestor) {
-		if (requestor instanceof ISourceElementRequestorExtension) {
-			return ((ISourceElementRequestorExtension) requestor).getMode();
-		} else {
-			return ISourceElementRequestorExtension.MODE_UNKNOWN;
-		}
-	}
-}
diff --git a/core/plugins/org.eclipse.dltk.core/compiler/org/eclipse/dltk/compiler/SourceElementRequestorMode.java b/core/plugins/org.eclipse.dltk.core/compiler/org/eclipse/dltk/compiler/SourceElementRequestorMode.java
new file mode 100644
index 0000000..6dedfad
--- /dev/null
+++ b/core/plugins/org.eclipse.dltk.core/compiler/org/eclipse/dltk/compiler/SourceElementRequestorMode.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2010 xored software, Inc.  
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html  
+ *
+ * Contributors:
+ *     xored software, Inc. - initial API and Implementation (Alex Panchenko)
+ *******************************************************************************/
+package org.eclipse.dltk.compiler;
+
+public enum SourceElementRequestorMode {
+	STRUCTURE, INDEX;
+
+	public boolean matches(ISourceElementRequestor requestor) {
+		return of(requestor) == this;
+	}
+
+	public static SourceElementRequestorMode of(
+			ISourceElementRequestor requestor) {
+		if (requestor instanceof ISourceElementRequestorExtension) {
+			return ((ISourceElementRequestorExtension) requestor).getMode();
+		} else {
+			return null;
+		}
+	}
+}
diff --git a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/SourceModuleStructureRequestor.java b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/SourceModuleStructureRequestor.java
index 82b8008..3a96d2a 100644
--- a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/SourceModuleStructureRequestor.java
+++ b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/SourceModuleStructureRequestor.java
@@ -16,6 +16,7 @@
 import org.eclipse.core.runtime.Assert;
 import org.eclipse.dltk.compiler.ISourceElementRequestor;
 import org.eclipse.dltk.compiler.ISourceElementRequestorExtension;
+import org.eclipse.dltk.compiler.SourceElementRequestorMode;
 import org.eclipse.dltk.compiler.util.Util;
 import org.eclipse.dltk.core.IModelElement;
 import org.eclipse.dltk.core.INamespace;
@@ -499,8 +500,8 @@
 		return new ImportDeclaration(parent, name, version);
 	}
 
-	public int getMode() {
-		return MODE_STRUCTURE;
+	public SourceElementRequestorMode getMode() {
+		return SourceElementRequestorMode.STRUCTURE;
 	}
 
 }
diff --git a/core/plugins/org.eclipse.dltk.core/search/org/eclipse/dltk/core/search/indexing/IIndexRequestor.java b/core/plugins/org.eclipse.dltk.core/search/org/eclipse/dltk/core/search/indexing/IIndexRequestor.java
deleted file mode 100644
index 5697cf7..0000000
--- a/core/plugins/org.eclipse.dltk.core/search/org/eclipse/dltk/core/search/indexing/IIndexRequestor.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.eclipse.dltk.core.search.indexing;
-
-import org.eclipse.dltk.compiler.ISourceElementRequestor;
-import org.eclipse.dltk.compiler.ISourceElementRequestorExtension;
-import org.eclipse.dltk.compiler.SourceElementRequestorKind;
-import org.eclipse.dltk.core.ISourceElementParser;
-
-/**
- * Marker interface for {@link ISourceElementRequestor} to identify if
- * {@link ISourceElementParser} was called by the indexer.
- * 
- * Deprecated since 2010-11-26
- * 
- * @see ISourceElementRequestorExtension
- * @see SourceElementRequestorKind
- * @since 2.0
- */
-@Deprecated
-public interface IIndexRequestor {
-
-}
diff --git a/core/plugins/org.eclipse.dltk.core/search/org/eclipse/dltk/core/search/indexing/SourceIndexerRequestor.java b/core/plugins/org.eclipse.dltk.core/search/org/eclipse/dltk/core/search/indexing/SourceIndexerRequestor.java
index 3b31c2b..6efee0e 100644
--- a/core/plugins/org.eclipse.dltk.core/search/org/eclipse/dltk/core/search/indexing/SourceIndexerRequestor.java
+++ b/core/plugins/org.eclipse.dltk.core/search/org/eclipse/dltk/core/search/indexing/SourceIndexerRequestor.java
@@ -14,6 +14,7 @@
 import org.eclipse.dltk.compiler.IBinaryElementRequestor;
 import org.eclipse.dltk.compiler.ISourceElementRequestor;
 import org.eclipse.dltk.compiler.ISourceElementRequestorExtension;
+import org.eclipse.dltk.compiler.SourceElementRequestorMode;
 import org.eclipse.dltk.core.DLTKCore;
 import org.eclipse.dltk.core.ISearchFactory;
 import org.eclipse.dltk.core.ISearchPatternProcessor;
@@ -24,7 +25,7 @@
  * an index.
  */
 public class SourceIndexerRequestor implements ISourceElementRequestor,
-		IBinaryElementRequestor, IIndexConstants, IIndexRequestor,
+		IBinaryElementRequestor, IIndexConstants,
 		ISourceElementRequestorExtension {
 	protected AbstractIndexer indexer;
 	// char[] packageName = CharOperation.NO_CHAR;
@@ -314,8 +315,8 @@
 		namespaces.pop();
 	}
 
-	public int getMode() {
-		return MODE_INDEX;
+	public SourceElementRequestorMode getMode() {
+		return SourceElementRequestorMode.INDEX;
 	}
 
 }