model: move getNameRange() from IMember to ISourceReference
diff --git a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/core/IMember.java b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/core/IMember.java
index d4a3b0f..172d9ba 100644
--- a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/core/IMember.java
+++ b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/core/IMember.java
@@ -13,21 +13,6 @@
  * Common protocol for model elements that can be members of modules.
  */
 public interface IMember extends IModelElement, ISourceReference, IParent {
-	/**
-	 * Returns the source range of this member's simple name, or
-	 * <code>null</code> if this member does not have a name (for example, an
-	 * initializer), or if this member does not have associated source code (for
-	 * example, a binary type).
-	 * 
-	 * @exception ModelException
-	 *                if this element does not exist or if an exception occurs
-	 *                while accessing its corresponding resource.
-	 * @return the source range of this member's simple name, or
-	 *         <code>null</code> if this member does not have a name (for
-	 *         example, an initializer), or if this member does not have
-	 *         associated source code (for example, a binary type)
-	 */
-	ISourceRange getNameRange() throws ModelException;
 
 	/**
 	 * Returns the modifier flags for this member.
diff --git a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/core/ISourceReference.java b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/core/ISourceReference.java
index 48ad51e..7a27f04 100644
--- a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/core/ISourceReference.java
+++ b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/core/ISourceReference.java
@@ -49,4 +49,40 @@
 	 * @exception ModelException if an exception occurs while accessing its corresponding resource
 	 */
 	String getSource() throws ModelException;
+
+	/**
+	 * Returns the name range associated with this element.
+	 * 
+	 * <p>
+	 * If the element is an {@link IMember}, it returns the source range of this
+	 * member's simple name, or <code>null</code> if this member does not have a
+	 * name (for example, an initializer), or if this member does not have
+	 * associated source code (for example, a binary type).
+	 * </p>
+	 * 
+	 * <p>
+	 * If this element is an {@link IImportDeclaration}, the source range of
+	 * this import declaration's name, or <code>null</code> if this import
+	 * declaration does not have associated source code (for example, a binary
+	 * type). <br>
+	 * The source range for the name includes the trailing '*' if the call to
+	 * {@link IImportDeclaration#isOnDemand()} returns true.
+	 * </p>
+	 * 
+	 * <p>
+	 * If this element is an {@link IPackageDeclaration}, the source range of
+	 * this package declaration's name, or <code>null</code> if this package
+	 * declaration does not have associated source code (for example, a binary
+	 * type).
+	 * </p>
+	 * 
+	 * <p>
+	 * If this element is an {@link IImportContainer}, it returns null.
+	 * </p>
+	 * 
+	 * @return the name range associated with this element, or <code>null</code>
+	 *         if not available
+	 * @since 5.0
+	 */
+	ISourceRange getNameRange() throws ModelException;
 }
diff --git a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/AbstractSourceModule.java b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/AbstractSourceModule.java
index ecf9011..0be6307 100644
--- a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/AbstractSourceModule.java
+++ b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/AbstractSourceModule.java
@@ -757,4 +757,7 @@
 		return false;
 	}
 
+	public ISourceRange getNameRange() throws ModelException {
+		return null;
+	}
 }
diff --git a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/ImportContainer.java b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/ImportContainer.java
index 21ecb02..e3f467f 100644
--- a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/ImportContainer.java
+++ b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/ImportContainer.java
@@ -189,4 +189,8 @@
 		}
 		output.dedent();
 	}
+
+	public ISourceRange getNameRange() throws ModelException {
+		return null;
+	}
 }
diff --git a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/ImportDeclaration.java b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/ImportDeclaration.java
index 0bfa4d2..695978a 100644
--- a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/ImportDeclaration.java
+++ b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/ImportDeclaration.java
@@ -13,6 +13,7 @@
 import org.eclipse.core.runtime.Assert;
 import org.eclipse.dltk.core.IImportDeclaration;
 import org.eclipse.dltk.core.IModelElement;
+import org.eclipse.dltk.core.ISourceRange;
 import org.eclipse.dltk.core.ModelException;
 import org.eclipse.dltk.utils.CorePrinter;
 
@@ -133,4 +134,8 @@
 	public void printNode(CorePrinter output) {
 		output.formatPrint(getElementName());
 	}
+
+	public ISourceRange getNameRange() throws ModelException {
+		return getSourceRange();
+	}
 }
diff --git a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/PackageDeclaration.java b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/PackageDeclaration.java
index 114e0bb..9b9ec58 100644
--- a/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/PackageDeclaration.java
+++ b/core/plugins/org.eclipse.dltk.core/model/org/eclipse/dltk/internal/core/PackageDeclaration.java
@@ -12,6 +12,7 @@
 import org.eclipse.dltk.core.IModelElement;
 import org.eclipse.dltk.core.IPackageDeclaration;
 import org.eclipse.dltk.core.ISourceModule;
+import org.eclipse.dltk.core.ISourceRange;
 import org.eclipse.dltk.core.ModelException;
 import org.eclipse.dltk.utils.CorePrinter;
 
@@ -79,4 +80,8 @@
 
 	public void printNode(CorePrinter output) {
 	}
+
+	public ISourceRange getNameRange() throws ModelException {
+		return getSourceRange();
+	}
 }