© 2008 by Bryan Campbell; made available under the EPL v1.0
Bryan CampbellSoftware Engineer, Lombardi Software
March 14, 2008
Deep integration of GWT/JavaScript and Eclipse 3.3 using XULRunner and JavaXPCOM
Deep Integration of GWT and Eclipse 3.3 with JavaXPCom | © 2008 by Bryan Campbell; made available under the EPL v1.0
Deep Integration of GWT and Eclipse 3.3 with JavaXPCom | © 2008 by Bryan Campbell; made available under the EPL v1.0
Demo ….
Deep Integration of GWT and Eclipse 3.3 with JavaXPCom | © 2008 by Bryan Campbell; made available under the EPL v1.0
Deep Integration of GWT and Eclipse 3.3 with JavaXPCom | © 2008 by Bryan Campbell; made available under the EPL v1.0
MessagingComponent() { void addToList(String msg) { messageList.add(msg); updateView(); }}
XULRunner
XPCOM
JavaXPCOM
IMessagingComponent { addToList(String msg);}
Deep Integration of GWT and Eclipse 3.3 with JavaXPCom | © 2008 by Bryan Campbell; made available under the EPL v1.0
MessagingComponent() { void addToList(String msg) { messageList.add(msg); updateView(); }}
IMessagingComponent { addToList(String msg);}
XULRunner
XPCOM
• By wrapping the eclipse browser widget with XULRunner, we gain access to its component object model – XPCOM.
Deep Integration of GWT and Eclipse 3.3 with JavaXPCom | © 2008 by Bryan Campbell; made available under the EPL v1.0
MessagingComponent() { void addToList(String msg) { messageList.add(msg); updateView(); }}
IMessagingComponent { addToList(String msg);}
XULRunner
XPCOM
• JavaScript can make calls to XPCOM through the XPConnect layer.
Deep Integration of GWT and Eclipse 3.3 with JavaXPCom | © 2008 by Bryan Campbell; made available under the EPL v1.0
MessagingComponent() { void addToList(String msg) { messageList.add(msg); updateView(); }}
XULRunner
XPCOMIMessagingComponent { addToList(String msg);}
• Once the component is in place, the interface will be reflected to JavaScript through XPConnect
• A call to this component might look similar to:IMessagingComponent messenger = xpcom.create(IMessagingComponent);messenger.addToList(“EclipseCon 08”);
Deep Integration of GWT and Eclipse 3.3 with JavaXPCom | © 2008 by Bryan Campbell; made available under the EPL v1.0
XULRunner• The Java Implementation will be the actual code that is run when a call to addToList(String) is made from the web app
IMessagingComponent { addToList(String msg);}
XPCOM MessagingComponent() { void addToList(String msg) { messageList.add(msg); updateView(); }}
Deep Integration of GWT and Eclipse 3.3 with JavaXPCom | © 2008 by Bryan Campbell; made available under the EPL v1.0
XULRunner
IMessagingComponent { addToList(String msg);}
• Similar to XPConnect, JavaXPCOM is the layer between Java and XPCOM allowing calls to be made, and XPCOM components to be used and manipulated.
XPCOM MessagingComponent() { void addToList(String msg) { messageList.add(msg); updateView(); }}
JavaXPCOM
Deep Integration of GWT and Eclipse 3.3 with JavaXPCom | © 2008 by Bryan Campbell; made available under the EPL v1.0
More Info• Check out http://development.lombardi.com for more coding
examples and resources.
• Source also available at http://code.google.com/p/javaxpcom/