public interface ActionListener { public void actionPerformed(ActionEvent evt);
}
...
public void addActionListener(ActionListener l);
class MyActionListener implements ActionListener {
var _delegate: ActionEvent->Void;
public inline function new(dg: ActionEvent->Void) _delegate=dg;
}
...
obj.addActionListener(new MyActionListener(function(evt) { trace("hit me"); } ));
class MyActionListener implements ActionListener {
var _delegate: ActionEvent->Void;
public inline function new(dg: ActionEvent->Void) _delegate=dg;
public function actionPerformed(evt) _delegate(evt);
}...
public void addActionListener(ActionListener l);
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.
I have an idea on how to handle this on the generator side. The only problem is that there's no annotation of what interface is expected to be an anonymous implementation versus what's expected to be an actal interface implementation.
The idea would involve transforming the single-method java interfaces on abstracts that can be cast from a Haxe function type - something like what already happens with delegates on C#.
The problem involves being able to make a clear differentiation between the interface and the abstract - since you can't for instance implement an abstract.
So it still needs some thought