90c8e8603f8ade24ad65e684e3b81c372ec21fd1
[phpeclipse.git] / net.sourceforge.phpeclipse / templates / default-templates.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <templates>
3 <template name="class" description="class template with constructor" id="net.sourceforge.phpdt.php.class1" context="php" enabled="true">class ${class_name} {
4         function ${class_name}() {
5                 ${cursor}
6         }
7 }</template>
8 <template name="class" description="class with attribute" id="net.sourceforge.phpdt.php.class2" context="php" enabled="true">class ${class_name} {
9         var $$${attribute};
10         function ${class_name}() {
11                 ${cursor}
12         }
13         
14         function set_${attribute}( $$${attr} ) {
15                 $$this->${attribute} = $$${attr};
16         }
17         
18         function get_${attribute}() {
19                 return $$this->${attribute};
20         }
21 }</template>
22 <template name="for" description="iterate over array" id="net.sourceforge.phpdt.php.for1" context="php" enabled="true">for ( $$${index} = 0, $$${index2} = sizeof($$${array}); $$${index} &lt; $$${index2}; $$${index}++ ) {
23         ${cursor}
24 }</template>
25 <template name="for" description="iterate over array w/ temporary variable" id="net.sourceforge.phpdt.php.for2" context="php" enabled="true">for ($$${index} = 0, $$${index2} = sizeof($$${array}); $$${index} &lt; $$${index2}; $$${index}++) {
26         $$${array_element} = $$${array}[$$${index}];
27         ${cursor}
28 }</template>
29 <template name="foreach" description="iterate over array - value" id="net.sourceforge.phpdt.php.foreach1" context="php" enabled="true">foreach ( $$${array} as $$${value} ) {
30        ${cursor}
31 }</template>
32 <template name="foreach" description="iterate over array - key/value" id="net.sourceforge.phpdt.php.foreach2" context="php" enabled="true">foreach ( $$${array} as $$${key} =&gt; $$${value} ) {
33        ${cursor}
34 }</template>
35 <template name="try-catch" description="try-catch block - default" id="net.sourceforge.phpdt.php.try1" context="php" enabled="true">try {
36        ${try}
37 }</template>
38 <template name="try-catch" description="try-catch block - default" id="net.sourceforge.phpdt.php.try1" context="php" enabled="true">try {
39         ${try}
40 }
41 catch( Exception $$${e} ) {
42         ${catch}
43 }</template>
44 <template name="try-catch" description="try-catch block - custom Exception" id="net.sourceforge.phpdt.php.try2" context="php" enabled="true">try {
45         ${try}
46 }
47 catch( ${Exception} $$${e} ) {
48         ${catch}
49 }</template>
50 <template name="function" description="function template" id="net.sourceforge.phpdt.php.function1" context="php" enabled="true">function ${function_name}() {
51         ${cursor}
52 }</template>
53 <template name="function" description="function template with return" id="net.sourceforge.phpdt.php.function2" context="php" enabled="true">function ${function_name}() {
54         return ( ${cursor} );
55 }</template>
56 <template name="while" description="while iteration" id="net.sourceforge.phpdt.php.while" context="php" enabled="true">while ( ${condition} ) {
57         ${cursor}
58 }</template>
59 <template name="do" description="do iteraation" id="net.sourceforge.phpdt.php.do" context="php" enabled="true">do {
60         ${line_selection}${cursor}
61 } while ( ${condition} );</template>
62 <template name="switch" description="switch case statement" id="net.sourceforge.phpdt.php.switch" context="php" enabled="true">switch ( ${key} ) {
63         case ${value}:
64                 ${cursor}
65                 break;
66                 
67         default:
68                 break;
69 }</template>
70 <template name="if" description="if statement" id="net.sourceforge.phpdt.php.if" context="php" enabled="true">if ( ${condition} ) {
71         ${cursor}
72 }</template>
73 <template name="ifelse" description="if else statement" id="net.sourceforge.phpdt.php.ifelse" context="php" enabled="true">if ( ${condition} ) {
74         ${cursor}
75 }
76 else {
77         
78 }</template>
79 <template name="elseif" description="else if block" id="net.sourceforge.phpdt.php.elseif" context="php" enabled="true">elseif (${condition}) {
80         ${cursor}
81 }</template>
82 <template name="else" description="else block" id="net.sourceforge.phpdt.php.else" context="php" enabled="true">else {
83         ${cursor}
84 }</template>
85 <template name="filecomment" description="file comment used by the class and interface wizards" id="net.sourceforge.phpdt.php.filecomment" context="php" enabled="true">/**
86  *      Created on ${date} by ${user}
87  *
88  */</template>
89 <template name="functioncomment" description="function comment" id="net.sourceforge.phpdt.php.functioncomment" context="php" enabled="true">/**
90  *      @author ${user}
91  *
92  */</template>
93  <template name="echo" description="echo a string" id="net.sourceforge.phpdt.php.echo" context="php" enabled="true">echo '${string}';
94 ${cursor}</template>
95
96   <!-- phpdoc -->
97
98   <template description="&lt;code&gt;&lt;/code&gt;" name="&lt;code&gt;" id="net.sourceforge.phpdt.phpdoc.code1" context="phpdoc"
99   >&lt;code&gt;${cursor}&lt;/code&gt;</template>
100
101   <template description="&lt;code&gt;null&lt;/code&gt;" name="&lt;code&gt;" id="net.sourceforge.phpdt.phpdoc.code2" context="phpdoc"
102   >&lt;code&gt;null&lt;/code&gt;</template>
103
104   <template description="&lt;pre&gt;&lt;/pre&gt;" name="&lt;pre&gt;" id="net.sourceforge.phpdt.phpdoc.pre" context="phpdoc"
105   >&lt;pre&gt;${cursor}&lt;/pre&gt;</template>
106
107   <template description="&lt;b&gt;&lt;/b&gt;" name="&lt;b&gt;" id="net.sourceforge.phpdt.phpdoc.b" context="phpdoc"
108   >&lt;b&gt;${cursor}&lt;/b&gt;</template>
109
110   <template description="&lt;i&gt;&lt;/i&gt;" name="&lt;i&gt;" id="net.sourceforge.phpdt.phpdoc.i" context="phpdoc">&lt;i&gt;${cursor}&lt;/i&gt;</template>
111
112   <template description="author name" name="@author" id="net.sourceforge.phpdt.phpdoc.author" context="phpdoc">@author ${user}</template>
113
114   <template name="@author" description="author name email" id="net.sourceforge.phpdt.phpdoc.author" context="phpdoc" enabled="true">@author ${user} &lt;${email}&gt;</template>
115   <template name="@access" description="access private" id="net.sourceforge.phpdt.phpdoc.access1" context="phpdoc" enabled="true">@access private</template>
116   <template name="@access" description="access protected" id="net.sourceforge.phpdt.phpdoc.access2" context="phpdoc" enabled="true">@access protected</template>
117   <template name="@access" description="access public" id="net.sourceforge.phpdt.phpdoc.access3" context="phpdoc" enabled="true">@access public</template>
118   <template name="@category" description="category" id="net.sourceforge.phpdt.phpdoc.category" context="phpdoc" enabled="true">@category ${categoryname}</template>
119   <template name="@copyright" description="copyright" id="net.sourceforge.phpdt.phpdoc.copyright" context="phpdoc" enabled="true">@copyright Copyright &amp;copy; ${year}, ${user}</template>
120   <template name="@deprecated" description="deprecated version date" id="net.sourceforge.phpdt.phpdoc.deprected" context="phpdoc" enabled="true">@deprecated ${version} - ${date}</template>
121   <template name="@example" description="example path description" id="net.sourceforge.phpdt.phpdoc.example" context="phpdoc" enabled="true">@example ${path} ${description}</template>
122   <template name="@abstract" description="abstract" id="net.sourceforge.phpdt.phpdoc.abstract" context="phpdoc" enabled="true">@abstract</template>
123   <template name="@final" description="final" id="net.sourceforge.phpdt.phpdoc.final" context="phpdoc" enabled="true">@final</template>
124   <template name="@filesource" description="filesource" id="net.sourceforge.phpdt.phpdoc.filesource" context="phpdoc" enabled="true">@filesource</template>
125   <template name="@global" description="global datatype globalvariable" id="net.sourceforge.phpdt.phpdoc.global1" context="phpdoc" enabled="true">@global ${datatype} ${globalvariable}</template>
126   <template name="@global" description="global datatype description" id="net.sourceforge.phpdt.phpdoc.global2" context="phpdoc" enabled="true">@global ${datatype} ${description}</template>
127   <template name="@ignore" description="ignore" id="net.sourceforge.phpdt.phpdoc.ignore" context="phpdoc" enabled="true">@ignore</template>
128   <template name="@internal " description="internal comment" id="net.sourceforge.phpdt.phpdoc.internal" context="phpdoc" enabled="true">@internal ${comment}</template>
129   <template name="@license" description="license url name" id="net.sourceforge.phpdt.phpdoc.license" context="phpdoc" enabled="true">@license ${url} ${nameoflicense}</template>
130   <template name="@link" description="link url description" id="net.sourceforge.phpdt.phpdoc.link" context="phpdoc" enabled="true">@link ${url} ${description}</template>
131   <template name="@name" description="name globalvariable" id="net.sourceforge.phpdt.phpdoc.name" context="phpdoc" enabled="true">@name ${globalvariable}</template>
132   <template name="@package" description="package packagename" id="net.sourceforge.phpdt.phpdoc.package" context="phpdoc" enabled="true">@package ${packagename}</template>
133   <template name="@param" description="param datatype paramname description" id="net.sourceforge.phpdt.phpdoc.param1" context="phpdoc" enabled="true">@param ${datatype} ${paramname} ${description}</template>
134   <template name="@param" description="param datatype paramname" id="net.sourceforge.phpdt.phpdoc.param2" context="phpdoc" enabled="true">@param ${datatype} ${paramname}</template>
135   <template name="@return" description="return datatype description" id="net.sourceforge.phpdt.phpdoc.return" context="phpdoc" enabled="true">@return ${datatype} ${description}</template>
136   <template name="@see" description="see element" id="net.sourceforge.phpdt.phpdoc" context="phpdoc.see" enabled="true">@see ${element}</template><template name="@since" description="since version date" id="net.sourceforge.phpdt.phpdoc" context="phpdoc" enabled="true">@since ${version} - ${date}</template>
137   <template name="@staticvar" description="staticvar datatype description" id="net.sourceforge.phpdt.phpdoc.staticvar" context="phpdoc" enabled="true">@staticvar ${datatype} ${description}</template>
138   <template name="@subpackage" description="subpackage subpackagename" id="net.sourceforge.phpdt.phpdoc.subpackage" context="phpdoc" enabled="true">@subpackage ${subpackagename}</template>
139   <template name="@todo" description="@todo information_string" id="net.sourceforge.phpdt.phpdoc.todo" context="phpdoc" enabled="true">@todo ${information_string}</template>
140   <template name="@tutorial" description="tutorial string description" id="net.sourceforge.phpdt.phpdoc.tutorial" context="phpdoc" enabled="true">@tutorial ${string} ${description}</template>
141   <template name="@uses" description="uses element description" id="net.sourceforge.phpdt.phpdoc.uses" context="phpdoc" enabled="true">@uses ${element} ${description}</template>
142   <template name="@var" description="var datatype description" id="net.sourceforge.phpdt.phpdoc.var" context="phpdoc" enabled="true">@var ${datatype} ${description}</template>
143   <template name="@version" description="version versionstring" id="net.sourceforge.phpdt.phpdoc.version" context="phpdoc" enabled="true">@version ${versionstring}</template>
144  </templates>