Sha256: 3bc4905e72bc1c67040bc55da48315325f8cba40679eeec4e21d154ed5d3e22e

Contents?: true

Size: 506 Bytes

Versions: 1

Compression:

Stored size: 506 Bytes

Contents

include Java

module Clients

  module Swing
    # 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
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
swing-0.0.2 lib/swing/action_listener.rb