Class: Glimmer::SWT::CommandHandlers::LayoutCommandHandler

Inherits:
Object
  • Object
show all
Includes:
CommandHandler
Defined in:
lib/glimmer/swt/command_handlers/layout_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
18
# File 'lib/glimmer/swt/command_handlers/layout_command_handler.rb', line 13

def can_handle?(parent, command_symbol, *args, &block)
  parent.is_a?(GWidget) and
  parent.widget.is_a?(Composite) and
  command_symbol.to_s.end_with?('_layout') and
  GLayout.layout_exists?(command_symbol.to_s)
end

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



20
21
22
23
# File 'lib/glimmer/swt/command_handlers/layout_command_handler.rb', line 20

def do_handle(parent, command_symbol, *args, &block)
  Glimmer.logger.debug "Layout #{command_symbol} args are: #{args.inspect}"
  GLayout.new(command_symbol.to_s, parent.widget, args)
end