Class BrowserFactory
Browser. This offers several benefits over creating Browser normal
 way:
 - The same factory can be used many times to create several Browser instances
- The setters on BrowserFactory all return "this", allowing them to be chained
 Browser browser = BrowserFactory.newBrowser(SWT.NONE)//
                .url("http://www.eclipse.org") //
                .layoutData(gridData) //
                .create(parent);
 
 The above example creates a Browser for the eclipse website. Finally the Browser is created in "parent".
 BrowserFactory browserFactory = BrowserFactory.newGroup(SWT.NONE);
 browserFactory.url("http://www.eclipse.org").create(parent);
 browserFactory.url("https://www.eclipse.org/projects/").create(parent);
 browserFactory.url("https://www.eclipse.org/donate/").create(parent);
 
 The above example creates three browser using the same instance of BrowserFactory.
- Since:
- 3.25
- 
Method SummaryModifier and TypeMethodDescriptionSets that javascript will not be allowed to run in pages subsequently viewed in the receiver.Renders a string containing HTML.Renders a string containing HTML.static BrowserFactorynewBrowser(int style) Creates a new BrowserFactory with the given style.Begins loading a URL.Begins loading a URL.Methods inherited from class org.eclipse.jface.widgets.AbstractCompositeFactorylayoutMethods inherited from class org.eclipse.jface.widgets.AbstractControlFactorybackground, enabled, font, foreground, layoutData, orientation, supplyLayoutData, tooltipMethods inherited from class org.eclipse.jface.widgets.AbstractWidgetFactoryaddProperty, cast, create, data, data
- 
Method Details- 
newBrowserCreates a new BrowserFactory with the given style. Refer toBrowser(Composite, int)for possible styles.- Returns:
- a new BrowserFactory instance
 
- 
htmlRenders a string containing HTML. The rendering of the content occurs asynchronously. The rendered page will be given trusted permissions; to render the page with untrusted permissions usesetText(String html, boolean trusted)instead.The html parameter is Unicode-encoded since it is a java String. As a result, the HTML meta tag charset should not be set. The charset is implied by theStringitself.- Parameters:
- html- the html
- Returns:
- this
- See Also:
 
- 
htmlRenders a string containing HTML. The rendering of the content occurs asynchronously. The rendered page can be given either trusted or untrusted permissions.The htmlparameter is Unicode-encoded since it is a javaString. As a result, the HTML meta tag charset should not be set. The charset is implied by theStringitself.The trustedparameter affects the permissions that will be granted to the rendered page. Specifyingtruefor trusted gives the page permissions equivalent to a page on the local file system, while specifyingfalsefor trusted gives the page permissions equivalent to a page from the internet. Page content should be specified as trusted if the invoker created it or trusts its source, since this would allow (for instance) style sheets on the local file system to be referenced. Page content should be specified as untrusted if its source is not trusted or is not known.- Parameters:
- html- the html
- trusted-- falseif the rendered page should be granted restricted permissions and- trueotherwise
- Returns:
- this
- See Also:
 
- 
urlBegins loading a URL. The loading of its content occurs asynchronously.- Parameters:
- url- the URL to be loaded
- Returns:
- this
- See Also:
 
- 
urlBegins loading a URL. The loading of its content occurs asynchronously.If the URL causes an HTTP request to be initiated then the provided postDataandheaderarguments, if any, are sent with the request. A value in theheadersargument must be a name-value pair with a colon separator in order to be sent (for example: "user-agent: custom").- Parameters:
- url- the URL to be loaded
- postData- post data to be sent with the request, or- null
- headers- header lines to be sent with the request, or- null
- Returns:
- this
- See Also:
 
- 
disableJSSets that javascript will not be allowed to run in pages subsequently viewed in the receiver. Note that setting this value does not affect the running of javascript in the current page.- Returns:
- this
- See Also:
 
 
-