Search in sources :

Example 1 with TemplateStore

use of org.eclipse.che.jface.text.templates.persistence.TemplateStore in project che by eclipse.

the class StubUtility method setCodeTemplate.

/**
	 * Only to be used by tests
	 *
	 * @param templateId the template id
	 * @param pattern the new pattern
	 * @param project not used
	 */
public static void setCodeTemplate(String templateId, String pattern, IJavaProject project) {
    TemplateStore codeTemplateStore = JavaPlugin.getDefault().getCodeTemplateStore();
    TemplatePersistenceData data = codeTemplateStore.getTemplateData(templateId);
    Template orig = data.getTemplate();
    Template copy = new Template(orig.getName(), orig.getDescription(), orig.getContextTypeId(), pattern, true);
    data.setTemplate(copy);
}
Also used : TemplatePersistenceData(org.eclipse.che.jface.text.templates.persistence.TemplatePersistenceData) TemplateStore(org.eclipse.che.jface.text.templates.persistence.TemplateStore) Template(org.eclipse.jface.text.templates.Template)

Aggregations

TemplatePersistenceData (org.eclipse.che.jface.text.templates.persistence.TemplatePersistenceData)1 TemplateStore (org.eclipse.che.jface.text.templates.persistence.TemplateStore)1 Template (org.eclipse.jface.text.templates.Template)1