Class: TabItemCommandHandler

Inherits:
Object
  • Object
show all
Includes:
CommandHandler, Glimmer
Defined in:
lib/command_handlers/tab_item_command_handler.rb

Instance Method Summary collapse

Methods included from Glimmer

#add_contents, add_contents, dsl, #dsl, extended, included, logger, #method_missing, method_missing

Methods included from SwtPackages

included

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Glimmer

Instance Method Details

#can_handle?(parent, command_symbol, *args, &block) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
# File 'lib/command_handlers/tab_item_command_handler.rb', line 9

def can_handle?(parent, command_symbol, *args, &block)
  parent.is_a?(RWidget) and 
    command_symbol.to_s == "tab_item"
end

#do_handle(parent, command_symbol, *args, &block) ⇒ Object



14
15
16
17
# File 'lib/command_handlers/tab_item_command_handler.rb', line 14

def do_handle(parent, command_symbol, *args, &block) 
  tab_item = RWidget.new(command_symbol.to_s, parent.widget, args)
  RTabItemComposite.new(tab_item, parent.widget, args)
end