carbidecpp22devenv/configuration/org.eclipse.osgi/bundles/309/1/.cp/tasks/cdt_t_add_codetemp.htm
author cawthron
Fri, 04 Dec 2009 10:01:33 -0600
changeset 5 684bf18fdedf
permissions -rw-r--r--
add files for RCL_2_2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     2
<html lang="en">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     3
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     4
<head>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     5
<meta http-equiv="Content-Language" content="en-us">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     6
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     7
<title>Creating and editing templates</title>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     8
<link rel="stylesheet" type="text/css" href="../help.css">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     9
</head>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    10
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    11
<body>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    12
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    13
<h1>Creating and editing templates</h1>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    14
<p>Content Assist uses templates to enable you to quickly make use of commonly used code segments.  </p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    15
<p>To create a template:</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    16
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    17
<ol>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    18
  <li>Click <b>Window &gt; Preferences</b>.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    19
  <li>Expand <b>C/C++</b>, expand <b>Editor</b> and select <b>Templates</b>.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    20
  <li>Click <b>New</b>.<p><br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    21
  <img src="../images/code_templates_new.png" alt="Creating a new Code Template Window"><br></p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    22
<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    23
  </li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    24
  <li><p>Do the following: (if required)</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    25
	<ul>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    26
  		<li>In the <b>Name</b> field, type a template name.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    27
  		<li>In the <b>Context</b> drop down list, select the context type for the new template; either  <b>C/C++</b> or a <b>Comment</b>.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    28
  		<li>In the <b>Description</b> field, type a description for the new template.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    29
  		<li>In the <b>Pattern</b> field, type the code for this template.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    30
  		<li>Click <b>Insert Variable</b> to add a variable from the list to the code you have entered in the <b>Pattern</b> field.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    31
	</ul>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    32
 </li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    33
 <li>Click <b>OK</b>.<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    34
 The new template displays in the Templates list. </li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    35
</ol>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    36
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    37
<p>To edit a template:</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    38
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    39
<ol>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    40
  <li>Click <b>Window &gt; Preferences</b>.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    41
  <li>Expand <b>C/C++</b>, expand <b>Editor</b> and select <b>Templates</b>.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    42
  <li>Click <b>Edit</b>. The Edit Template dialog opens.<p><br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    43
  <img src="../images/codetemplates_example.png"  alt="Editing a Code Template"><br></p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    44
  <br></li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    45
  <li><p>Do the following:</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    46
	<ul>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    47
  		<li>In the <b>Name</b> field, change the template name to create a new 
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    48
        template based on the current template. </li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    49
  		<li>In the <b>Context</b> drop down list, select the context type for the new template; either  <b>C/C++</b> or a <b>Comment</b>.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    50
  		<li>In the <b>Description</b> field, change the description of the code 
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    51
        template to reflect your changes.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    52
  		<li>In the <b>Pattern</b> field, edit the code.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    53
  		<li>Click <b>Insert Variable</b> to add a variable from the list to the 
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    54
        code you edited in the <b>Pattern</b> field.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    55
	</ul>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    56
 </li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    57
 <li>Click <b>OK</b>.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    58
</ol>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    59
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    60
<p><img border="0" src="../images/ngconcepts.gif" ALT="Related concepts" width="143" height="21">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    61
<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    62
<a href="../concepts/cdt_c_content_assist.htm">Content Assist</a></p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    63
<p><img border="0" src="../images/ngtasks.gif" ALT="Related tasks" width="143" height="21">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    64
<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    65
<a href="cdt_t_contentassist.htm">Using Content Assist</a><br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    66
<a href="cdt_t_imp_code_temp.htm">Importing and exporting templates</a></p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    67
<p><img border="0" src="../images/ngref.gif" ALT="Related reference" width="143" height="21"> <br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    68
<a href="../reference/cdt_u_code_temp.htm">Templates page</a></p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    69
<p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    70
<img src="../images/ng00_04a.gif" ALT="QNX Copyright Statement" >
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    71
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    72
</body>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    73
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    74
</html>