public class CodeTemplateContextType extends TemplateContextType {
/* context types */
- public static final String CATCHBLOCK_CONTEXTTYPE= "catchblock_context"; //$NON-NLS-1$
- public static final String METHODBODY_CONTEXTTYPE= "methodbody_context"; //$NON-NLS-1$
- public static final String CONSTRUCTORBODY_CONTEXTTYPE= "constructorbody_context"; //$NON-NLS-1$
- public static final String GETTERBODY_CONTEXTTYPE= "getterbody_context"; //$NON-NLS-1$
- public static final String SETTERBODY_CONTEXTTYPE= "setterbody_context"; //$NON-NLS-1$
- public static final String NEWTYPE_CONTEXTTYPE= "newtype_context"; //$NON-NLS-1$
- public static final String TYPECOMMENT_CONTEXTTYPE= "typecomment_context"; //$NON-NLS-1$
- public static final String FIELDCOMMENT_CONTEXTTYPE= "fieldcomment_context"; //$NON-NLS-1$
- public static final String METHODCOMMENT_CONTEXTTYPE= "methodcomment_context"; //$NON-NLS-1$
- public static final String CONSTRUCTORCOMMENT_CONTEXTTYPE= "constructorcomment_context"; //$NON-NLS-1$
- public static final String OVERRIDECOMMENT_CONTEXTTYPE= "overridecomment_context"; //$NON-NLS-1$
- public static final String GETTERCOMMENT_CONTEXTTYPE= "gettercomment_context"; //$NON-NLS-1$
- public static final String SETTERCOMMENT_CONTEXTTYPE= "settercomment_context"; //$NON-NLS-1$
+ public static final String CATCHBLOCK_CONTEXTTYPE= "php_catchblock_context"; //$NON-NLS-1$
+ public static final String METHODBODY_CONTEXTTYPE= "php_methodbody_context"; //$NON-NLS-1$
+ public static final String CONSTRUCTORBODY_CONTEXTTYPE= "php_constructorbody_context"; //$NON-NLS-1$
+ public static final String GETTERBODY_CONTEXTTYPE= "php_getterbody_context"; //$NON-NLS-1$
+ public static final String SETTERBODY_CONTEXTTYPE= "php_setterbody_context"; //$NON-NLS-1$
+ public static final String NEWTYPE_CONTEXTTYPE= "php_newtype_context"; //$NON-NLS-1$
+ public static final String TYPECOMMENT_CONTEXTTYPE= "php_typecomment_context"; //$NON-NLS-1$
+ public static final String FIELDCOMMENT_CONTEXTTYPE= "php_fieldcomment_context"; //$NON-NLS-1$
+ public static final String METHODCOMMENT_CONTEXTTYPE= "php_methodcomment_context"; //$NON-NLS-1$
+ public static final String CONSTRUCTORCOMMENT_CONTEXTTYPE= "php_constructorcomment_context"; //$NON-NLS-1$
+ public static final String OVERRIDECOMMENT_CONTEXTTYPE= "php_overridecomment_context"; //$NON-NLS-1$
+ public static final String GETTERCOMMENT_CONTEXTTYPE= "php_gettercomment_context"; //$NON-NLS-1$
+ public static final String SETTERCOMMENT_CONTEXTTYPE= "php_settercomment_context"; //$NON-NLS-1$
/* templates */
public static final String COMMENT_SUFFIX= "comment"; //$NON-NLS-1$
protected void validateVariables(TemplateVariable[] variables) throws TemplateException {
ArrayList required= new ArrayList(5);
String contextName= getId();
- if (NEWTYPE_CONTEXTTYPE.equals(contextName)) {
- required.add(PACKAGE_DECLARATION);
- required.add(TYPE_DECLARATION);
- }
+// if (NEWTYPE_CONTEXTTYPE.equals(contextName)) {
+// required.add(PACKAGE_DECLARATION);
+// required.add(TYPE_DECLARATION);
+// }
for (int i= 0; i < variables.length; i++) {
String type= variables[i].getType();
if (getResolver(type) == null) {
-->
<templates>
-<template name="gettercomment" id="net.sourceforge.phpdt.ui.text.codetemplates.gettercomment" description="%CodeTemplates.gettercomment" context="gettercomment_context" enabled="true">/**
+<template name="gettercomment" id="net.sourceforge.phpdt.ui.text.codetemplates.gettercomment" description="%CodeTemplates.gettercomment" context="php_gettercomment_context" enabled="true">/**
* @return %CodeTemplates.gettercomment.returntagcontent
*/</template>
-<template name="settercomment" id="net.sourceforge.phpdt.ui.text.codetemplates.settercomment" description="%CodeTemplates.settercomment" context="settercomment_context" enabled="true">/**
+<template name="settercomment" id="net.sourceforge.phpdt.ui.text.codetemplates.settercomment" description="%CodeTemplates.settercomment" context="php_settercomment_context" enabled="true">/**
* @param ${param} %CodeTemplates.settercomment.paramtagcontent
*/</template>
-<template name="constructorcomment" id="net.sourceforge.phpdt.ui.text.codetemplates.constructorcomment" description="%CodeTemplates.constructorcomment" context="constructorcomment_context" enabled="true">/**
+<template name="constructorcomment" id="net.sourceforge.phpdt.ui.text.codetemplates.constructorcomment" description="%CodeTemplates.constructorcomment" context="php_constructorcomment_context" enabled="true">/**
* ${tags}
*/</template>
-<template name="typecomment" id="net.sourceforge.phpdt.ui.text.codetemplates.typecomment" description="%CodeTemplates.typecomment" context="typecomment_context" enabled="true">/**
+<template name="typecomment" id="net.sourceforge.phpdt.ui.text.codetemplates.typecomment" description="%CodeTemplates.typecomment" context="php_typecomment_context" enabled="true">/**
* @author ${user}
*
* ${todo} %CodeTemplates.typecomment.content1
* %CodeTemplates.typecomment.content2
*/</template>
-<template name="fieldcomment" id="net.sourceforge.phpdt.ui.text.codetemplates.fieldcomment" description="%CodeTemplates.fieldcomment" context="fieldcomment_context" enabled="true">/**
+<template name="fieldcomment" id="net.sourceforge.phpdt.ui.text.codetemplates.fieldcomment" description="%CodeTemplates.fieldcomment" context="php_fieldcomment_context" enabled="true">/**
* %CodeTemplates.fieldcomment.content
*/</template>
-<template name="methodcomment" id="net.sourceforge.phpdt.ui.text.codetemplates.methodcomment" description="%CodeTemplates.nonoverridingcomment" context="methodcomment_context" enabled="true">/**
+<template name="methodcomment" id="net.sourceforge.phpdt.ui.text.codetemplates.methodcomment" description="%CodeTemplates.nonoverridingcomment" context="php_methodcomment_context" enabled="true">/**
* ${tags}
*/</template>
-<template name="overridecomment" id="net.sourceforge.phpdt.ui.text.codetemplates.overridecomment" description="%CodeTemplates.overridecomment" context="overridecomment_context" enabled="true">/* %CodeTemplates.overridecomment.nonjd
+<template name="overridecomment" id="net.sourceforge.phpdt.ui.text.codetemplates.overridecomment" description="%CodeTemplates.overridecomment" context="php_overridecomment_context" enabled="true">/* %CodeTemplates.overridecomment.nonjd
* ${see_to_overridden}
*/</template>
-<template name="newtype" id="net.sourceforge.phpdt.ui.text.codetemplates.newtype" description="%CodeTemplates.newfile" context="newtype_context" enabled="true"><?php
+<template name="newtype" id="net.sourceforge.phpdt.ui.text.codetemplates.newtype" description="%CodeTemplates.newfile" context="php_newtype_context" enabled="true"><?php
/*
* %CodeTemplates.newfile.content1
*
?>
</template>
-<template name="catchblock" id="net.sourceforge.phpdt.ui.text.codetemplates.catchblock" description="%CodeTemplates.catchblock" context="catchblock_context" enabled="true">// ${todo} %CodeTemplates.catchblock.tododesc
+<template name="catchblock" id="net.sourceforge.phpdt.ui.text.codetemplates.catchblock" description="%CodeTemplates.catchblock" context="php_catchblock_context" enabled="true">// ${todo} %CodeTemplates.catchblock.tododesc
${exception_var}.printStackTrace();</template>
-<template name="methodbody" id="net.sourceforge.phpdt.ui.text.codetemplates.methodbody" description="%CodeTemplates.methodstub" context="methodbody_context" enabled="true">// ${todo} %CodeTemplates.methodstub.tododesc
+<template name="methodbody" id="net.sourceforge.phpdt.ui.text.codetemplates.methodbody" description="%CodeTemplates.methodstub" context="php_methodbody_context" enabled="true">// ${todo} %CodeTemplates.methodstub.tododesc
${body_statement}</template>
<template name="constructorbody" id="net.sourceforge.phpdt.ui.text.codetemplates.constructorbody" description="%CodeTemplates.constructorstub" context="constructorbody_context" enabled="true">${body_statement}
// ${todo} %CodeTemplates.constructorstub.tododesc</template>
-<template name="getterbody" id="net.sourceforge.phpdt.ui.text.codetemplates.getterbody" description="%CodeTemplates.getterstub" context="getterbody_context" enabled="true">return ${field};</template>
+<template name="getterbody" id="net.sourceforge.phpdt.ui.text.codetemplates.getterbody" description="%CodeTemplates.getterstub" context="php_getterbody_context" enabled="true">return ${field};</template>
-<template name="setterbody" id="net.sourceforge.phpdt.ui.text.codetemplates.setterbody" description="%CodeTemplates.setterstub" context="setterbody_context" enabled="true">${field} = ${param};</template>
+<template name="setterbody" id="net.sourceforge.phpdt.ui.text.codetemplates.setterbody" description="%CodeTemplates.setterstub" context="php_setterbody_context" enabled="true">${field} = ${param};</template>
</templates>
\ No newline at end of file