Instances of this class implement the browser user interface
metaphor. It allows the user to visualize and navigate through
HTML documents.

Note that although this class is a subclass of Composite,
it does not make sense to set a layout on it.

IMPORTANT: This class is not intended to be subclassed.

Since:

1.0

Currently implemented

text and url property

The enabled property in not (yet) evaluated.

Focus events are not yet implemented

Constructor Summary

Browser(Composite parent,
int style)
Constructs a new instance of this class given its parent
and a style value describing its behavior and appearance.

Method Summary

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.

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.

protected void

checkWidget()
Throws an SWTException if the receiver can not
be accessed by the caller.

java.lang.Object

evaluate(java.lang.String script)
Returns the result, if any, of executing the specified script.

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.

Browser

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 SWT which is applicable to instances of this
class, or must be built by bitwise OR'ing together
(that is, using the int "|" operator) two or more
of those SWT style constants. The class description
lists the style constants that are applicable to the class.
Style bits are also inherited from superclasses.

Parameters:

parent - a widget which will be the parent of the new instance (cannot be null)

execute

public boolean execute(java.lang.String script)

Execute the specified script.

Execute a script containing javascript commands in the context of the
current document.

Note: Care should be taken when using this method.
The given script is executed in an IFRAME
inside the document that represents the client-side application.
Since the execution context of an IFRAME is not fully
isolated from the surrounding document it may break the client-side
application.

This method is not supported when running the application in JEE_COMPATIBILITY mode.
Use BrowserUtil#evaluate instead.

evaluate

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 (ProgressListener.completed()
gives notification of this).

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:

An SWTException is thrown if the return value has an
unsupported type, or if evaluating the script causes a javascript
error to be thrown.

Note: Care should be taken when using this method.
The given script is executed in an IFRAME
inside the document that represents the client-side application.
Since the execution context of an IFRAME is not fully
isolated from the surrounding document it may break the client-side
application.

This method is not supported when running the application in JEE_COMPATIBILITY mode.
Use BrowserUtil#evaluate instead.

checkWidget

Throws an SWTException if the receiver can not
be accessed by the caller. This may include both checks on
the state of the receiver and more generally on the entire
execution context. This method should be called by
widget implementors to enforce the standard SWT invariants.

Currently, it is an error to invoke any method (other than
isDisposed()) on a widget that has had its
dispose() method called. It is also an error
to call widget methods from any thread that is different
from the thread that created the widget.

In future releases of SWT, there may be more or fewer error
checks and exceptions may be thrown for different reasons.