title: Call Java method from GWT app via SWT Browser / SWT BrowserFunction
body: <p>In a RCP application I am displaying a GWT-based web-application in a SWT Browser.</p>
  
  <p>My Goal is, to call a Java Method from within the GWT application.</p>
  
  <p>From what I understand the easiest way to do that is to use SWT BrowserFunction, which injects a java Method that I can call from within the web-application.</p>
  
  <p>For some reason I'm not able to get it to work...</p>
  
  <p>In RCP I defined the following</p>
  
  <pre><code>public class GWTBrowserView extends ViewPart { 
      private GWTBrowser browser; 
  
      @Override 
      public void createPartControl(final Composite parent) { 
              this.browser = new GWTBrowser(parent, SWT.NONE); 
              this.browser.setUrl("url of gwt app"); 
              new BrowserFunction(this.browser, "onGWTEvent") { 
  
                      @Override 
                      public Object function(final Object[] arguments) { 
                              // Do something fancy
                              return super.function(arguments); 
                      } 
              }; 
      } 
  </code></pre>
  
  <p>In my GWT EntryPoint as part of onModuleLoad I am calling the Method:</p>
  
  <pre><code>private native void fireRCPEvent(String rcpEventJSON) /*-{
  try{
      onGWTEvent(rcpEventJSON);
  } catch(e) {
      alert(e.message)
  }
  </code></pre>
  
  <p>Any ideas how to establish the communication between GWT and RCP via the SWT Browser?</p>