Java XPCOM to embed XULRunner in Java Swing App
sandipchitale <[email protected]> Thu, 06 Sep 2007 06:14:39 -0000
| Newsgroups | gmane.comp.mozilla.devel.java |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <1189059279.938944.291030__4766.14212752811$1189059334$gmane$org@r34g2000hsd.googlegroups.com> |
I am thinking of a strategy to use XULRunner to embed inside a Java/ Swing application. I want it work well with Swing applications. NOT AWT APPLICATIONS. So here is the jist of my thinking: =================================== =================================== =================================== =================================== =================================== ================XXXXXXXXXXXX========= ================XXXXXXXXXXXX========= ================XXXXXXXXXXXX========= ================XXXXXXXXXXXX========= ================XXXXXXXXXXXX========= ================XXXXXXXXXXXX========= =================================== =================================== =================================== === shows the rectangle of JFrame which is a heavyweight AWT component which has a real platform window handle associated with it - let us call it HWND. Let us say the JFrame size is width=800 height=800 XXX shows the rectangle of a JPanel. This is where I want the embeded XULRunner to render the output and listen to the input events (keyboard and mouse) Let us assume that the JPanel is positioned at x=200, y=200, width=400, height=400 and opaque=false. Now JavaXPCom requires a window handle to be passed in. The JFrame's AWT peer's window handle could be passed in here. I noticed that at lower level when one gets through JavaXPCOM ->XPCOM - > the real XULRunner APIS there is an interface: nsIEmbeddingSiteWindow (http://www.mozilla.org/projects/embedding/ embedapiref/embedapi12.html#1033870) which has method: void nsIEmbeddingSiteWindow::setDimensions( in unsigned long flags,in long x,in long y, in long cx, in long cy) Parameters: flags: Combination of position, inner and outer size flags. x: Left hand corner of the outer area. y: Top corner of the outer area. cx: Width of the inner or outer area. cy: Height of the inner or outer area. So here is my question. What is the meaning of inner and outer size flags here? Could this mechanism be used to make XULRunner render the content by calling the: setDimensions() method with OUTER,0,0,800,800 i.e. JFrame's bound setDimensions() method with INNER,200,200,400,400 i.e. JPanel's bounds Will XURLRunner only render where JPanel is? How to get to nsIEmbeddingSiteWindow through the JavaXPCOM? I have not figured out a way yet. Can any experts shed any light on this? thanks, Sandip