Sorry for the strange formatting, by the way. I simply copy-and- pasted my code.
On Nov 20, 10:58 am, MonkeyMike <mikebin...@gmail.com> wrote: > I have some JSNI that the GWT compiler doesn't like... > > ---------------------- > public static native void declareCustomMoveable(String > customMoveableId, NativeCustomMoveableCallback callback) /*-{ > dojo.declare( customMoveableId, dojox.gfx.Moveable, { > onFirstMove: function(mover){ > > callba...@gwtgfx.client.callback.custommoveablecallback::onFirstMove > (); > }, > onMoving: function(mover, shift){ > > callba...@gwtgfx.client.callback.custommoveablecallback::onMoving( > > Lgwtgfx/client/definition/jsni/NativeTransformDefinition; > )(shift); > }, > onMoved: function(mover, shift){ > > callba...@gwtgfx.client.callback.custommoveablecallback::onMoved( > > Lgwtgfx/client/definition/jsni/NativeTransformDefinition; > )(shift); > } > }); > }-*/; > ---------------------- > > Note that I am using dojo's pattern for "subclassing" > dojox.gfx.Moveable, and overriding the methods onFirstMove, onMoving, > and onMoved. In each of these, there is a call to the relevant method > from NativeCustomMoveableCallback.java (which is a Java interface, by > the way). The GWT compiler is okay with the onFirstMove > implementation, but for both the onMoving and onMoved implementations, > I get the following error... > > "Expected a valid parameter type signature in JSNI method reference" > > Note that I have indicated that "shift" is an instance of a > NativeTransformDefinition, which is a subclass of JavaScriptObject in > my library. Isn't this valid? I thought that the GWT compiler > "trusts" the developer to indicate types of objects that come from > JavaScript, so long as the types are subclasses of JavaScriptObject. > > So is it just that my syntax is somehow incorrect? I'm using GWT > 1.7. If not, how can I refactor this to achieve a pattern which is > acceptable to the GWT compiler? > > Thanks in advance! :) -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=.