|
Re: SWT browser with XForms support [message #528713 is a reply to message #528538] |
Wed, 21 April 2010 14:47 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
Hi,
Firstly, you don't need an external plug-in to use a mozilla-based Browser
on non-*ix platforms, see http://www.eclipse.org/swt/faq.php#howusemozilla
and http://www.eclipse.org/swt/faq.php#specifyxulrunner .
One way to verify whether your document's content is valid is to load it in
a stand-alone browser like Firefox. If it loads fine there then it should
load in the Browser control as well.
How are you feeding your xhtml to the Browser, by setText() or setUrl()? If
it's by setText() then you're seeing
https://bugs.eclipse.org/bugs/show_bug.cgi?id=308398 , in which case you'll
need to try writing your content out to a local file and then pointing
setUrl() at it. Alternatively, if you're already using setUrl() and it's
failing, is a special plug-in required for viewing documents with this type?
If so then you can point the Browser at the directory with the native
browser plug-in as described in
http://www.eclipse.org/swt/faq.php#mozillaplugins .
If these suggestions don't help then please follow up with some more info.
Grant
"Tobias" <tt_dipl@hightower-darter.de> wrote in message
news:hql44r$ltj$1@build.eclipse.org...
> Hello everyone,
>
> i have a big problem with the integration of XForms in a SWT Browser.
>
>
> This is the situation:
> I'm working on an Eclipse RCP application (Windows 7) with different
views.
> There is one view, in which a xhtml-document (HTML+Xforms) must be shown.
> Building a view with a SWT Browser is not the problem, but the integration
of Xforms.
>
>
> This is what I have tried so far:
>
> -used the Mozilla SWT Browser Plugin (www.eclipsemozilla.org) and
xulrunner (org.mozilla.xulrunner.win32.win32.x86_1.8.1)
> ->didn't work (HTML yes, XForms no)
>
> -tried to 'include' my Firefox - Plugins (with Xforms) by defining a
environment variable MOZ_PLUGIN_PATH (got it from
http://www.eclipse.org/swt/faq.php)
> ->didn't work (maybe I did something wrong)
>
> -tried to solve this problem with the help of some XForms engines:
>
> - Apog
|
|
|
Re: SWT browser with XForms support [message #528952 is a reply to message #528538] |
Thu, 22 April 2010 13:46 |
Tobias Messages: 4 Registered: April 2010 |
Junior Member |
|
|
Thank's for your reply.
I' ve checked again the possibility to solve the problem by using the environment variable "MOZ_PLUGIN_PATH".
I think that I've figured out something important:
Firefox extensions (like Xforms) are more different to Firefox Plugins (like a flash-Plugin) than I thought.
Moving the plugins to a new directory and pointing the "MOZ_PLUGIN_PATH" variable to that directory works fine.
I' ve tested it with the flash-Plugin (moved the content from "C:\windows\system32\Macromed\Flash" to my new plugin directory). The SWT-Browser can play flash clips (after setting the MOZ_PLUGIN_PATH variable)
Moving the extensions in the same way, don' t work. They are not found by the browser (stand-alone Firefox and SWT Browser). By the way: I'm using Firefox 3.0.19. There is no Xforms support for Firefox 3.5 and 3.6.
The extensions are stored in:
" C:\User\Username\AppData\Roaming\Mozilla\Firefox\Profiles\xx xxxx.default\extensions\ "
Hm- meanwhile this problem sounds like a problem for a mozilla forum.
Anyway, here is my little program, where I try to open a Xforms - document.
Both (the java-program and xhtml-document) are kept very simple.
java-program:
import java.io.File;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class mozilla {
public static void main(String[] args) {
Display display=new Display();
Shell shell = new Shell(display);
shell.setText("Hello Mozilla");
shell.setBounds(100,100,800,800);
shell.setLayout(new FillLayout());
File xulpath=new File("D:\\xulrunner");
//must be set to avoid exception: "[Could not detect registered XULRunner to use]"
System.setProperty("org.eclipse.swt.browser.XULRunnerPath", xulpath.getAbsolutePath());
Browser browser=new Browser(shell,SWT.MOZILLA);
browser.setUrl("file:///d:test.xhtml");
shell.open();
while (!shell.isDisposed()){
if(!display.readAndDispatch()) display.sleep();
}
display.dispose();
}
}
test.xhtml
<xhtml:html xmlns="http://www.w3.org/2002/xforms" xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<model>
<instance>
<document>
<title>the default title</title>
</document>
</instance>
</model>
<xhtml:body style="layout: grid; layout-padding: 10; layout-spacing: 10; layout-cols: 3">
<label>Example 1</label>
<input ref="/document/title" style="border:true; align: fill; hgrab: true">
<label>The title</label>
<hint>The default value is:</hint>
</input>
<trigger id="testButton" style="form-toolkit-style: false;">
<label>Click here</label>
</trigger>
</xhtml:body>
</xhtml:html>
The result should be a label ("Example 1") and a button ("Click here").
But without Xforms support, the SWT-Browser only displays some text ("the default title,Example 1,The title,The default value is: Click here") - no button.
|
|
|
Re: SWT browser with XForms support [message #529594 is a reply to message #528952] |
Mon, 26 April 2010 13:45 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
If a mozilla extension (not a plug-in) is needed to show this content then
there isn't currently Browser support for this, see
https://bugs.eclipse.org/bugs/show_bug.cgi?id=181008 . Depending on how the
extension is written, it may or may not be usable in xulrunner, since many
extensions that target firefox will reference xpcom types from firefox that
don't exist in xulrunner. Regardless, you can CC yourself to this report to
be notified of future progress on it.
Grant
"Tobias" <tt_dipl@hightower-darter.de> wrote in message
news:hqpjvh$uq9$1@build.eclipse.org...
>
> Thank's for your reply.
>
> I' ve checked again the possibility to solve the problem by using the
environment variable "MOZ_PLUGIN_PATH".
> I think that I've figured out something important:
>
> Firefox extensions (like Xforms) are more different to Firefox Plugins
(like a flash-Plugin) than I thought.
>
> Moving the plugins to a new directory and pointing the "MOZ_PLUGIN_PATH"
variable to that directory works fine.
> I' ve tested it with the flash-Plugin (moved the content from
"C:\windows\system32\Macromed\Flash" to my new plugin directory). The
SWT-Browser can play flash clips (after setting the MOZ_PLUGIN_PATH
variable)
>
> Moving the extensions in the same way, don' t work. They are not found by
the browser (stand-alone Firefox and SWT Browser). By the way: I'm using
Firefox 3.0.19. There is no Xforms support for Firefox 3.5 and 3.6.
> The extensions are stored in:
> " C:\User\Username\AppData\Roaming\Mozilla\Firefox\Profiles\xx
xxxx.default\extensions\ "
>
> Hm- meanwhile this problem sounds like a problem for a mozilla forum.
>
>
> Anyway, here is my little program, where I try to open a Xforms -
document.
> Both (the java-program and xhtml-document) are kept very simple.
>
> java-program:
>
>
>
> import java.io.File;
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.browser.Browser;
> import org.eclipse.swt.layout.FillLayout;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Shell;
>
> public class mozilla {
> public static void main(String[] args) {
> Display display=new Display();
> Shell shell = new Shell(display);
> shell.setText("Hello Mozilla");
> shell.setBounds(100,100,800,800);
> shell.setLayout(new FillLayout());
> File xulpath=new File("D:\\xulrunner");
> //must be set to avoid exception: "[Could not detect registered XULRunner
to use]"
> System.setProperty("org.eclipse.swt.browser.XULRunnerPath",
xulpath.getAbsolutePath());
> Browser browser=new Browser(shell,SWT.MOZILLA);
> browser.setUrl("file:///d:test.xhtml");
> shell.open();
> while (!shell.isDisposed()){
> if(!display.readAndDispatch()) display.sleep();
> }
> display.dispose();
> }
> }
>
>
>
> test.xhtml
>
>
>
> <xhtml:html xmlns="http://www.w3.org/2002/xforms"
xmlns:xf="http://www.w3.org/2002/xforms"
> xmlns:xhtml="http://www.w3.org/1999/xhtml">
> <model>
> <instance>
> <document>
> <title>the default title</title>
> </document>
> </instance>
> </model>
> <xhtml:body style="layout: grid; layout-padding: 10; layout-spacing:
10; layout-cols: 3">
> <label>Example 1</label>
> <input ref="/document/title" style="border:true; align: fill;
hgrab: true">
> <label>The title</label>
> <hint>The default value is:</hint>
> </input>
> <trigger id="testButton" style="form-toolkit-style: false;">
> <label>Click here</label>
> </trigger>
> </xhtml:body>
> </xhtml:html>
>
>
>
> The result should be a label ("Example 1") and a button ("Click here").
> But without Xforms support, the SWT-Browser only displays some text ("the
default title,Example 1,The title,The default value is: Click here") - no
button.
>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03598 seconds