diff --git a/haxe/ui/core/ComponentClassMap.hx b/haxe/ui/core/ComponentClassMap.hx index 381374047..be3dc6b28 100644 --- a/haxe/ui/core/ComponentClassMap.hx +++ b/haxe/ui/core/ComponentClassMap.hx @@ -19,6 +19,14 @@ class ComponentClassMap { instance.registerClassName(alias.toLowerCase(), className); } + public static function registerClass(cls:Class, alias:String = null) { + var className = Type.getClassName(cls); + if (alias == null) { + alias = className.split(".").pop().toLowerCase(); + } + instance.registerClassName(alias.toLowerCase(), className); + } + public static function list():Iterator { instance.load(); return instance._map.keys();