ReactiveX / RxSwing

RxJava bindings for Swing
Apache License 2.0
98 stars 23 forks source link

[do not yet merge] ChangeEventSource & fromChangeEvents #28

Closed samuelgruetter closed 8 years ago

samuelgruetter commented 9 years ago

Here's how I would add a ChangeEventSource and SwingObservable.fromChangeEvents(...) methods.

The problem is that the many Swing classes which have addChangeListener and removeChangeListener methods don't implement a common interface or super class, so we need to write a separate fromChangeEvents overload for each such Swing class.

So the goal is to have no code duplication except at the place where we have to show to the Java compiler that the Swing class in question indeed has addChangeListener and removeChangeListener methods. This PR gives one way of achieving this, comments/feedback are welcome ;-)

Note that this PR is not yet complete: It has no tests yet, needs more fromChangeEvents overloads, and probably also some doc improvements. I don't have time to continue on this right now, but everyone please feel free to branch from here and continue ;-)

whymarrh commented 9 years ago

Possible extra overloads: javax.swing.AbstractButton and javax.swing.JTabbedPane

Petikoch commented 8 years ago

@samuelgruetter and @mikebaum

I propose to delete this PR. Since 0.26.0 there is already a ChangeEventSource.

Let's do some cleanup for RxSwing...

samuelgruetter commented 8 years ago

I guess closing the PR is enough... ;-)