Class: SwingSupport::ActionListener

Inherits:
Object
  • Object
show all
Defined in:
lib/swing_support/action_listener.rb

Overview

Class that implements ActionListener interface around a given block

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ ActionListener



8
9
10
# File 'lib/swing_support/action_listener.rb', line 8

def initialize &block
  @listener_block = block
end

Instance Method Details

#actionPerformed(event) ⇒ Object

from ActionListener interface: Invoked when an action event occurs.



14
15
16
# File 'lib/swing_support/action_listener.rb', line 14

def actionPerformed event
  @listener_block.call event
end