Class JSCommand

java.lang.Object
overit.geocall.ui.JSCommand
All Implemented Interfaces:
SingleUseComponent

public class JSCommand extends Object implements SingleUseComponent
This class implements the SingleUseComponent interface, and represents a JavaScript command that can be added to the set of scripts (buildSetupScript(java.lang.StringBuilder)) and executed each time it is requested.
  • Field Details

  • Constructor Details

    • JSCommand

      public JSCommand(String js)
      Creates a new JSCommand object
      Parameters:
      js - The string that defines the JavaScript command to execute
  • Method Details

    • getHtml

      public org.apache.ecs.Element getHtml(EntitySet es, Window w)
      The html of this object is null
      Specified by:
      getHtml in interface SingleUseComponent
      Parameters:
      es - The EntitySet to which the element belongs
      w - The Window
      Returns:
      null
    • buildSetupScript

      public void buildSetupScript(StringBuilder sb)
      Every component can add a script to the StringBuilder, script executed when the component is created. The JSCommand add the JavaScript string passed as parameter in the constructor (JSCommand(java.lang.String)), to the global StringBuilder
      Specified by:
      buildSetupScript in interface SingleUseComponent
      Parameters:
      sb - The StringBuilder on which we want to add the script