Class: Glimmer::DSL::TabItemExpression

Inherits:
StaticExpression show all
Includes:
ParentExpression
Defined in:
lib/glimmer/dsl/tab_item_expression.rb

Instance Method Summary collapse

Methods included from ParentExpression

#add_content

Methods inherited from StaticExpression

inherited

Methods inherited from Expression

#add_content, #textual?, #widget?

Instance Method Details

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

Returns:

  • (Boolean)


14
15
16
17
18
19
20
21
22
23
24
# File 'lib/glimmer/dsl/tab_item_expression.rb', line 14

def can_interpret?(parent, keyword, *args, &block)
  initial_condition = (keyword == 'tab_item') and widget?(parent)
  if initial_condition
    if parent.swt_widget.is_a?(TabFolder)
      return true
    else
      Glimmer.logger&.error "tab_item widget may only be used directly under a tab_folder widget!"
    end
  end
  false
end

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



26
27
28
# File 'lib/glimmer/dsl/tab_item_expression.rb', line 26

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