org.apache.beehive.netui.tags
Interface IScriptReporter

All Known Implementing Classes:
Html, ScriptContainer

public interface IScriptReporter

A ScriptReporter acts as a container for JavaScript generated by children of the tag. Usually a ScriptReporter will gather up all of the JavaScript generated by children into a single <script> element output into the HTML. A script container will implement a map beteween the TagId and the real name or id attribute written into the HTML.


Method Summary
 void addAnchorPostRewriter(String rewriter)
          This method will add a method to be called which will handle state changes associated with an anchor post.
 void addInitMethod(String varClass)
          This method will add a new method to the initialization code.
 void addScriptCode(String script)
          This method will add Script as top level code that runs when the page is loaded.
 void addScriptFunction(String script)
          This method will add Script as a function.
 void addTagId(String tagId, String tagName)
          Adds a tagID and tagName to the id to name map.
 boolean isInitScriptWritten()
          Returns true if the writeInitScript method has been called.
 boolean isRunAtClient()
          This method will indicate that the ScriptReporter is supporting runAtClient features
 boolean isScriptWritten()
          This method indicates that the writeScript method has been called.
 void writeInitScript(StringBuilder sb)
          This method will output all of the Script that appears inside the tag.
 void writeScript(StringBuilder sb)
          This method will output all of the Script associated with the script reporter.
 

Method Detail

addScriptCode

void addScriptCode(String script)
This method will add Script as top level code that runs when the page is loaded.

Parameters:
script - the text of the script. This value must not be null.

addScriptFunction

void addScriptFunction(String script)
This method will add Script as a function.

Parameters:
script - the text of the function. This value must not be null.

addInitMethod

void addInitMethod(String varClass)
This method will add a new method to the initialization code.

Parameters:
varClass - the name of the variable containing the javascript feature

addAnchorPostRewriter

void addAnchorPostRewriter(String rewriter)
This method will add a method to be called which will handle state changes associated with an anchor post.

Parameters:
rewriter - the name of a method which will rewrite the anchor.

addTagId

void addTagId(String tagId,
              String tagName)
Adds a tagID and tagName to the id to name map. A script container can maintain a mapping of user ids to actual ids generated by the tagId. This method will track these.

Parameters:
tagId - - the id of a child tag.
tagName - - the name of a child tag.

isRunAtClient

boolean isRunAtClient()
This method will indicate that the ScriptReporter is supporting runAtClient features


writeScript

void writeScript(StringBuilder sb)
This method will output all of the Script associated with the script reporter.

Parameters:
sb - The script is written into the provided StringBuffer. This value must not be null.

writeInitScript

void writeInitScript(StringBuilder sb)
This method will output all of the Script that appears inside the tag.

Parameters:
sb - The script is written into the provided StringBuffer. This value must not be null.

isScriptWritten

boolean isScriptWritten()
This method indicates that the writeScript method has been called.


isInitScriptWritten

boolean isInitScriptWritten()
Returns true if the writeInitScript method has been called.

Returns:
true if the writeInitScript method has been called.