Class: Glimmer::DSL::SWT::LayoutExpression

Inherits:
Expression
  • Object
show all
Includes:
ParentExpression
Defined in:
lib/glimmer/dsl/swt/layout_expression.rb

Instance Method Summary collapse

Instance Method Details

#can_interpret?(parent, keyword, *args, &block) ⇒ Boolean

Returns:

  • (Boolean)


37
38
39
40
41
42
# File 'lib/glimmer/dsl/swt/layout_expression.rb', line 37

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

#interpret(parent, keyword, *args, &block) ⇒ Object



44
45
46
# File 'lib/glimmer/dsl/swt/layout_expression.rb', line 44

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