IPreferenceStore prefs= JavaPlugin.getDefault().getPreferenceStore(); boolean useCodeFormatter= prefs.getBoolean(PreferenceConstants.TEMPLATES_USE_CODEFORMATTER);  IJavaProject project= getCompilationUnit() != null ? getCompilationUnit().getJavaProject() : null; JavaFormatter formatter= new JavaFormatter(TextUtilities.getDefaultLineDelimiter(getDocument()), getIndentation(), useCodeFormatter, project); formatter.format(buffer, this);
	public TemplateBuffer evaluate(Template template) throws BadLocationException, TemplateException {		TemplateTranslator translator= new TemplateTranslator();		TemplateBuffer buffer= translator.translate(template);		getContextType().resolve(buffer, this);					return buffer;	}