Note that although this class is a subclass of Composite,
it does not make sense to set a layout on it.
Important Note
This class is not intended to be subclassed.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static int | |
| pack-priv boolean | |
| pack-priv static final String | |
| pack-priv static final String | |
| pack-priv static final String | |
| pack-priv int | |
| pack-priv WebBrowser |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addAuthenticationListener(AuthenticationListener
the listener which should be notified listener)Adds the listener to the collection of listeners who will be notified when authentication is required. |
| public void | addCloseWindowListener(CloseWindowListener
the listener which should be notified listener)Adds the listener to the collection of listeners who will be notified when the window hosting the receiver should be closed. |
| public void | addLocationListener(LocationListener
the listener which should be notified listener)Adds the listener to the collection of listeners who will be notified when the current location has changed or is about to change. |
| public void | addOpenWindowListener(OpenWindowListener
the listener which should be notified listener)Adds the listener to the collection of listeners who will be notified when a new window needs to be created. |
| public void | addProgressListener(ProgressListener
the listener which should be notified listener)Adds the listener to the collection of listeners who will be notified when a progress is made during the loading of the current URL or when the loading of the current URL has been completed. |
| public void | addStatusTextListener(StatusTextListener
the listener which should be notified listener)Adds the listener to the collection of listeners who will be notified when the status text is changed. |
| public void | addTitleListener(TitleListener
the listener which should be notified listener)Adds the listener to the collection of listeners who will be notified when the title of the current document is available or has changed. |
| public void | addVisibilityWindowListener(VisibilityWindowListener
the listener which should be notified listener)Adds the listener to the collection of listeners who will be notified when a window hosting the receiver needs to be displayed or hidden. |
| public boolean | Returns: true if the operation was successful and false otherwiseNavigate to the previous session history item. |
| pack-priv static Composite | |
| pack-priv static int | |
| protected void | checkSubclass()
Checks that this class can be subclassed.
|
| protected void | checkWidget()
Overrides org. SWTException if the receiver can not
be accessed by the caller.
|
| public static void | |
| public boolean | Returns: true if the receiver was disposed, and false otherwiseAttempts to dispose the receiver, but allows the dispose to be vetoed
by the user in response to an |
| public Object | |
| public Object | |
| public boolean | |
| public boolean | Returns: true if the operation was successful and false otherwiseNavigate to the next session history item. |
| public String | Returns: the type of the native browserReturns the type of native browser being used by this instance. |
| public static String | |
| public boolean | Returns: the receiver's javascript enabled stateReturns |
| public int | getStyle()
Overrides org. |
| public String | Returns: HTML representing the current page or an emptyString
if this is empty.Note, the exact return value is platform dependent. For example on Windows, the returned string is the proccessed webpage with javascript executed and missing html tags added. On Linux and OS X, this returns the original HTML before the browser has processed it. Returns a string with HTML that represents the content of the current page. |
| public String | Returns: the current URL or an emptyString if there is no current URLReturns the current URL. |
| public Object | Returns: the receiver's JavaXPCOMnsIWebBrowser or null
Deprecated
SWT.MOZILLA is deprecated and XULRunner as a browser renderer is no longer supported.
Returns the JavaXPCOM nsIWebBrowser for the receiver, or null
if it is not available.
|
| public boolean | Returns: the receiver's back command enabled stateReturns |
| public boolean | isFocusControl()
Overrides org. true if the receiver has the user-interface
focus, and false otherwise.
|
| public boolean | Returns: the receiver's forward command enabled stateReturns |
| public void | |
| public void | removeAuthenticationListener(AuthenticationListener
the listener which should no longer be notified listener)Removes the listener from the collection of listeners who will be notified when authentication is required. |
| public void | removeCloseWindowListener(CloseWindowListener
the listener which should no longer be notified listener)Removes the listener from the collection of listeners who will be notified when the window hosting the receiver should be closed. |
| public void | removeLocationListener(LocationListener
the listener which should no longer be notified listener)Removes the listener from the collection of listeners who will be notified when the current location is changed or about to be changed. |
| public void | removeOpenWindowListener(OpenWindowListener
the listener which should no longer be notified listener)Removes the listener from the collection of listeners who will be notified when a new window needs to be created. |
| public void | removeProgressListener(ProgressListener
the listener which should no longer be notified listener)Removes the listener from the collection of listeners who will be notified when a progress is made during the loading of the current URL or when the loading of the current URL has been completed. |
| public void | removeStatusTextListener(StatusTextListener
the listener which should no longer be notified listener)Removes the listener from the collection of listeners who will be notified when the status text is changed. |
| public void | removeTitleListener(TitleListener
the listener which should no longer be notified listener)Removes the listener from the collection of listeners who will be notified when the title of the current document is available or has changed. |
| public void | removeVisibilityWindowListener(VisibilityWindowListener
the listener which should no longer be notified listener)Removes the listener from the collection of listeners who will be notified when a window hosting the receiver needs to be displayed or hidden. |
| public static boolean | |
| public void | setJavascriptEnabled(boolean
the receiver's new javascript enabled state enabled)Sets whether javascript will be allowed to run in pages subsequently viewed in the receiver. |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public void |
| DefaultType | back to summary |
|---|---|
| pack-priv static int DefaultType | |
| isClosing | back to summary |
|---|---|
| pack-priv boolean isClosing | |
| NO_INPUT_METHOD | back to summary |
|---|---|
| pack-priv static final String NO_INPUT_METHOD | |
| PACKAGE_PREFIX | back to summary |
|---|---|
| pack-priv static final String PACKAGE_PREFIX | |
| PROPERTY_DEFAULTTYPE | back to summary |
|---|---|
| pack-priv static final String PROPERTY_DEFAULTTYPE | |
| userStyle | back to summary |
|---|---|
| pack-priv int userStyle | |
| webBrowser | back to summary |
|---|---|
| pack-priv WebBrowser webBrowser | |
| Browser | back to summary |
|---|---|
| public Browser(Composite parent, int style) Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.
The style value is either one of the style constants defined in
class
| |
| addAuthenticationListener | back to summary |
|---|---|
| public void addAuthenticationListener(AuthenticationListener listener) Adds the listener to the collection of listeners who will be notified when authentication is required. This notification occurs when a page requiring authentication is encountered.
| |
| addCloseWindowListener | back to summary |
|---|---|
| public void addCloseWindowListener(CloseWindowListener listener) Adds the listener to the collection of listeners who will be notified when the window hosting the receiver should be closed.
This notification occurs when a javascript command such as
| |
| addLocationListener | back to summary |
|---|---|
| public void addLocationListener(LocationListener listener) Adds the listener to the collection of listeners who will be notified when the current location has changed or is about to change.
This notification typically occurs when the application navigates
to a new location with
| |
| addOpenWindowListener | back to summary |
|---|---|
| public void addOpenWindowListener(OpenWindowListener listener) Adds the listener to the collection of listeners who will be notified when a new window needs to be created.
This notification occurs when a javascript command such as
| |
| addProgressListener | back to summary |
|---|---|
| public void addProgressListener(ProgressListener listener) Adds the listener to the collection of listeners who will be notified when a progress is made during the loading of the current URL or when the loading of the current URL has been completed.
| |
| addStatusTextListener | back to summary |
|---|---|
| public void addStatusTextListener(StatusTextListener listener) Adds the listener to the collection of listeners who will be notified when the status text is changed. The status text is typically displayed in the status bar of a browser application.
| |
| addTitleListener | back to summary |
|---|---|
| public void addTitleListener(TitleListener listener) Adds the listener to the collection of listeners who will be notified when the title of the current document is available or has changed.
| |
| addVisibilityWindowListener | back to summary |
|---|---|
| public void addVisibilityWindowListener(VisibilityWindowListener listener) Adds the listener to the collection of listeners who will be notified when a window hosting the receiver needs to be displayed or hidden.
| |
| back | back to summary |
|---|---|
| public boolean back() Navigate to the previous session history item.
| |
| checkParent | back to summary |
|---|---|
| pack-priv static Composite checkParent(Composite parent) | |
| checkStyle | back to summary |
|---|---|
| pack-priv static int checkStyle(int style) | |
| checkSubclass | back to summary |
|---|---|
| protected void checkSubclass() Overrides org. Doc from org. Checks that this class can be subclassed.
The SWT class library is intended to be subclassed
only at specific, controlled points (most notably,
Important Note By providing an implementation of this method that allows a subclass of a class which does not normally allow subclassing to be created, the implementer agrees to be fully responsible for the fact that any such subclass will likely fail between SWT releases and will be strongly platform specific. No support is provided for user-written classes which are implemented in this fashion. The ability to subclass outside of the allowed SWT classes is intended purely to enable those not on the SWT development team to implement patches in order to get around specific limitations in advance of when those limitations can be addressed by the team. Subclassing should not be attempted without an intimate and detailed understanding of the hierarchy.
| |
| checkWidget | back to summary |
|---|---|
| protected void checkWidget() Overrides org. Doc from org. Throws an
Currently, it is an error to invoke any method (other than
In future releases of SWT, there may be more or fewer error checks and exceptions may be thrown for different reasons.
| |
| clearSessions | back to summary |
|---|---|
| public static void clearSessions() Clears all session cookies from all current Browser instances.
| |
| close | back to summary |
|---|---|
| public boolean close() Attempts to dispose the receiver, but allows the dispose to be vetoed
by the user in response to an
| |
| evaluate | back to summary |
|---|---|
| public Object evaluate(String script) throws SWTException Returns the result, if any, of executing the specified script.
Evaluates a script containing javascript commands in the context of
the current document. If document-defined functions or properties
are accessed by the script then this method should not be invoked
until the document has finished loading ( If the script returns a value with a supported type then a java representation of the value is returned. The supported javascript -> java mappings are:
SWTException is thrown if the return value has an
unsupported type, or if evaluating the script causes a javascript
error to be thrown.
| |
| evaluate | back to summary |
|---|---|
| public Object evaluate(String script, boolean trusted) throws SWTException Returns the result, if any, of executing the specified script.
Evaluates a script containing javascript commands.
When
If document-defined functions or properties are accessed by the script then
this method should not be invoked until the document has finished loading
( If the script returns a value with a supported type then a java representation of the value is returned. The supported javascript -> java mappings are:
SWTException is thrown if the return value has an
unsupported type, or if evaluating the script causes a javascript
error to be thrown.
| |
| execute | back to summary |
|---|---|
| public boolean execute(String script) Executes the specified script.
Executes a script containing javascript commands in the context of the current document.
If document-defined functions or properties are accessed by the script then this method
should not be invoked until the document has finished loading (
| |
| forward | back to summary |
|---|---|
| public boolean forward() Navigate to the next session history item.
| |
| getBrowserType | back to summary |
|---|---|
| public String getBrowserType() Returns the type of native browser being used by this instance. Examples: "ie", "webkit"
| |
| getCookie | back to summary |
|---|---|
| public static String getCookie(String name, String url) Returns the value of a cookie that is associated with a URL. Note that cookies are shared amongst all Browser instances.
| |
| getJavascriptEnabled | back to summary |
|---|---|
| public boolean getJavascriptEnabled() Returns
| |
| getStyle | back to summary |
|---|---|
| public int getStyle() Overrides org. Doc from org. Returns the receiver's style information.
Note that the value which is returned by this method may
not match the value which was provided to the constructor
when the receiver was created. This can occur when the underlying
operating system does not support a particular combination of
requested styles. For example, if the platform widget used to
implement a particular SWT widget always has scroll bars, the
result of calling this method would always have the
| |
| getText | back to summary |
|---|---|
| public String getText() Returns a string with HTML that represents the content of the current page.
| |
| getUrl | back to summary |
|---|---|
| public String getUrl() Returns the current URL.
| |
| getWebBrowser | back to summary |
|---|---|
| public Object getWebBrowser()
Deprecated SWT.MOZILLA is deprecated and XULRunner as a browser renderer is no longer supported. Returns the JavaXPCOM
| |
| isBackEnabled | back to summary |
|---|---|
| public boolean isBackEnabled() Returns
| |
| isFocusControl | back to summary |
|---|---|
| public boolean isFocusControl() Overrides org. Doc from org. Returns
| |
| isForwardEnabled | back to summary |
|---|---|
| public boolean isForwardEnabled() Returns
| |
| refresh | back to summary |
|---|---|
| public void refresh() Refresh the current page.
| |
| removeAuthenticationListener | back to summary |
|---|---|
| public void removeAuthenticationListener(AuthenticationListener listener) Removes the listener from the collection of listeners who will be notified when authentication is required.
| |
| removeCloseWindowListener | back to summary |
|---|---|
| public void removeCloseWindowListener(CloseWindowListener listener) Removes the listener from the collection of listeners who will be notified when the window hosting the receiver should be closed.
| |
| removeLocationListener | back to summary |
|---|---|
| public void removeLocationListener(LocationListener listener) Removes the listener from the collection of listeners who will be notified when the current location is changed or about to be changed.
| |
| removeOpenWindowListener | back to summary |
|---|---|
| public void removeOpenWindowListener(OpenWindowListener listener) Removes the listener from the collection of listeners who will be notified when a new window needs to be created.
| |
| removeProgressListener | back to summary |
|---|---|
| public void removeProgressListener(ProgressListener listener) Removes the listener from the collection of listeners who will be notified when a progress is made during the loading of the current URL or when the loading of the current URL has been completed.
| |
| removeStatusTextListener | back to summary |
|---|---|
| public void removeStatusTextListener(StatusTextListener listener) Removes the listener from the collection of listeners who will be notified when the status text is changed.
| |
| removeTitleListener | back to summary |
|---|---|
| public void removeTitleListener(TitleListener listener) Removes the listener from the collection of listeners who will be notified when the title of the current document is available or has changed.
| |
| removeVisibilityWindowListener | back to summary |
|---|---|
| public void removeVisibilityWindowListener(VisibilityWindowListener listener) Removes the listener from the collection of listeners who will be notified when a window hosting the receiver needs to be displayed or hidden.
| |
| setCookie | back to summary |
|---|---|
| public static boolean setCookie(String value, String url) Sets a cookie on a URL. Note that cookies are shared amongst all Browser instances.
The
Example value strings:
| |
| setJavascriptEnabled | back to summary |
|---|---|
| public void setJavascriptEnabled(boolean enabled) Sets whether javascript will 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.
| |
| setText | back to summary |
|---|---|
| public boolean setText(String html) Renders 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 use
The html parameter is Unicode-encoded since it is a java
| |
| setText | back to summary |
|---|---|
| public boolean setText(String html, boolean trusted) Renders a string containing HTML. The rendering of the content occurs asynchronously. The rendered page can be given either trusted or untrusted permissions.
The
The
| |
| setUrl | back to summary |
|---|---|
| public boolean setUrl(String url) Begins loading a URL. The loading of its content occurs asynchronously.
| |
| setUrl | back to summary |
|---|---|
| public boolean setUrl(String url, String postData, String[] headers) Begins loading a URL. The loading of its content occurs asynchronously.
If the URL causes an HTTP request to be initiated then the provided
| |
| stop | back to summary |
|---|---|
| public void stop() Stop any loading and rendering activity.
| |