@Override
public TemplateBuffer evaluate(Template template)
throws BadLocationException, TemplateException {
IFormatterCommonPrferences prefs = FormatterUtils
.getFormatterCommonPrferences();
boolean useTab = prefs.useTab(getDocument());
if (!useTab) {
int length = prefs.getIndentationSize(getDocument());
StringBuffer sb = new StringBuffer();
for (int i = 0; i < length; i++) {
sb.append(prefs.getIndentationChar(getDocument())); //$NON-NLS-1$