1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-06 07:45:50 +02:00

Additional vartiable resolvers for file templates

This commit is contained in:
Anton Leherbauer 2008-04-24 12:04:48 +00:00
parent 6930a102fe
commit 7b85c24621

View file

@ -177,6 +177,17 @@ public class FileTemplateContextType extends TemplateContextType {
addResolver(new FileTemplateVariableResolver(PROJECTNAME, TemplateMessages.FileTemplateContextType_variable_description_projectname));
}
@Override
protected TemplateVariableResolver getResolver(String type) {
// compatibility with editor template variables
if ("file".equals(type)) { //$NON-NLS-1$
type= FILENAME;
} else if ("project".equals(type) || "enclosing_project".equals(type)) { //$NON-NLS-1$ //$NON-NLS-2$
type= PROJECTNAME;
}
return super.getResolver(type);
}
@Override
protected void validateVariables(TemplateVariable[] variables) throws TemplateException {
ArrayList<String> required= new ArrayList<String>(5);