Class Hierarchy All Classes All Fields and Methods

 

Class com.ibm.faces.component.UIScriptCollector

java.lang.Object
        javax.faces.component.UIComponent
                javax.faces.component.UIComponentBase
                        com.ibm.faces.component.UIScriptCollector

public class UIScriptCollector
extends UIComponentBase

UIScriptCollector is a UIComponent that wraps other components on a JSF page.

It provides the following services:

Tags:
Renderers: ScriptCollectorRenderer

Field Index
Field Description
ADD_AT_BOTTOM Constant for addScript methods.
ADD_AT_TOP Constant for addScript methods.
COMPONENT_FAMILY The standard component family for this component.
COMPONENT_TYPE The standard component type for this component.
FIND_NEAREST Scope constant for find methods.
FIND_TOPMOST Scope constant for find methods.

Constructor Index
Constructor Description
UIScriptCollector() Constructor.

Method Index
Method Description
void addLibrary(String) Adds a new script library to the collection, making sure the exact same library wasn't already added.
void addScript(String) Adds a new script for the bottom of the script block.
void addScript(String, int) Adds a new script to the collection.
void addScriptOnce(String) Adds a new script for the bottom of the script block, making sure the exact same script wasn't already added.
void addScriptOnce(String, int) Adds a new script to the collection, making sure the exact same script wasn't already added.
UIScriptCollector find(UIComponent) Finds the topmost component for any given UIComponent, that is passed as a parameter.
UIScriptCollector find(UIComponent, int) Finds the right component for any given UIComponent, that is passed as a parameter.
HashMap getContributors() Returns all registerd script contributors.
MethodBinding getDecode()  
String getFamily()  
Vector getLibraries() Returns all collected libraries
MethodBinding getPostRender()  
MethodBinding getPreRender()  
Vector getScriptsBottom() Returns all collected scripts for the bottom of the script block.
Vector getScriptsTop() Returns all collected scripts for the top of the script block.
void register(IScriptContributor, UIComponent) Registers a new script contributor.
void reset() Discards all collected scripts, script contributors and libraries.
void setDecode(MethodBinding)  
void setPostRender(MethodBinding)  
void setPreRender(MethodBinding)  
void writeLibraryReference(String, FacesContext) Writes an include statement for a script library into ResponseWriter, making sure the exact same library wasn't already included.
void writeScriptOnce(String, FacesContext, boolean) Writes a Java Script into ResponseWriter, making sure the exact same script wasn't already written.

 

Fields

 

ADD_AT_BOTTOM

public static final int ADD_AT_BOTTOM

Constant for addScript methods. Scripts added with ADD_AT_BOTTOM will be outputed at the bottom of the SCRIPT block, after the contributers.

 

ADD_AT_TOP

public static final int ADD_AT_TOP

Constant for addScript methods. Scripts added with ADD_AT_TOP will be outputed at the top of the SCRIPT block, before the contributers.

 

COMPONENT_FAMILY

public static final java.lang.String COMPONENT_FAMILY

The standard component family for this component.

 

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE

The standard component type for this component.

 

FIND_NEAREST

public static final int FIND_NEAREST

Scope constant for find methods. Looks for the nearest parent tag.

 

FIND_TOPMOST

public static final int FIND_TOPMOST

Scope constant for find methods. Looks for the topmost parent tag.

 

Constructors

 

UIScriptCollector

public UIScriptCollector() 

Constructor. Allocates buffers to store scripts, script contributors and libraries.

 

Methods

 

addLibrary

public void addLibrary(String newLib) 

Adds a new script library to the collection, making sure the exact same library wasn't already added.

 

addScript

public void addScript(String newScript) 

Adds a new script for the bottom of the script block.

 

addScript

public void addScript(String newScript,
                      int addWhere) 

Adds a new script to the collection.

 

addScriptOnce

public void addScriptOnce(String newScript) 

Adds a new script for the bottom of the script block, making sure the exact same script wasn't already added.

 

addScriptOnce

public void addScriptOnce(String newScript,
                          int addWhere) 

Adds a new script to the collection, making sure the exact same script wasn't already added.

 

find

public static UIScriptCollector find(UIComponent component) 

Finds the topmost component for any given UIComponent, that is passed as a parameter.

 

find

public static UIScriptCollector find(UIComponent component,
                                     int scope) 

Finds the right component for any given UIComponent, that is passed as a parameter.

In case there are multiple ScriptCollector tags on the page, it is important to be able to find the correct Collector for a component to register its scripts with. This method can find either the closest or the topmost ScriptCollector on the page.

 

getContributors

public HashMap getContributors() 

Returns all registerd script contributors.

 

getDecode

public MethodBinding getDecode() 

 

getFamily

public String getFamily() 

 

getLibraries

public Vector getLibraries() 

Returns all collected libraries

 

getPostRender

public MethodBinding getPostRender() 

 

getPreRender

public MethodBinding getPreRender() 

 

getScriptsBottom

public Vector getScriptsBottom() 

Returns all collected scripts for the bottom of the script block.

 

getScriptsTop

public Vector getScriptsTop() 

Returns all collected scripts for the top of the script block.

 

register

public void register(IScriptContributor contributor,
                     UIComponent component) 

Registers a new script contributor.

 

reset

public void reset() 

Discards all collected scripts, script contributors and libraries. Resets buffers to zero length.

 

setDecode

public void setDecode(MethodBinding binding) 

 

setPostRender

public void setPostRender(MethodBinding binding) 

 

setPreRender

public void setPreRender(MethodBinding binding) 

 

writeLibraryReference

public void writeLibraryReference(String newLib,
                                  FacesContext context) 

Writes an include statement for a script library into ResponseWriter, making sure the exact same library wasn't already included. The URL for the library is encoded for the Portal using ExternalContext#encodeResourceURL.

 

writeScriptOnce

public void writeScriptOnce(String newScript,
                            FacesContext context,
                            boolean bWrapInScriptBlock) 

Writes a Java Script into ResponseWriter, making sure the exact same script wasn't already written.

Class Hierarchy All Classes All Fields and Methods