abuerki / gwtai

Automatically exported from code.google.com/p/gwtai
3 stars 2 forks source link

Discrepancies in keys used in the HashMap<String, AppletCallback> _appletCallbacks #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
hey there,

first of all, your wrapper is really impressive, and the callback pipelines
between GWT code and applets are very useful.
However I've noticed some inconsistencies in the implementation of those
callbacks:
In com.google.gwt.gwtai.applet.client.CallbackUtil, if your applet object
implementing com.google.gwt.gwtai.applet.client.Applet is not named after
the interface name + "Impl", then the HashMap _appletCallbacks is basically
useless. The stored keys will never match those provided as parameters by
callbackApplet().

For example, if the applet called HTTPPostApplet implements
HTTPPostAppletInterface

final HTTPPostAppletInterface applet = (HTTPPostAppletInterface)
GWT.create(HTTPPostAppletInterface.class);

the GWT code to register the callback must not be:

AppletJSUtil.registerAppletCallback(applet, callback);

but:

CallbackUtil.registerCallback("HTTPPostApplet", callback);

actually.

Thanks for your work, very appreciated.

Original issue reported on code.google.com by okayawri...@gmail.com on 18 May 2010 at 4:10