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.

The code for this example is in the org.eclipse.ui.examples.javaeditor plug-in. To explore the code it is recommended to import that plug-in into your workspace.

Features demonstrated in the template editor

Features not demonstrated

Running the example Template editor

  1. Create a project
  2. Create a file with the file extension ".xml" in the newly created project.
  3. Close the editor that opened automatically
  4. Select the new file in the Navigator and from the context menu select Open With > Template Editor to open the Template example editor .

Code organization of the template editor example

The example code is organized in three packages: