## Example - Template Editor

### Introduction

The Template Editor example demonstrates how to add template support to an editor. The example is based on the PDE example editor project that can be created using the new project wizard. The editor is a simple XML editor; it is only for demonstration purposes.

### Features demonstrated in the template editor

- creating a template context for an editor
- setting up a content assist processor that will propose template completions
- contributing a context type and variable resolvers to an editor via plugin.xml
- contributing templates to a context type via plugin.xml
- adding a preference page for handling templates, both contributed and user-added

### Features not demonstrated

- template formatting

### Code organization of the template editor example

The example code is organized in three packages:

- `org.eclipse.ui.examples.templateeditor.editors` contains all the editor specific classes. See `XMLConfiguration` to see how the `TemplateCompletionProcessor` is added in the `getContentAssistant` method.
- `org.eclipse.ui.examples.templateeditor.preferences` contains the contributed template preference page.
- `org.eclipse.ui.examples.templateeditor.template` contains the example context type, the completion processor and the variable resolver that is contributed via plugin.xml.