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.29.0 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.28.3 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.28.2 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.28.1 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.28.0 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.27.0 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.26.3 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.26.2 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.26.1 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.26.0 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.25.4 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.25.3 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.25.2 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.25.1 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.25.0 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.24.0 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.23.0 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.22.1 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.22.0 lib/glimmer/swt/property_owner.rb
glimmer-dsl-opal-0.21.0 lib/glimmer/swt/property_owner.rb