Background
Eclipse has been very successful since its launch, and most of its success stems from the various projects that make up the eclipse platform. One of these includes a project named Plug-in Development Environment (PDE). If you have created plug-ins in Eclipse, you must have used PDE. PDE is a set of tools that help you create, package, and manage Plug-ins.
We will focus on the template features provided in PDE. If you remember the scenario when you tried to create the first plug-in in Eclipse, you know that everything started with the New Plug-in Project Wizard.
Figure 1. PDE Plug-in Wizard
Then, in the process of creating the first plug-in, you stumbled upon something of value.
Figure 2. PDE Plug-in Wizard template
Oh, my--the template! PDE provides a variety of templates for you to start the Eclipse plug-in creation journey. The purpose of this article is to discuss how to create these templates to simplify the learning curve faced by end users when they use extension points or code.
Creating templates
Goal
I find the best way to learn knowledge is through a good simple example. So, guess what? That's what we're going to do today. We will develop a simple template for creating a simple view. I hope this article will lay the groundwork for future template creation.
Creating Plug-ins
The first stop for this journey is to create a new plug-in project (File > New > Project > Plug-in Project). Please use a template. Ensure that there is a dependency between the project and the Org.eclipse.pde.ui. When this is done, you can go to the Extensions tab of the plugin editor and start creating the template.
Template Wizard
The most important extension point for creating a template is org.eclipse.pde.ui.pluginContent. This extension point can contribute to the wizard that creates additional content for the PDE plug-in project. After you have created the list of Plug-ins and key files, you can use these wizards to add more files and extensions to the original schema. The implementation of this wizard adds content based on a custom parameterized template that the user chooses in the wizard. Now, let's start using this extension point.
Figure 3. Sample Extensions Page