Package org.opencms.gwt.client.util
Class CmsScriptCallbackHelper
- java.lang.Object
-
- org.opencms.gwt.client.util.CmsScriptCallbackHelper
-
public class CmsScriptCallbackHelper extends java.lang.Object
Helper class used to create a native Javascript function to call into GWT code.
-
-
Field Summary
Fields Modifier and Type Field Description protected com.google.gwt.core.client.JavaScriptObject
m_arguments
The stored arguments.
-
Constructor Summary
Constructors Constructor Description CmsScriptCallbackHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.gwt.core.client.JavaScriptObject
createCallback()
Creates a native JS function which, when executed, calls this object's run() method.void
installCallbackOnWindow(java.lang.String name)
Installs the Javascript function generated by this helper as a global function, i.e.void
run()
This method is called by the callback created by createCallback().void
setArguments(com.google.gwt.core.client.JavaScriptObject arguments)
Sets the function arguments so they can be accessed later in the run() method.
-
-
-
Field Detail
-
m_arguments
protected com.google.gwt.core.client.JavaScriptObject m_arguments
The stored arguments.
-
-
Constructor Detail
-
CmsScriptCallbackHelper
public CmsScriptCallbackHelper()
-
-
Method Detail
-
createCallback
public com.google.gwt.core.client.JavaScriptObject createCallback()
Creates a native JS function which, when executed, calls this object's run() method.- Returns:
- the JS function
-
installCallbackOnWindow
public void installCallbackOnWindow(java.lang.String name)
Installs the Javascript function generated by this helper as a global function, i.e. an attribute on 'window'.- Parameters:
name
- the function name
-
run
public void run()
This method is called by the callback created by createCallback().
-
setArguments
public void setArguments(com.google.gwt.core.client.JavaScriptObject arguments)
Sets the function arguments so they can be accessed later in the run() method.- Parameters:
arguments
- the function arguments
-
-