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



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

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

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

Returns:

  • (Boolean)


34
35
36
37
38
# File 'lib/glimmer/dsl/swt/widget_expression.rb', line 34

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



40
41
42
# File 'lib/glimmer/dsl/swt/widget_expression.rb', line 40

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