Class: Glimmer::DSL::LayoutExpression

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

Instance Method Summary collapse

Methods included from ParentExpression

#add_content

Methods inherited from Expression

#add_content, #textual?, #widget?

Instance Method Details

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

Returns:

  • (Boolean)


13
14
15
16
17
18
# File 'lib/glimmer/dsl/layout_expression.rb', line 13

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

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



20
21
22
# File 'lib/glimmer/dsl/layout_expression.rb', line 20

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