History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRUBY-2449
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Charles Oliver Nutter
Reporter: Vladimir Sizikov
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
JRuby

Implement closure convention for static java methods

Created: 25/Apr/08 01:54 PM   Updated: 10/Sep/08 06:44 PM
Component/s: Java Integration
Affects Version/s: JRuby 1.1.1
Fix Version/s: JRuby 1.1.4

Time Tracking:
Not Specified

Environment: Latest JRuby 1.1.1


 Description  « Hide
Currently:
EventQueue = java.awt.EventQueue
EventQueue.invoke_later {
  puts "VVS"
}

ArgumentError: wrong # of arguments(0 for 1)

But it would be very useful, especially in Swing development, to be able to do that.
Without that, the code is not pretty:

# I need to pop-up a Frame properly,
# to avoid deadlocks.
# And this code is UGLY. :)

EventQueue = java.awt.EventQueue
class FrameBringer
  include java.lang.Runnable
  def initialize(frame)
    @frame = frame
  end
  def run
    @frame.visible = true
  end
end

EventQueue.invoke_later(FrameBringer.new(frame))


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Charles Oliver Nutter - 08/Aug/08 01:07 AM
Fixed with tests as part of my refactoring.