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:
parent
6930a102fe
commit
7b85c24621
1 changed files with 19 additions and 8 deletions
|
@ -177,6 +177,17 @@ public class FileTemplateContextType extends TemplateContextType {
|
||||||
addResolver(new FileTemplateVariableResolver(PROJECTNAME, TemplateMessages.FileTemplateContextType_variable_description_projectname));
|
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
|
@Override
|
||||||
protected void validateVariables(TemplateVariable[] variables) throws TemplateException {
|
protected void validateVariables(TemplateVariable[] variables) throws TemplateException {
|
||||||
ArrayList<String> required= new ArrayList<String>(5);
|
ArrayList<String> required= new ArrayList<String>(5);
|
||||||
|
|
Loading…
Add table
Reference in a new issue