Sha256: 87b15f2dea5c6c1e44d75468d1b00b67ee9532732e478994a83e07d609c1ca52

Contents?: true

Size: 718 Bytes

Versions: 5

Compression:

Stored size: 718 Bytes

Contents

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

module Glimmer
  module DSL
    module SWT
      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 #TODO change to composite?(parent)
            Glimmer::SWT::WidgetProxy.widget_exists?(keyword)
        end
  
        def interpret(parent, keyword, *args, &block)
          Glimmer::SWT::WidgetProxy.new(keyword, parent, args)
        end
      end
    end
  end
end

require 'glimmer/swt/widget_proxy'

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
glimmer-0.7.3 lib/glimmer/dsl/swt/widget_expression.rb
glimmer-0.7.2 lib/glimmer/dsl/swt/widget_expression.rb
glimmer-0.7.1 lib/glimmer/dsl/swt/widget_expression.rb
glimmer-0.7.0 lib/glimmer/dsl/swt/widget_expression.rb
glimmer-0.6.0 lib/glimmer/dsl/swt/widget_expression.rb