Class: Glimmer::DSL::SWT::WidgetExpression

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

Constant Summary collapse

EXCLUDED_KEYWORDS =
%w[shell display tab_item]

Instance Method Summary collapse

Instance Method Details

#add_content(parent, &block) ⇒ Object



23
24
25
26
# File 'lib/glimmer/dsl/swt/widget_expression.rb', line 23

def add_content(parent, &block)
  super
  parent.post_add_content
end

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

Returns:

  • (Boolean)


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

def can_interpret?(parent, keyword, *args, &block)
  !EXCLUDED_KEYWORDS.include?(keyword) and
    parent.respond_to?(:swt_widget) and #TODO change to composite?(parent)
    Glimmer::SWT::WidgetProxy.widget_exists?(keyword)
end

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



19
20
21
# File 'lib/glimmer/dsl/swt/widget_expression.rb', line 19

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