Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse C/C++ Developer Guide
Previous Page Home Next Page

Creating and editing templates

Content Assist uses templates to enable you to quickly make use of commonly used code segments.

To create a template:

  1. Click Window > Preferences.
  2. Expand C/C++, expand Editor and select Templates.
  3. Click New.


    Creating a new Code Template Window


  4. Do the following: (if required)

    • In the Name field, type a template name.
    • In the Context drop down list, select the context type for the new template; either C/C++ or a Comment.
    • In the Description field, type a description for the new template.
    • In the Pattern field, type the code for this template.
    • Click Insert Variable to add a variable from the list to the code you have entered in the Pattern field.
  5. Click OK.
    The new template displays in the Templates list.

To edit a template:

  1. Click Window > Preferences.
  2. Expand C/C++, expand Editor and select Templates.
  3. Click Edit. The Edit Template dialog opens.


    Editing a Code Template


  4. Do the following:

    • In the Name field, change the template name to create a new template based on the current template.
    • In the Context drop down list, select the context type for the new template; either C/C++ or a Comment.
    • In the Description field, change the description of the code template to reflect your changes.
    • In the Pattern field, edit the code.
    • Click Insert Variable to add a variable from the list to the code you edited in the Pattern field.
  5. Click OK.

Related concepts
Content Assist

Related tasks
Using Content Assist
Importing and exporting templates

Related reference
Templates page

QNX Copyright Statement


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire