Bug 20424 Autocompletion "Iterate through Collection" should add "import java.util.Iterator"
I use autocompletion to generate an iteration through a collection. So this is the kind of code I'm getting: for (Iterator iter = myCollection.iterator(); iter.hasNext();) { type element = (type) iter.next(); However, autocompletion leaves my .java file without the neccessary import java.util.Iterator; required for all of this to make sense. I feel it's not as "auto" and not as "complete" as it could be (if you pardon the pun).
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateProposal.java
}
	private void openErrorDialog(BadLocationException e) {
		Shell shell= fViewer.getTextWidget().getShell();
		MessageDialog.openError(shell, TemplateMessages.getString("TemplateEvaluator.error.title"), e.getMessage()); 
	}
	private void handleException(CoreException e) {
		Shell shell= fViewer.getTextWidget().getShell();
		ExceptionHandler.handle(e, shell, TemplateMessages.getString("TemplateEvaluator.error.title"), null); 
	}
	/*
	 * @see IJavaCompletionProposal#getRelevance()
	 */
	public int getRelevance() {
		if (fContext instanceof JavaContext) {
			JavaContext context= (JavaContext) fContext;
			switch (context.getCharacterBeforeStart()) {
			
			case ' ':
			case '\r':
			case '\n':
			case '\t':
				return 90;
			default:
				return 0;
			}
		} else {
			return 90;			
		}
	}
}