Sha256: 2d3884aff92d67654e58fca24926ca19ae2986d782b24e3af9a6d8e6837a9a3b

Contents?: true

Size: 657 Bytes

Versions: 8

Compression:

Stored size: 657 Bytes

Contents

require 'glimmer'
require 'glimmer/dsl/expression'
require 'glimmer/dsl/parent_expression'
require 'glimmer/swt/layout_proxy'

module Glimmer
  module DSL
    class LayoutExpression < Expression
      include ParentExpression

      include_package 'org.eclipse.swt.widgets'

      def can_interpret?(parent, keyword, *args, &block)
        keyword.to_s.end_with?('_layout') and
          widget?(parent) and
          parent.swt_widget.is_a?(Composite) and
          SWT::LayoutProxy.layout_exists?(keyword.to_s)
      end

      def interpret(parent, keyword, *args, &block)
        SWT::LayoutProxy.new(keyword, parent, args)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
glimmer-0.5.11 lib/glimmer/dsl/layout_expression.rb
glimmer-0.5.10 lib/glimmer/dsl/layout_expression.rb
glimmer-0.5.9 lib/glimmer/dsl/layout_expression.rb
glimmer-0.5.8 lib/glimmer/dsl/layout_expression.rb
glimmer-0.5.7 lib/glimmer/dsl/layout_expression.rb
glimmer-0.5.6 lib/glimmer/dsl/layout_expression.rb
glimmer-0.5.5 lib/glimmer/dsl/layout_expression.rb
glimmer-0.5.4 lib/glimmer/dsl/layout_expression.rb