More importantly, I wanted to take some time to walk you through how the integration might look for you.
Google Web Toolkit (GWT)
A JSNI comment block looks like this:
JSNI methods are called just like any normal Java method. They can be static or instance methods. Here, we create an instance method of the Gauge class:
GWT provides the $wnd and $doc variables to refer to the window and document objects. The code of your GWT app runs in a (hidden) iframe, so document references that iframe’s document (and window the iframe’s browsing context).
GWT thus initializes the variables $doc and $wnd to let you easily reference the document and browsing context (window) of the “host page” that loads the GWT app.
Linkers decide how the compiled code is loaded, the default one (std) and the newer xsiframe use iframes, whereas the deprecated xs loads your code in the same browsing context (so $doc == document and $wnd == window).