Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » how to register a project template with CDT
how to register a project template with CDT [message #1387587] Wed, 25 June 2014 09:44 Go to next message
dl z is currently offline dl zFriend
Messages: 2
Registered: June 2014
Junior Member
i tried this guide but not work, who can help?

http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.cdt.doc.isv%2Fguide%2FprojectTemplateEngine%2Findex.html&cp=13_0_2



Create an empty plug-in project from the Eclipse workbench without the source folders.


2. 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.


3. Open the plug-in manifest editor and select the Dependencies page. For more information on plug-in manifest editor, refer to PDE Guide > Getting Started > Basic Plug-in Tutorial > Plug-in manifest editor.


4. Click Add to select org.eclipse.cdt.core and org.eclipse.cdt.ui plug-ins from the list.


5. Select the Extensions page in the plug-in manifest editor.


6. Click Add to create an extension to the extension-point.


7. Select the extension-point with ID org.eclipse.cdt.core.templates from the list of extension-points.


8. Right-click on the newly added extension, and select New > template from the context menu. The first one has already been added for you, "(template)".


9. Select the new template added in the previous step from the All Extensions list. Its name is initially "(template)".


10. 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.


11. Specify the location of the template XML file, relative to the plug-in created in step 1. This attribute is mandatory.


12. Specify a filterPattern to indicate the build Configurations for which the template is created. It is a regular expression used to filter the build Configurations. If the template is designed for a particular Configuration, it is recommended to specify the filter pattern. For example, If the template is designed for GCC Configurations, the filter pattern can be ".*gcc". If the template is designed for multiple build Configurations, you can specify the filter patterns delimited by "|" .

The New Project wizard filters the available build Configurations based on the filter pattern for the selected template. The filter patterns are matched against the available Configurations' ID to get a list of matching SDKs. This is an optional attribute.

For more information on regular expression patterns, refer to Java API document for java.util.regex.Pattern.


13. 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. For more information about project types, see New project information in the What's New in CDT Build section, especially the section "What are the general project type entries?". This attribute is mandatory.


14. Specify the pagesAfterTemplateSelectionProvider, which is a fully qualified name of the class that implements org.eclipse.cdt.ui.templateengine.IPagesAfterTemplateSelectionProvider interface. This is an optional attribute.

Re: how to register a project template with CDT [message #1495458 is a reply to message #1387587] Tue, 02 December 2014 08:19 Go to previous message
Giancarlo Orru is currently offline Giancarlo OrruFriend
Messages: 1
Registered: December 2014
Junior Member
I also tried that procedure but it doesn't seem to work.
When the plugin is loaded some messages are printed on the console.
Did you solved this problem?
Any hint?
Thanks in advance.

!ENTRY org.eclipse.ui 2 0 2014-12-02 08:53:27.007
!MESSAGE Warnings while parsing the key bindings from the 'org.eclipse.ui.commands' extension point
!SUBENTRY 1 org.eclipse.ui 2 0 2014-12-02 08:53:27.007
!MESSAGE Cannot bind to an undefined command: plug-in='org.eclipse.cdt.ui', id='org.eclipse.debug.ui.commands.RunLast'
!SUBENTRY 1 org.eclipse.ui 2 0 2014-12-02 08:53:27.008
!MESSAGE Cannot bind to an undefined command: plug-in='org.eclipse.cdt.ui', id='org.eclipse.debug.ui.commands.DebugLast'
!SUBENTRY 1 org.eclipse.ui 2 0 2014-12-02 08:53:27.008
!MESSAGE Cannot bind to an undefined command: plug-in='org.eclipse.cdt.ui', id='org.eclipse.debug.ui.commands.StepInto'
!SUBENTRY 1 org.eclipse.ui 2 0 2014-12-02 08:53:27.008
!MESSAGE Cannot bind to an undefined command: plug-in='org.eclipse.cdt.ui', id='org.eclipse.debug.ui.commands.StepOver'
!SUBENTRY 1 org.eclipse.ui 2 0 2014-12-02 08:53:27.008
!MESSAGE Cannot bind to an undefined command: plug-in='org.eclipse.cdt.ui', id='org.eclipse.debug.ui.commands.StepReturn'
!SUBENTRY 1 org.eclipse.ui 2 0 2014-12-02 08:53:27.009
!MESSAGE Cannot bind to an undefined command: plug-in='org.eclipse.cdt.ui', id='org.eclipse.debug.ui.commands.ToggleBreakpoint'
!SUBENTRY 1 org.eclipse.ui 2 0 2014-12-02 08:53:27.009
!MESSAGE Cannot bind to an undefined command: plug-in='org.eclipse.cdt.ui', id='org.eclipse.debug.ui.commands.RunToLine'
Previous Topic:Executable causes error
Next Topic:Managed makefile config
Goto Forum:
  


Current Time: Thu Apr 25 00:29:21 GMT 2024

Powered by FUDForum. Page generated in 0.03192 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top