BrowserFunction and
overriding its function(Object[]) method. This
method will be invoked whenever javascript running in the
Browser makes a call with the function's name.
Application code must explicitly invoke the
BrowserFunction.dispose() method to release the
resources managed by each instance when those instances are no
longer required. Since there is usually a correlation between
the registering of BrowserFunction(s) in a Browser and the
loading of a page in the Browser that is aware of these
functions, the LocationListener.changed() listener
is often a good place to do this.
Note that disposing a Browser automatically disposes all BrowserFunctions associated with it.
dispose(), function(Object[]), org.eclipse.swt.browser.LocationListener#changed(LocationEvent)
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Browser | |
| pack-priv String[] | |
| pack-priv String | |
| pack-priv int | |
| pack-priv boolean | |
| pack-priv String | |
| pack-priv String | |
| pack-priv boolean |
| Access | Constructor and Description |
|---|---|
| public | BrowserFunction(Browser
the browser whose javascript can invoke this function browser, String the name that javascript will use to invoke this function name)Constructs a new instance of this class, which will be invokable by javascript running in the specified Browser. |
| public | BrowserFunction(Browser
the browser whose javascript can invoke this function browser, String the name that javascript will use to invoke this function name, boolean true if the function should be accessible to the
top-level window and false otherwisethe names of the child frames that the function should
be accessible in frameNames)Constructs a new instance of this class, which will be invokable by javascript running in the specified Browser. |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| pack-priv void | |
| public Object | |
| public Browser | Returns: the Browser associated with this BrowserFunctionReturns the Browser whose pages can invoke this BrowserFunction. |
| public String | Returns: the BrowserFunction's nameReturns the name that javascript can use to invoke this BrowserFunction. |
| public boolean | Returns: true if this BrowserFunction has been disposed
and false otherwiseReturns |
| browser | back to summary |
|---|---|
| pack-priv Browser browser | |
| frameNames | back to summary |
|---|---|
| pack-priv String[] frameNames | |
| functionString | back to summary |
|---|---|
| pack-priv String functionString | |
| index | back to summary |
|---|---|
| pack-priv int index | |
| isEvaluate | back to summary |
|---|---|
| pack-priv boolean isEvaluate | |
| name | back to summary |
|---|---|
| pack-priv String name | |
| token | back to summary |
|---|---|
| pack-priv String token | |
| top | back to summary |
|---|---|
| pack-priv boolean top | |
| BrowserFunction | back to summary |
|---|---|
| public BrowserFunction(Browser browser, String name) Constructs a new instance of this class, which will be invokable
by javascript running in the specified Browser. The function will
be accessible in the top-level window and all child frames. To
create a function with a reduced scope of accessibility use the
You must dispose the BrowserFunction when it is no longer required.
A common place to do this is in a
| |
| BrowserFunction | back to summary |
|---|---|
| public BrowserFunction(Browser browser, String name, boolean top, String[] frameNames) Constructs a new instance of this class, which will be invokable
by javascript running in the specified Browser. The accessibility
of the function to the top-level window and its child frames is
determined by the
You must dispose the BrowserFunction when it is no longer required.
A common place to do this is in a
| |
| BrowserFunction | back to summary |
|---|---|
| pack-priv BrowserFunction(Browser browser, String name, boolean top, String[] frameNames, boolean create) | |
| dispose | back to summary |
|---|---|
| public void dispose() Disposes of the resources associated with this BrowserFunction. Applications must dispose of all BrowserFunctions that they create. Note that disposing a Browser automatically disposes all BrowserFunctions associated with it. | |
| dispose | back to summary |
|---|---|
| pack-priv void dispose(boolean remove) | |
| function | back to summary |
|---|---|
| public Object function(Object[] arguments) Subclasses should override this method. This method is invoked when
the receiver's function is called from javascript. If all of the
arguments that are passed to the javascript function call are of
supported types then this method is invoked with the argument values
converted as follows:
javascript null or undefined ->
| |
| getBrowser | back to summary |
|---|---|
| public Browser getBrowser() Returns the Browser whose pages can invoke this BrowserFunction.
| |
| getName | back to summary |
|---|---|
| public String getName() Returns the name that javascript can use to invoke this BrowserFunction.
| |
| isDisposed | back to summary |
|---|---|
| public boolean isDisposed() Returns This method gets the dispose state for the BrowserFunction. When a BrowserFunction has been disposed it is an error to invoke any of its methods. Note that disposing a Browser automatically disposes all BrowserFunctions associated with it.
| |