Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [atf-dev] Application doesn't find the Xulrunner instance

Michael A Squillace wrote:
>According to the SWT FAQ, the XULRunner instance must also be "properly
installed," 
>which means executing xulrunner.exe with, say, ---register-global. 
>http://www.eclipse.org/swt/faq.php#howusemozilla 
>Does ATF do this as well or is this a manual step required by the user? 
>If a required manual step, it would be nice to find a way around it else
having a 
>xulrunner plug-in becomes pointless - ie I might just as well use any
XULRunner 
>installation, right? I know that there has been some talk of
re-architecting all 
>of this so maybe I'm missing something. Also, apologies if this is a
question 
>that would be more appropriate for the SWT team. 
Hey Mike, no it is perfectly appropriate.
Xulrunner does not have to be registered.
When a Browser with SWT.MOZILLA style is instantiated, a suitable Xulrunner
is searched, from the most specific to the least specific.
The code is in the SWt method Mozilla.create (Composite parent, int style) 
here:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt/Eclipse%20SWT%20Moz
illa/common/org/eclipse/swt/browser/Mozilla.java?revision=1.67&view=markup

The search sequence is roughly: (check the code for exact details)
- lookup a xulrunner at the location  contained in the System property:
org.eclipse.swt.browser.XULRunnerPath
- if not defined, try to initiallized a xulrunner that is registered
(globally or user, usually global)
- if failing then fallback to the mozilla pointed by the MOZILLA_FIVE_HOME
envrionment variable.
if everything fails (including not finding an embeddable mozilla runtine or
xulrunner that is embeddable and satifies the versions constraints
(GreVersionRange), then fail.

Therefore the way ATF does it is to provide an extension point such that:
- we can ship a xulrunner as an OSGI bundle
- the extension markup points inside that bundle that contains a proper
xulrunner
- the extension looks that up and if found, creates the
org.eclipse.swt.browser.XULRunnerPath sys prop. It tries to do that at
startup time, so that we can be the very first to initialize a xulrunner.
The first code to instantiates a xulrunner wins. we do for now.

Then we just instantiate the browser widget when needed, and the sequence is
that defined in SWT, taking into account our system property.


-- 
Cheers
Philippe

philippe ombredanne | 1 650 799 0949 | pombredanne at nexb.com 
nexB - Open by Design (tm) - http://www.nexb.com 
http://easyeclipse.org - http://phpeclipse.net - http://eclipse.org/atf - 
http://eclipse.org/vep - http://labs.jboss.org/drools/ -
http://developer.mozilla.org/en/docs/XULRunner



Back to the top