JDojo and Its Usage Te-Hsin Shih 04/30/2013
Dojo Dojo Toolkit is an open source JavaScript library designed to ease the rapid development of cross-platform, JavaScript/Ajax-based applications and web sites. DoJo example // Load Dojo's code relating to the Button widget dojo.require("dijit.form.Button"); Hello World!
JDojo JDojo is a toolkit that allows the developer to use Java language to control Dojo widgets. JDojo toolkit translates the Java code into Java scripts. JDojo group has been quite since Don’t know what is its future.
JDojo Example WebEditor.java public class WebEditor extends _Widget implements _Templated { public void postCreate() { CreateEclipseEditorParms parms = new CreateEclipseEditorParms(); parms.parent = this; editor = utilNative.createEclipseEditor(parms); editor.setContents("Hellow World!!"); } WebEditor.js dojo.declare("com.ibm.team.scm.web.ui.internal.widgets.dojoWebEditor.WebEditor", [ _Widget, _Templated], { postCreate: function() { var parms= {}; parms.parent= this; this.editor= utilNative.createEclipseEditor(parms); this.editor.setContents("Hellow World!!"); } }); })();
JDojo Special Syntaxes The “native” keyword – the native keyword in JDojo means the implementation of the method is in the JavaScript file. public class Editor extends DojoObject { public Editor(Object params) { } public void onInputChange(String title, String message, String contents, boolean contentsSaved) {... } public native void setContents(String contents); }
JDojo Special annotation – it means do not generate JavaScript file from this public class utilNative { public static Editor createEclipseEditor (CreateEclipseEditorParms parms) { return null; }
References Install JDojo toolkits to eclipse client – on/tools/devtools-updatesite on/tools/devtools-updatesite
Discussions Limitations on Java features that can be used in JDoJo classes.