|
Eclipse Rich Ajax Platform | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.swt.browser.BrowserFunction
public class BrowserFunction
Instances of this class represent java-side "functions" that
are invokable from javascript. Browser clients define these
functions by subclassing 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.
Note that disposing a Browser automatically disposes all BrowserFunctions associated with it.
dispose()
,
function(Object[])
Constructor Summary | |
---|---|
BrowserFunction(Browser browser,
java.lang.String name)
Constructs a new instance of this class, which will be invokable by javascript running in the specified Browser. |
Method Summary | |
---|---|
void |
dispose()
Disposes of the resources associated with this BrowserFunction. |
java.lang.Object |
function(java.lang.Object[] arguments)
Subclasses should override this method. |
Browser |
getBrowser()
Returns the Browser whose pages can invoke this BrowserFunction. |
java.lang.String |
getName()
Returns the name that javascript can use to invoke this BrowserFunction. |
boolean |
isDisposed()
Returns true if this BrowserFunction has been disposed
and false otherwise. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BrowserFunction(Browser browser, java.lang.String name)
You must dispose the BrowserFunction when it is no longer required.
browser
- the browser whose javascript can invoke this functionname
- the name that javascript will use to invoke this function
java.lang.IllegalArgumentException
- SWTException
- dispose()
Method Detail |
---|
public void dispose()
Note that disposing a Browser automatically disposes all BrowserFunctions associated with it.
public java.lang.Object function(java.lang.Object[] arguments)
null
javascript number -> java.lang.Double
javascript string -> java.lang.String
javascript boolean -> java.lang.Boolean
javascript array whose elements are all of supported types -> java.lang.Object[]
If any of the Javascript arguments are of unsupported types then the
function invocation will fail and this method will not be called.
This method must return a value with one of these supported types to
the javascript caller (note that any subclass of java.lang.Number
will be successfully converted to a javascript number).
arguments
- the javascript arguments converted to java equivalents
SWTException
- public Browser getBrowser()
SWTException
- public java.lang.String getName()
SWTException
- public boolean isDisposed()
true
if this BrowserFunction has been disposed
and false
otherwise.
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.
true
if this BrowserFunction has been disposed
and false
otherwise
|
Eclipse Rich Ajax Platform | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) EclipseSource and others 2002, 2012. All rights reserved.