Class: Glimmer::SWT::CommandHandlers::TabItemCommandHandler

Inherits:
Object
  • Object
show all
Includes:
Glimmer, CommandHandler
Defined in:
lib/glimmer/swt/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 Glimmer::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)


12
13
14
15
# File 'lib/glimmer/swt/command_handlers/tab_item_command_handler.rb', line 12

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

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



17
18
19
20
# File 'lib/glimmer/swt/command_handlers/tab_item_command_handler.rb', line 17

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