Class CmsScriptCallbackHelper

java.lang.Object
org.opencms.gwt.client.util.CmsScriptCallbackHelper

public class CmsScriptCallbackHelper extends 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
    The stored arguments.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.gwt.core.client.JavaScriptObject
    Creates a native JS function which, when executed, calls this object's run() method.
    void
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • m_arguments

      protected com.google.gwt.core.client.JavaScriptObject m_arguments
      The stored arguments.
  • Constructor Details

  • Method Details

    • 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(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