Class: ApplicationHandler

Inherits:
ActionManager
  • Object
show all
Defined in:
lib/fumoffu/generators/templates/src/ruby/app/actions/handlers/application_handler.rb

Overview

ActionManager is the a Abstract Class which used within the swing UI to handle a actions

In the Fumoffu FrameWork All processed action should go through the ApplicationHandler

Instance Method Summary collapse

Constructor Details

#initializeApplicationHandler

Returns a new instance of ApplicationHandler.



10
11
12
# File 'lib/fumoffu/generators/templates/src/ruby/app/actions/handlers/application_handler.rb', line 10

def initialize
  @handlers = Array.new
end

Instance Method Details

#handleAction(event, action, caller) ⇒ Object

java.awt.event.ActionEvent event, String action, Component caller



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/fumoffu/generators/templates/src/ruby/app/actions/handlers/application_handler.rb', line 15

def handleAction event, action, caller
  begin
    @handlers.each do |handler|
      return true unless not handler.handleAction(event, action, caller)
    end

  rescue => e
    # FIXME INTEGRATE THE RUBY LOGGER
    puts "Failed to process action: '#{action.to_s}' "+e.backtrace.join("\n")+":\n "+e.inspect
  end
  return false
end