Is it a unknown fable from La Fontaine? Not really, in fact it has more to do about OpenOffice.org and Mozilla. I was trying to tamper with some web pages and I wanted to check whether we could integrate easily a small web-browser inside OpenOffice.org.
Hopefully, there is an interesting feature coming up with Eclipse 3.3 which helps a lot: SWT provides the ability to create a Browser composite which runs the xulrunner (downloads). This means that we could perfectly imagine a small Java extension to OpenOffice.org which provides a UNO service to show any XUL or HTML page.
Here is a small snippet I created to test this on windows:
Display display = Display.getDefault();
final Shell shell = new Shell(display);
shell.setText("My OOo Browser");
shell.setSize(400, 300);
shell.setLayout(new GridLayout());
System.setProperty("org.eclipse.swt.browser.XULRunnerPath",
"C:\\Documents and Settings\\Cbosdonnat\\Mes documents\\xulrunner");
Browser browser = new Browser(shell, SWT.MOZILLA);
browser.setLayoutData(new GridData(GridData.FILL_BOTH));
browser.setUrl("http://fr.openoffice.org");
shell.open();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
I let you imagine the kind of interesting applications we could do using this... Of course the same principle is working on Linux and I would like to test it on MacOS, but I let you translate the above code for it.