Sha256: 45ff1d84dda3349839543251c1628eb65923bf03a71edb26929aec6571eae1a8

Contents?: true

Size: 487 Bytes

Versions: 12

Compression:

Stored size: 487 Bytes

Contents

require 'swing_support/extensions'

module SwingSupport
  # Class that implements ActionListener interface around a given block
  class ActionListener
    java_implements java.awt.event.ActionListener

    def initialize &block
      @action_block = block
    end

    java_signature 'public void actionPerformed(ActionEvent event)'
    # from ActionListener interface: Invoked when an action event occurs.
    def actionPerformed event
      @action_block.call event
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
swing-0.1.15 lib/swing_support/action_listener.rb
swing-0.1.14 lib/swing_support/action_listener.rb
swing-0.1.12 lib/swing_support/action_listener.rb
swing-0.1.10 lib/swing_support/action_listener.rb
swing-0.1.8 lib/swing_support/action_listener.rb
swing-0.1.7 lib/swing_support/action_listener.rb
swing-0.1.5 lib/swing_support/action_listener.rb
swing-0.1.4 lib/swing_support/action_listener.rb
swing-0.1.3 lib/swing_support/action_listener.rb
swing-0.1.2 lib/swing_support/action_listener.rb
swing-0.1.1 lib/swing_support/action_listener.rb
swing-0.1.0 lib/swing_support/action_listener.rb