CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings(cu.getJavaProject());
	public void addIteratorImport() {		ICompilationUnit cu= getCompilationUnit();		if (cu == null) {			return;		}			try {			Position position= new Position(getCompletionOffset(), getCompletionLength());			IDocument document= getDocument();			final String category= "__template_position_importer" + System.currentTimeMillis(); //$NON-NLS-1$			IPositionUpdater updater= new DefaultPositionUpdater(category);			document.addPositionCategory(category);			document.addPositionUpdater(updater);			document.addPosition(position);			try {								CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();				ImportsStructure structure= new ImportsStructure(cu, settings.importOrder, settings.importThreshold, true);				structure.addImport("java.util.Iterator"); //$NON-NLS-1$				structure.create(false, null);								setCompletionOffset(position.getOffset());				setCompletionLength(position.getLength());							} catch (CoreException e) {				handleException(null, e);			} finally {				document.removePosition(position);				document.removePositionUpdater(updater);				document.removePositionCategory(category);			}					} catch (BadLocationException e) {			handleException(null, e);		} catch (BadPositionCategoryException e) {			handleException(null, e);		}	}