use WebKit as the Browser's underlying renderer
来源:互联网 发布:什么是组播mac地址 编辑:程序博客网 时间:2024/04/30 08:18
Which platforms support the SWT Browser, and which native renderers do they use?
SWT.NONE
use the following native renderers:- Windows 2000 and newer (Internet Explorer 5.5 and newer)
- Mac OS X 10.5 and newer (WebKit)
- Linux GTK (details)
- Solaris-x86 and Solaris 10 SPARC (details)
SWT.NONE
as this will attempt to use a native renderer that should not require additional software installation. However for clients with specific native browser requirements, the type of native renderer to use can be specified on a per-instance basis, see How do I explicity use WebKit as the Browser's underlying renderer? andHow do I explicitly use Mozilla as the Browser's underlying renderer?.Also note that as ofEclipse/SWT 3.7 it is possible to override the default native renderer that is used for SWT.NONE
-style Browsers, see How do I specify the default type of native renderer that is used by the Browser?.
As of Eclipse/SWT 3.7.1 a user canset a property to specify the type of native renderer to use for SWT.NONE
-style Browsers. Setting this property does not affect Browsers that are created with styles such as SWT.MOZILLA
or SWT.WEBKIT
. The property name is org.eclipse.swt.browser.DefaultType
and valid values for it currently include "mozilla
" and "webkit
". This property must be set before the first Browser instance is created.
The best opportunity for a user to set this property is by launching their application with a -D
VM switch (eg.- add to the end of the eclipse.ini file: -Dorg.eclipse.swt.browser.DefaultType=webkit
).
An alternate approach that an eclipse application may use is to provide a BrowserInitializer
implementation that sets this property. This implementation will be invoked when the first Browser instance is about to be created. The steps to do this are:
- Create a fragment with host plug-in
org.eclipse.swt
. - In this fragment create class
org.eclipse.swt.browser.BrowserInitializer
. - Implement a static initializer in this class that sets the
org.eclipse.swt.browser.DefaultType
property.
- Eclipse 3.7.x/4.1.x: Mozilla 1.4 GTK2 - 1.7.x GTK2, XULRunner 1.8.x - 3.6.x, WebKitGTK+ 1.2.x and newer
- Eclipse 3.8.x/4.2.x: Mozilla 1.4 GTK2 - 1.7.x GTK2, XULRunner 1.8.x - 3.6.x and 10.x (but not versions 4.x - 9.x), WebKitGTK+ 1.2.x and newer
SWT.WEBKIT
(@since 3.7). The runtime requirements for using WebKit-based Browsers are listed below. Note that failure to meet these runtime requirements will cause the Browserinstantiation to fail.- Windows:
- 32-bit SWT
- Safari must be installed
- For OSs older than XP+SP1, the path to the Apple Application Support installation must be prepended to Windows' "Path" environment variable before running eclipse. This installation will be in a location like "
C:\Program Files\Common Files\Apple\Apple Application Support
".
- Linux: WebKitGTK 1.2.0 or newer must be in the library load path. Examples of Linux distros that meet this requirement by default include Red Hat Enterprise Linux 6 and Ubuntu 10.04.
- OS X: No additional runtime requirements, the default renderer is WebKit-based.
It is important to note that conflicts have been reported between the dependent libraries of WebKit and Mozilla. As a result it is advised that Browser instances with these respective types not be mixed in an application. If a Browser with one of these types must be used in an application then java property org.eclipse.swt.browser.DefaultType
should also be set to this type to ensure that SWT.NONE
-style Browsers do not cause the libraries from the other native browser renderer to be loaded (see How do I specify the default type of native renderer that is used by the Browser?).
How do I use the WebKit renderer on Linux-GTK?
A: In Eclipse/SWT 3.7 and newer the Browser attempts to use WebKitGTK for SWT.NONE-style Browsers created on GTK. For this to succeed,WebKitGTK 1.2.0 or newer must be in the library load path. Examples of Linux distros that meet this requirement by default include Red Hat Enterprise Linux 6 and Ubuntu 10.04. Linux installations that do not meet this requirement will fall back to using Mozilla for SWT.NONE-style Browsers.
Eclipse/SWT 3.6.x can also use WebKitGTK for SWT.NONE-style Browsers created on GTK, but the user must explicitly request this by setting java property "org.eclipse.swt.browser.UseWebKitGTK
" to "true
". In the absence of this property being set, Mozilla is used for all SWT.NONE-style Browsers. (Note that Eclipse/SWT 3.6.x is only able to use WebKitGTK 1.2.x; it will fail if a newer WebKitGTK release is found.)
How can I determine which installed Mozilla browser is being used to render Browser content?
import org.eclipse.swt.SWT;import org.eclipse.swt.browser.*;import org.eclipse.swt.graphics.*;import org.eclipse.swt.widgets.*;public class DisplayMozillaVersion { public static void main(String[] args) { Device.DEBUG = true; Display display = new Display(); Shell shell = new Shell(display); System.out.println(">>>Snippet creating SWT.MOZILLA-style Browser"); try { new Browser(shell, SWT.MOZILLA); System.out.println(">>>succeeded"); } catch (Error e) { System.out.println(">>>This failed with the following error:"); e.printStackTrace(); System.out.println("\n\nSnippet creating SWT.NONE-style Browser"); try { new Browser(shell, SWT.NONE); System.out.println(">>>succeeded"); } catch (Error e2) { System.out.println(">>>This failed too, with the following error:"); e2.printStackTrace(); } } display.dispose(); }}
- use WebKit as the Browser's underlying renderer
- URL validation failed. The error could have been caused through the use of the browser's navigation
- Use nocase string as g_hash_table's key
- Get the browser's version info.
- [Magento] Use browser to run the index shell ?
- The Meridian Renderer
- disable the browser's Forward/Back buttons(msdn)
- Firefox Could not initialize the browser's security component
- XML as the TreeView's DataSource
- How can I force Python's file.write() to use the same newline format in Windows as in Linux (“\r\n”
- css just for webkit browser
- use this as the default and do not ask again
- Use the physical standby database as a test environment
- Use the Raspberry Pi as a DIY Surveillance camera
- What is the use of having destructor as private?
- The Underlying Technology of Messages
- Browser Helper Objects: The Browser...
- root用户无法运行tor解决办法(The tor browser bundle should not be run as root )
- System.map
- Eclipse的Dbug
- 禁用U盘小妙招!
- grep查找文件内容
- mysql学习足迹之一【linux环境下源码安装mysql-5.5.25版本数据库】
- use WebKit as the Browser's underlying renderer
- ubuntu 命令行 apt-get 代理 上网
- js中substring 和substr的区别
- android读写cookie的方法
- 信息生物学 谁写过动态规划算法 我只写出了打分矩阵
- Sql查询插入临时表
- mysql命令行下的一些使用
- android传感器学习之采样率和属性
- 堆和栈