Once the project template is ready, you need to register it with Eclipse @@ -40,7 +40,7 @@ group all the resources required for this application in a folder "HelloWorld".
-To register a project template with Eclipse follow the steps given below: +To register a project template with CDT follow the steps given below:
-Create a folder and copy the project template along with all the -resources required to create the project. For example, all the hearder files, -source files, resource files etc. +Create a new folder to contain the template project's content e.g. "MyExampleProject/templates/MyExampleTemplate". +Copy the project template.xml along with all the resources required to create the project. For example, all the +header files, source files, resource files etc.
@@ -65,7 +65,9 @@ editor, refer to PDE
Click
@@ -79,29 +81,31 @@ Click
Select the extension-point with ID
-
Right-click on the newly added extension, and select
-Choose the new template added in step 6 from the
-Specify the
-Specify the location of the template relative to the plug-in created
+Specify the location of the template XML file, relative to the plug-in created
in step 1. This attribute is mandatory.
Add
to select
-org.eclipse.cdt.templateengine
plug-in from the list.
+org.eclipse.cdt.core
and
+org.eclipse.cdt.ui
+plug-ins from the list.
Add
to create an extension to the extension-point.
org.eclipse.cdt.templateengine.templates
from the list of
-extensions-points.
+org.eclipse.cdt.core.templates
from the list of
+extension-points.
New
>
template
from the context menu.
+The first one has already been added for you, "(template)"
.
All
-Extensions
list.
+Select the new template added in the previous step from the All
+Extensions
list. Its name is initially "(template)"
.
wizardId
attribute of the template as
-"org.eclipse.cdt.project.ui.NewProjectWizard". This
-attribute is mandatory.
+Specify the id
attribute of this template contribution, for example
+"com.foobar.templates.contrib.MyTemplate1". This attribute is mandatory. The id need not be
+the same as the template id (from template.xml). This allows contributing the same template.xml multiple
+times. It will replace "(template)"
in the list.
-Select an appropriate project type from the
-projectType
drop-down list. This is an optional attribute.
-
-Specify the usageDescription
, which is a notation
-describing how this template is used. Usually used to filter the list of
-templates on offer depending on other wizard attributes. This is an optional
-attribute. For more information, refer to Java API document for
-java.util.regex.Pattern.
-
-The New Project wizard will list only those templates, which are
-relevant for the build Configurations choosen for the project. For a example, if the developer
-choose to create a C++ Application for Symbian OS
, the wizard
-will list all the templates with the relevant
-usageDescription
. Otherwise, for a standard CDT
-C++ Project
the wizard will list all the templates, irrespective of
-whether the usageDescription
is specified or not.
+Specify the project type you wish the template to be associated with. The project type id can be
+found by looking at the project types contributed to the buildDefinitions extension point. See the CDT Build System documentation in the developer guide for built-in project type ids.
+projectType
drop-down list. This is an mandatory attribute.
Specify the pagesAfterTemplateSelectionProvider
,
which is a fully qualified name of the class that implements
-org.eclipse.cdt.templateengine.IPagesAfterTemplateSelectionProvider
+org.eclipse.cdt.ui.templateengine.IPagesAfterTemplateSelectionProvider
interface. This is an optional attribute.