Fix import
[phpeclipse.git] / net.sourceforge.phpeclipse / templates / default-templates.xml
index 352bfbf..b8842d0 100644 (file)
@@ -1,70 +1,88 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <templates>
 <template name="class" description="class template with constructor" id="net.sourceforge.phpdt.php.class1" context="php" enabled="true">class ${class_name} {
-  function ${class_name}() {
-         ${cursor}
-  }
+       function ${class_name}() {
+               ${cursor}
+       }
 }</template>
 <template name="class" description="class with attribute" id="net.sourceforge.phpdt.php.class2" context="php" enabled="true">class ${class_name} {
-  var $$${attribute};
-  function ${class_name}() {
-         ${cursor}
-  }
-  
-  function set_${attribute}( $$${attr} ) {
-    $$this->${attribute} = $$${attr};
+       var $$${attribute};
+       function ${class_name}() {
+               ${cursor}
        }
-
+       
+       function set_${attribute}( $$${attr} ) {
+               $$this->${attribute} = $$${attr};
+       }
+       
        function get_${attribute}() {
-    return $$this->${attribute};
+               return $$this->${attribute};
        }
 }</template>
-<template name="for" description="iterate over array" id="net.sourceforge.phpdt.php.for1" context="php" enabled="true">for ($$${index} = 0; $$${index} &lt; sizeof($$${array}); $$${index}++) {
+<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}++ ) {
        ${cursor}
 }</template>
-<template name="for" description="iterate over array w/ temporary variable" id="net.sourceforge.phpdt.php.for2" context="php" enabled="true">for ($$${index} = 0; $$${index} &lt; sizeof($$${array}); $$${index}++) {
+<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}++) {
        $$${array_element} = $$${array}[$$${index}];
        ${cursor}
 }</template>
-<template name="function" description="function template" id="net.sourceforge.phpdt.php.function1" context="php" enabled="true">function ${function_name} () {
+<template name="try-catch" description="try-catch block - default" id="net.sourceforge.phpdt.php.try1" context="php" enabled="true">try {
+       ${try}
+}
+catch( Exception $$${e} ) {
+       ${catch}
+}</template>
+<template name="try-catch" description="try-catch block - custom Exception" id="net.sourceforge.phpdt.php.try2" context="php" enabled="true">try {
+       ${try}
+}
+catch( ${Exception} $$${e} ) {
+       ${catch}
+}</template>
+<template name="function" description="function template" id="net.sourceforge.phpdt.php.function1" context="php" enabled="true">function ${function_name}() {
        ${cursor}
 }</template>
-<template name="function" description="function template with return" id="net.sourceforge.phpdt.php.function2" context="php" enabled="true">function ${function_name} () {
-       return (${cursor});
+<template name="function" description="function template with return" id="net.sourceforge.phpdt.php.function2" context="php" enabled="true">function ${function_name}() {
+       return ( ${cursor} );
 }</template>
-<template name="while" description="while iteration" id="net.sourceforge.phpdt.php.while" context="php" enabled="true">while (${condition}) {
+<template name="while" description="while iteration" id="net.sourceforge.phpdt.php.while" context="php" enabled="true">while ( ${condition} ) {
        ${cursor}
 }</template>
 <template name="do" description="do iteraation" id="net.sourceforge.phpdt.php.do" context="php" enabled="true">do {
        ${line_selection}${cursor}
-} while (${condition});</template>
-<template name="switch" description="switch case statement" id="net.sourceforge.phpdt.php.switch" context="php" enabled="true">switch (${key}) {
+} while ( ${condition} );</template>
+<template name="switch" description="switch case statement" id="net.sourceforge.phpdt.php.switch" context="php" enabled="true">switch ( ${key} ) {
        case ${value}:
                ${cursor}
                break;
-
+               
        default:
                break;
-}</template><template name="if" description="if statement" id="net.sourceforge.phpdt.php.if" context="php" enabled="true">if (${condition}) {
+}</template>
+<template name="if" description="if statement" id="net.sourceforge.phpdt.php.if" context="php" enabled="true">if ( ${condition} ) {
        ${cursor}
-}</template><template name="ifelse" description="if else statement" id="net.sourceforge.phpdt.php.ifelse" context="php" enabled="true">if (${condition}) {
+}</template>
+<template name="ifelse" description="if else statement" id="net.sourceforge.phpdt.php.ifelse" context="php" enabled="true">if ( ${condition} ) {
        ${cursor}
-} else {
+}
+else {
        
-}</template><template name="elseif" description="else if block" id="net.sourceforge.phpdt.php.elseif" context="php" enabled="true">elseif (${condition}) {
+}</template>
+<template name="elseif" description="else if block" id="net.sourceforge.phpdt.php.elseif" context="php" enabled="true">elseif (${condition}) {
        ${cursor}
-}</template><template name="else" description="else block" id="net.sourceforge.phpdt.php.else" context="php" enabled="true">else {
+}</template>
+<template name="else" description="else block" id="net.sourceforge.phpdt.php.else" context="php" enabled="true">else {
        ${cursor}
 }</template>
 <template name="filecomment" description="file comment used by the class and interface wizards" id="net.sourceforge.phpdt.php.filecomment" context="php" enabled="true">/**
- * Created on ${date} by ${user}
+ *     Created on ${date} by ${user}
  *
- */</template><template name="functioncomment" description="function comment" id="net.sourceforge.phpdt.php.functioncomment" context="php" enabled="true">/**
- * @author ${user}
+ */</template>
+<template name="functioncomment" description="function comment" id="net.sourceforge.phpdt.php.functioncomment" context="php" enabled="true">/**
+ *     @author ${user}
  *
  */</template>
- <template name="echo" description="echo a string" id="net.sourceforge.phpdt.php.echo" context="php" enabled="true">echo "${string}";
-  ${cursor}</template>
+ <template name="echo" description="echo a string" id="net.sourceforge.phpdt.php.echo" context="php" enabled="true">echo '${string}';
+${cursor}</template>
 
   <!-- phpdoc -->