Module: JRubyFX::DSL::ClassUtils
- Includes:
- FXImports
- Defined in:
- lib/jrubyfx/dsl.rb
Overview
Contains methods to be defined inside all classes that include JRubyFX
Constant Summary
Constants included from FXImports
FXImports::JFX_CLASS_HIERARCHY, FXImports::LOCAL_NAME_MAP
Class Method Summary collapse
-
.register_type(type, name = nil) ⇒ Object
Register your own type for use in the DSL.
Methods included from FXImports
Class Method Details
.register_type(type, name = nil) ⇒ Object
Register your own type for use in the DSL.
class MyFooWidget < Region
#...
end
#...
register_type(MyFooWidget)
register_type(MyFooWidget, "aliased_name")
Note, this also makes it possible to override existing definitions of built-in components.
43 44 45 46 |
# File 'lib/jrubyfx/dsl.rb', line 43 def register_type(type, name=nil) name = type.name.snake_case unless name JRubyFX::DSL::NAME_TO_CLASSES[name.to_s] = type end |