.getDefaultLineDelimiter(getDocument());
} else {
delimeter = fLineDelimiter;
}
final String indent = calculateIndent(getDocument(), getStart());
final IScriptTemplateIndenter indenter = getIndenter();
final StringBuffer buffer = new StringBuffer(lines[0]);
// Except first line
for (int i = 1; i < lines.length; i++) {
buffer.append(delimeter);
indenter.indentLine(buffer, indent, lines[i]);
}
template = new Template(template.getName(),
template.getDescription(), template.getContextTypeId(),
buffer.toString(), template.isAutoInsertable());