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

Methods included from FXImports

#const_missing

Class Method Details

.register_type(type = self, name = nil) ⇒ Object

DEPRECATED: Please include JRubyFX::DSLControl instead of this method.

Register your own type for use in the DSL.

class MyFooWidget < Region
  #...
end
#...
register_type(MyFooWidget)
register_type(MyFooWidget, "aliased_name")

class MyOtherWidget < Region
  register_type
end

Note, this also makes it possible to override existing definitions of built-in components.


50
51
52
53
# File 'lib/jrubyfx/dsl.rb', line 50

def register_type(type=self, name=nil)
  name = type.name.snake_case unless name
  JRubyFX::DSL::NAME_TO_CLASSES[name.to_s] = type
end