<?xml version="1.0" encoding="UTF-8" standalone="no"?><templates><template autoinsert="true" context="com.powerflasher.fdt.ui.editor.template.as3" deleted="false" description="Creates a Singleton Class" enabled="true" name="Singleton">package ${enclosing_package} {&#13;
	&#13;
	/**&#13;
	 * ${comments}&#13;
	 * @see http://blog.pixelbreaker.com/flash/as30-better-singletons&#13;
	 * @author ${user}&#13;
	 */&#13;
	public class ${enclosing_type} {&#13;
&#13;
		/** The singleton intance */&#13;
		private static var instance : ${enclosing_type};&#13;
		&#13;
		/**&#13;
		 * Get a reference to the singleton instance of the &lt;code&gt;${enclosing_type}&lt;/code&gt;.&#13;
		 * @return A(n) &lt;code&gt;${enclosing_type}&lt;/code&gt; singleton object.&#13;
		 */&#13;
		public static function getInstance() : ${enclosing_type} {&#13;
			if (instance == null) instance = new ${enclosing_type}(new SingletonEnforcer());&#13;
			return instance;&#13;
		}&#13;
&#13;
		/**&#13;
		 * Constructor&#13;
		 * @param pSingletonEnforcer Prevents instantiation&#13;
		 * @throws An &lt;code&gt;Error&lt;/code&gt; when directly instantiated.&#13;
		 * @see ${enclosing_package_and_type}#getInstance()&#13;
		 */&#13;
		public function ${enclosing_type}(pSingletonEnforcer : SingletonEnforcer) {&#13;
			if (pSingletonEnforcer == null) {&#13;
				throw new Error("${enclosing_type} is a singleton class, use getInstance() instead");&#13;
			}&#13;
		}&#13;
	}&#13;
}&#13;
internal class SingletonEnforcer {&#13;
}</template></templates>
