Bug 4139 EC DCR: Code templates feature (1GIVMDV)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateSet.java
private static final String DESCRIPTION_ATTRIBUTE= "description"; 
	private static final String CONTEXT_ATTRIBUTE= "context"; 
	private static final String ENABLED_ATTRIBUTE= "enabled"; 
	private List fTemplates= new ArrayList();
	private Comparator fTemplateComparator= new TemplateComparator();
	private Template[] fSortedTemplates= new Template[0];
	
	private static TemplateSet fgTemplateSet;
	public static TemplateSet getInstance() {
		if (fgTemplateSet == null)
			fgTemplateSet= create();
		
		return fgTemplateSet;
	}
	private static InputStream getDefaultsAsStream() {
		return TemplateSet.class.getResourceAsStream(DEFAULT_FILE);
	}
	private static File getTemplateFile() {
		IPath path= JavaPlugin.getDefault().getStateLocation();
		path= path.append(TEMPLATE_FILE);
		
		return path.toFile();
	}
	
	private TemplateSet() {
	}
	private static TemplateSet create() {
		try {			
			File templateFile= getTemplateFile();			
			if (!templateFile.exists()) {