Class: Glimmer::SWT::CommandHandlers::CustomWidgetCommandHandler
- Inherits:
-
Object
- Object
- Glimmer::SWT::CommandHandlers::CustomWidgetCommandHandler
- Includes:
- CommandHandler
- Defined in:
- lib/glimmer/swt/command_handlers/custom_widget_command_handler.rb
Instance Method Summary collapse
- #can_handle?(parent, command_symbol, *args, &block) ⇒ Boolean
- #do_handle(parent, command_symbol, *args, &block) ⇒ Object
Instance Method Details
#can_handle?(parent, command_symbol, *args, &block) ⇒ Boolean
11 12 13 14 |
# File 'lib/glimmer/swt/command_handlers/custom_widget_command_handler.rb', line 11 def can_handle?(parent, command_symbol, *args, &block) (parent.is_a?(GWidget) || parent.is_a?(SWT::CustomWidget)) and SWT::CustomWidget.for(command_symbol) end |
#do_handle(parent, command_symbol, *args, &block) ⇒ Object
16 17 18 19 20 |
# File 'lib/glimmer/swt/command_handlers/custom_widget_command_handler.rb', line 16 def do_handle(parent, command_symbol, *args, &block) = args.pop if args.last.is_a?(Hash) Glimmer.logger.debug "Custom widget #{command_symbol} styles are: [" + args.inspect + "] and options are: #{}" SWT::CustomWidget.for(command_symbol).new(parent, *args, , &block) end |