Template template = templateStore.findTemplate(templateName);
if (template == null) {
return true;
}
// compile the template and insert the text into the new document
CompiledTemplate compiledTemplate = PHPTemplateStore
.compileTemplate(PHPUiPlugin.getDefault()
.getCodeTemplateContextRegistry(), template);
IDocumentProvider documentProvider = textEditor
.getDocumentProvider();
IDocument document = textEditor.getDocumentProvider().getDocument(