From: Leo U. <leo...@ya...> - 2007-01-12 14:26:16
|
The user base may have some perspective on this as well, so Ill forward this along. From looking at the code, magic adapters for other things should be possible. What would be useful for you though? leouser --- Leo User <leo...@ya...> wrote: > Hi, > > I was looking at a problem a user was having: > a = ThingWithAddXListener() > def meth(e): > print e > > a.xListenerMethod = meth > #this doesn't work because addXListener doesn't take > a > parameter that is an EventListener > > It looks like his problem was because he was trying > to > use something from eclipse. Maybe it would be good > to > lighten up the "EventListener" restriction and maybe > a > few others. > > How strict should this be? Would it be bad if any > interface was allowed to be generated? > public class DoDaa{ > > public void addDoDaaListener(DoDaaListener ddl){ > System.out.println("ADDING " + ddl); > } > > } > > > public interface DoDaaListener{ > public void doDaWasBad(Object o); > public void doDaWasGood(Object o); > } > > It was nice to assign to "doDaWasBad" in the jython > prompt. But the adapters also only occur if this > method name occurs: > if (!(mname.startsWith("add") || > mname.startsWith("set")) || > > !mname.endsWith("Listener")) > > { > > continue; > > } > > > so we need "add/set" and "Listener". Should the > magic > stop there? Would "add/set" be adequate? > > what say you? > leouser > > > > ____________________________________________________________________________________ > Want to start your own business? > Learn how on Yahoo! Small Business. > http://smallbusiness.yahoo.com/r-index > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get > the chance to share your > opinions on IT & business topics through brief > surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Jython-dev mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-dev > ____________________________________________________________________________________ Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. http://farechase.yahoo.com/promo-generic-14795097 |