Re: Java XPCOM to embed XULRunner in Java Swing App
sandipchitale <[email protected]> Mon, 10 Sep 2007 12:04:11 -0700
| Newsgroups | gmane.comp.mozilla.devel.java |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <1189451051.494216.257390__44871.2487625473$1189486221$gmane$org@57g2000hsv.googlegroups.com> |
Thanks for you response Javier. On Sep 10, 9:48 am, Javier Pedemonte <[email protected]> wrote: > sandipchitale wrote: > > So here is my question. What is the meaning of inner and outer size > > flags here? > > Seehttp://mxr.mozilla.org/mozilla1.8/source/embedding/browser/webBrowser... > for an explanation on "inner" vs "outer" size. I did. It says: "The inner area refers to just the embedded area, wheras the outer area can also include any surrounding chrome, window frame, title bar, and so on." That is what triggered my interest. "inner area" could mean the area of the JPanel. The rest of the stuff surrounding JPanel could be treated as "surrounding chrome, window frame, title bar, and so on". It may be that I am not understanding it correctly. > > > 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 > > Don't think you can do this. Seems from the docs that you can only do > one or the other. That is correct in the sense that you can in a single call specify one or the other. But you can always make two calls like this: void setDimensions(nsIEmbeddingSiteWindow.DIM_FLAGS_SIZE_OUTER , 0,0,800,800); followed by: void setDimensions(nsIEmbeddingSiteWindow.DIM_FLAGS_SIZE_INNER , 200,200,400,400); No? > > Usehttp://mxr.mozilla.org/mozilla1.8to search for the how the > inner/outer flags are used. > > > Will XURLRunner only render where JPanel is? > > You'll have to experiment to find out how that works. That is right. > > > How to get to nsIEmbeddingSiteWindow through the JavaXPCOM? I have not > > figured out a way yet. > > You can call QueryInterface on the window (i.e. nsIBaseWindow, amongst > others) to get at nsIEmbeddingSiteWindow. I am just new to this XPCOM stuff, my C++ is little rusty but I will give that a try. > > Search the code. Mozilla documentation isn't the greatest, so often the > best way to figure something out is to see how it is used elsewhere. > Most of the code is C++, but it should be easy to convert that to Java. > > javier pedemonte thanks, Sandip