Class: Glimmer::SWT::CommandHandlers::WidgetCommandHandler

Inherits:
Object
  • Object
show all
Includes:
CommandHandler
Defined in:
lib/glimmer/swt/command_handlers/widget_command_handler.rb

Instance Method Summary collapse

Instance Method Details

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

Returns:

  • (Boolean)


13
14
15
16
17
# File 'lib/glimmer/swt/command_handlers/widget_command_handler.rb', line 13

def can_handle?(parent, command_symbol, *args, &block)
  (parent.is_a?(GWidget) || parent.is_a?(SWT::CustomWidget)) and
  command_symbol.to_s != "shell" and
  GWidget.widget_exists?(command_symbol.to_s)
end

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



19
20
21
22
# File 'lib/glimmer/swt/command_handlers/widget_command_handler.rb', line 19

def do_handle(parent, command_symbol, *args, &block)
  Glimmer.logger.debug "widget styles are: " + args.inspect
  GWidget.new(command_symbol.to_s, parent.widget, args)
end