Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You are asking a lot of questions here. In your case you should create as much questions in so as you have qustion marks in your original post.</p> <p>Regarding your first question, look at <a href="http://code.google.com/intl/ru-RU/webtoolkit/doc/latest/DevGuideCodingBasicsJSNI.html" rel="nofollow">JSNI</a>.</p> <p>Edit: So okrasz gave you a number of references to look at. From my side I’ll try to help with your example using JSNI (because you were asking about binding your existing js to GWT).</p> <p>Let's say you have your <code>MyTable</code> defined as</p> <pre class="lang-html prettyprint-override"><code>&lt;script type="text/javascript"&gt; MyTable = function(a,b){ this.a = a; this.b = b; }; &lt;/script&gt; </code></pre> <p>and your js file is called <code>mytable.js</code></p> <p>Now, we need this to be a component. In your .java file in GWT library project create a class like this:</p> <pre class="lang-java prettyprint-override"><code>public class MyTable extends JavaScriptObject { protected MyTable(){} public static native MyTable create(double a, double b) /*-{ return new MyTable(a,b); }-*/; public final native double getA() /*-{ return this.a; }-*/; public final native double getB() /*-{ return this.b; }-*/; } </code></pre> <p>Add your original js file to the resources and add a <code>script</code> node to your <code>gwt.xml</code> module like this:</p> <pre class="lang-xml prettyprint-override"><code>&lt;module&gt; &lt;inherits name="com.google.gwt.core.Core"/&gt; &lt;script src="path/to/mytable.js"/&gt; &lt;source path="client"/&gt; &lt;public path="public"/&gt; &lt;/module&gt; </code></pre> <p>That's pretty much it. I might forgot something but you can reference any oss project that does the same thing you need. For instance, take a look at <a href="http://code.google.com/p/swfupload-gwt/source/browse/" rel="nofollow">swfupload-gwt</a> project source code.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload