Sha256: f6ecf90e5e52f1fb34b7f1394bd438e181c6f107bab7f8d102b3e36e8bee370a

Contents?: true

Size: 685 Bytes

Versions: 1

Compression:

Stored size: 685 Bytes

Contents

require 'glimmer'
require 'glimmer/dsl/expression'
require 'glimmer/dsl/parent_expression'

module Glimmer
  module DSL
    class WidgetExpression < Expression
      include ParentExpression
      
      EXCLUDED_KEYWORDS = %w[shell display tab_item]

      def can_interpret?(parent, keyword, *args, &block)
        !EXCLUDED_KEYWORDS.include?(keyword) and
          widget?(parent) and
          SWT::WidgetProxy.widget_exists?(keyword)
      end

      def interpret(parent, keyword, *args, &block)
        Glimmer.logger&.debug "widget styles are: " + args.inspect
        SWT::WidgetProxy.new(keyword, parent, args)
      end
    end
  end
end

require 'glimmer/swt/widget_proxy'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
glimmer-0.5.3 lib/glimmer/dsl/widget_expression.rb