Class: Glimmer::DSL::SWT::TabItemExpression

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

Instance Method Summary collapse

Instance Method Details

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

Returns:

  • (Boolean)


36
37
38
39
40
41
42
43
44
45
46
# File 'lib/glimmer/dsl/swt/tab_item_expression.rb', line 36

def can_interpret?(parent, keyword, *args, &block)
  initial_condition = (keyword == 'tab_item') and parent.respond_to?(:swt_widget)
  if initial_condition
    if parent.swt_widget.is_a?(TabFolder)
      return true
    else
      Glimmer::Config.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



48
49
50
# File 'lib/glimmer/dsl/swt/tab_item_expression.rb', line 48

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