Module: Glimmer::SWT::PropertyOwner
- Included in:
- LayoutDataProxy, LayoutProxy, WidgetProxy
- Defined in:
- lib/glimmer/swt/property_owner.rb
Overview
Adapts Glimmer UI classes to SWT JavaBean property owner classes (which are now adapted to Opal)
Instance Method Summary collapse
- #attribute_getter(attribute_name) ⇒ Object
- #attribute_setter(attribute_name) ⇒ Object
- #get_attribute(attribute_name) ⇒ Object
- #set_attribute(attribute_name, *args) ⇒ Object
Instance Method Details
#attribute_getter(attribute_name) ⇒ Object
17 18 19 |
# File 'lib/glimmer/swt/property_owner.rb', line 17 def attribute_getter(attribute_name) attribute_name.to_s.underscore end |
#attribute_setter(attribute_name) ⇒ Object
13 14 15 |
# File 'lib/glimmer/swt/property_owner.rb', line 13 def attribute_setter(attribute_name) "#{attribute_name.to_s.underscore}=" end |
#get_attribute(attribute_name) ⇒ Object
5 6 7 |
# File 'lib/glimmer/swt/property_owner.rb', line 5 def get_attribute(attribute_name) send(attribute_getter(attribute_name)) end |
#set_attribute(attribute_name, *args) ⇒ Object
9 10 11 |
# File 'lib/glimmer/swt/property_owner.rb', line 9 def set_attribute(attribute_name, *args) send(attribute_setter(attribute_name), *args) unless send(attribute_getter(attribute_name)) == args.first end |