final Template commentTemplate = ErlangSourceContextTypeComment.getDefault()
.getTemplateStore()
.getTemplateData("org.erlide.ui.erlangsource.functioncomment")
.getTemplate();
DocumentTemplateContext commentContext = new DocumentTemplateContext(
ErlangSourceContextTypeLayout.getDefault(), new Document(
commentTemplate.getPattern()), 0, commentTemplate
.getPattern().length());
TemplateBuffer tb = null;
try {
tb = commentContext.evaluate(commentTemplate);
} catch (final BadLocationException e) {
ErlLogger.warn(e);
buff.append("Error: " + e.getMessage());
} catch (final TemplateException e) {
ErlLogger.warn(e);
buff.append("Error: " + commentTemplate.getName()
+ " could not be validated!");
}
if (tb != null) {
buff.append(tb.getString() + "\n");
}
final Template template = ErlangSourceContextTypeComment.getDefault()
.getTemplateStore()
.getTemplateData("org.erlide.ui.erlangsource.functionlayout")
.getTemplate();
commentContext = new DocumentTemplateContext(
ErlangSourceContextTypeLayout.getDefault(), new Document(
template.getPattern()), 0, template.getPattern().length());
try {
tb = commentContext.evaluate(template);
} catch (final BadLocationException e) {
ErlLogger.warn(e);
buff.append("Error: " + e.getMessage());
} catch (final TemplateException e) {
ErlLogger.warn(e);