Sha256: 1ca938b6423fd1ca15e3e8c3c63007b2c86bcbfd9f007e923bb775dccf09c8ce

Contents?: true

Size: 720 Bytes

Versions: 43

Compression:

Stored size: 720 Bytes

Contents

module Glimmer
  module SWT
    # Adapts Glimmer UI classes to SWT JavaBean property owner classes (which are now adapted to Opal)
    module PropertyOwner
      # TODO consider adding has_attribute?
      
      def get_attribute(attribute_name)
        send(attribute_getter(attribute_name))
      end
    
      def set_attribute(attribute_name, *args)
        send(attribute_setter(attribute_name), *args) unless args.size == 1 && send(attribute_getter(attribute_name)) == args.first
      end
      
      def attribute_setter(attribute_name)
        "#{attribute_name.to_s.underscore}="
      end
      
      def attribute_getter(attribute_name)
        attribute_name.to_s.underscore
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
glimmer-dsl-opal-0.20.1 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.20.0 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.19.1 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.19.0 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.18.0 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.17.0 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.16.2 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.16.1 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.16.0 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.15.1 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.14.0 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.13.0 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.12.0 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.11.0 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.10.3 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.10.2 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.10.1 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.10.0 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.9.3 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.9.2 lib/glimmer/swt/property_owner.rb