Sha256: d3ab08d7ebd7c7d528d731f82845e2b4adad5161e70f7e696b7091287adfd51d

Contents?: true

Size: 922 Bytes

Versions: 5

Compression:

Stored size: 922 Bytes

Contents

require 'glimmer/dsl/static_expression'
require 'glimmer/dsl/parent_expression'
require 'glimmer/dsl/top_level_expression'
require 'glimmer/swt/shell_proxy'
require 'glimmer/swt/message_box_proxy'
require 'glimmer/swt/swt_proxy'

module Glimmer
  module DSL
    module SWT
      class MessageBoxExpression < StaticExpression
        include TopLevelExpression
        include ParentExpression

        include_package 'org.eclipse.swt.widgets'

        def can_interpret?(parent, keyword, *args, &block)
          keyword == 'message_box'
        end

        def interpret(parent, keyword, *args, &block)
          potential_parent = args.first
          parent = args.shift if potential_parent.is_a?(Shell) || (potential_parent.respond_to?(:swt_widget) && potential_parent.swt_widget.is_a?(Shell))
          Glimmer::SWT::MessageBoxProxy.new(parent, Glimmer::SWT::SWTProxy[args])
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
glimmer-dsl-swt-0.1.3 lib/glimmer/dsl/swt/message_box_expression.rb
glimmer-dsl-swt-0.1.2 lib/glimmer/dsl/swt/message_box_expression.rb
glimmer-dsl-swt-0.1.1 lib/glimmer/dsl/swt/message_box_expression.rb
glimmer-dsl-swt-0.1.0 lib/glimmer/dsl/swt/message_box_expression.rb
glimmer-0.8.2 lib/glimmer/dsl/swt/message_box_expression.rb