Re: Java XPCOM to embed XULRunner in Java Swing App

Javier Pedemonte <[email protected]> Mon, 10 Sep 2007 11:48:52 -0500
Newsgroups gmane.comp.mozilla.devel.java
Message-ID <pYudnYcRhKvo6HjbnZ2dnUVZ_o6knZ2d__2354.47491654686$1189478746$gmane$org@mozilla.org>
sandipchitale wrote:
> So here is my question. What is the meaning of inner and outer size
> flags here?

See 
http://mxr.mozilla.org/mozilla1.8/source/embedding/browser/webBrowser/nsIEmbeddingSiteWindow.idl 
for an explanation on "inner" vs "outer" size.

> 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.

Use http://mxr.mozilla.org/mozilla1.8 to 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.

> 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.

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